Simple Toggle Color not working right - maddening

Not sure what's up here.

This is a VERY simple rule on a button controller. It toggles the RGB strip off, but when it toggles it back on, the Saturation is 100 not 79. Very frustrating and I have no idea what

This is a Zen31 RGB controller and I am controlling the _color child object.

So....it's not actually always setting the Saturation to 100. Turns out, that when it toggles the light back on, it's actually setting the color to whatever is in the devices' "color" setting, regardless of what my rule says.

Now it always comes on Red

Seems broken...how do I fix this?

Evidently Toggle Color is completely broken. I can see the bad code. We will see if we can't get a fix out for you tomorrow.

6 Likes

This is why I really like Hubitat and the guys who run it.

This is how I used to run my lab automation group: see a problem, fix it.

Can you imagine any other company being this involved and responsive? Thanks to all the people at Hubitat who keep things happening.

6 Likes

Thanks!

Unfortunately this isnt fixed after the update. In fact, I think there's something wrong with the driver itself. I think this is why I switched the Brian Copland driver at one point...but this really has to get fixed.

So I do still have the issue with toggling coming back to the wrong color....but also..

The parent device will affect the child devices. For instance....if the parent device somehow gets set to 50 (I dont even know how this could happen, I dont have any rules associated with it), then the child "Device_Color" will never go above 50 no matter what you do.

Similar things happens with "Blue Level", "green level" on the parent device.

I think Hubitat needs to decide:
If you're doing to do child-device model...there should be no color settings in the parent.

I dont even know why there are child devices...what is the purpose?

I'm pretty sure the app portion of this IS fixed. Do you have any evidence to the contrary? As for the driver portion, I defer to @bcopeland. I know you need both to work, but the fix I did was only with respect to the app bug.

So here's my evidence :slight_smile: This video shows what happens.

On the left is my simple toggle color rule.
Top Right is the OfficeLED-Strip_Color
Bottom Right is the OfficeLED-Strip (parent device)


This Hue/Saturation produces a very soft-white type color (when it actually works)

However in the video you will see that if I set the color of OfficeLED-Strip_Color to be Blue...my rule only toggles to the same blue color. If I set it to orange...my rule only toggles the same orange color.

The last thing the video shows is that if I set the parent device to 50%, the child device will never go above 50%, even if the rule says to go to 100%.

SO my questions are so many:

  • Why does the parent device AND the child device have color settings?
  • Why is the parent device Red/Green/Blue, but the child device Hue/Saturation/level?
  • If there's color settings in the parent device...how come I cannot use that device with "Toggle Color" action?
  • Why are there child devices at all? What purpose does this serve?

I'm sorry that you are having this problem. Unfortunately, your video is of no value to understand or diagnose what is going on. What I meant by evidence is logs that show specific things happening, not a video. Can you show logs that show the action from the rule to toggle the light to Hue 9, Sat 79, that result in a log for the device showing some different command hitting the device? Before the bug fix, that was clearly the problem. And that is the bug that was fixed.

I don't know anything about this device, and cannot answer these questions. I will ask the engineer to take a look.

This appears to be a driver issue, I am investigating..

2 Likes

Thanks for lookin at it

Anything on this? Keep trying different stuff as a work around to get this basic function working correctly, but nothing works.

A year later and I tried to do this again with newest rule engine. Still no luck. Hubitat toggles the Zen31, and it looks like it's trying to set the color in the log...but it doesnt. I have to click the "set color" button in device properties to get it to change.

Thats why I originally included a video. Because the logs look like it's doing what it is supposed to do...but it's not.

This log is me toggling several times. Then manually clicking the set-color button to level 97, sat 45, hue 0 (which works successfully) and then toggling again, which results in no light at all until I click "set color" again

Blockquote
dev:8192022-09-30 12:21:12.280 pminfoOffice_LEDZen31-color level is 9%
dev:8192022-09-30 12:21:12.258 pminfoOffice_LEDZen31-color saturation is 74
dev:8192022-09-30 12:21:12.242 pminfoOffice_LEDZen31-color hue is 9
dev:8192022-09-30 12:21:12.227 pminfoOffice_LEDZen31-color colorName is Orange
dev:8192022-09-30 12:21:09.702 pminfoOffice_LEDZen31-color switch is on
dev:8192022-09-30 12:21:04.362 pminfoOffice_LEDZen31-color switch is off
dev:8192022-09-30 12:20:06.819 pminfoOffice_LEDZen31-color level is 97%
dev:8192022-09-30 12:20:06.794 pminfoOffice_LEDZen31-color saturation is 45
dev:8192022-09-30 12:20:06.779 pminfoOffice_LEDZen31-color hue is 0
dev:8192022-09-30 12:20:06.764 pminfoOffice_LEDZen31-color colorName is Red
dev:8192022-09-30 12:20:04.241 pminfoOffice_LEDZen31-color switch is on
dev:8192022-09-30 12:19:59.821 pminfoOffice_LEDZen31-color switch is off
dev:8192022-09-30 12:19:57.182 pminfoOffice_LEDZen31-color switch is on
dev:8192022-09-30 12:19:47.801 pminfoOffice_LEDZen31-color switch is off
dev:8192022-09-30 12:19:44.952 pminfoOffice_LEDZen31-color switch is on
dev:8192022-09-30 12:19:39.693 pminfoOffice_LEDZen31-color switch is off
dev:8192022-09-30 12:19:39.492 pminfoOffice_LEDZen31-color level is 9%
dev:8192022-09-30 12:19:39.470 pminfoOffice_LEDZen31-color saturation is 74
dev:8192022-09-30 12:19:39.461 pminfoOffice_LEDZen31-color hue is 9
dev:8192022-09-30 12:19:39.453 pminfoOffice_LEDZen31-color colorName is Orange
dev:8192022-09-30 12:19:36.921 pminfoOffice_LEDZen31-color switch is on

Show the logs for the rule (turn on Action logging in the rule). Also, show the rule itself. Better to use screenshots for both please.

Now I believe the rule doesnt set the color because it think the device is already set to the right color. So now I change the color manually, and toggle again.

It looks like it sets it back according to the rule, but the light is "on but dark", as if the level is set to zero.


If the bulb is on (switch attribute is "on"), toggle color turns it off. If the bulb is off (switch attribute is "off"), toggle color sends the device a setColor command with the hue, saturation and level values. How the device responds to that command is up to the driver/device.

What i'm saying is the last set of commands there, results in the Zen31 being "ON" but no light being emitted. If I click the "set color" in the device settings, it lights up.
image

That's a device issue. I don't know why it would do that. What driver is this?

image
Which gets added as a child device of:

image

Not a clue. Maybe @bcopeland can chime it.

What happens if you put those three values into the setColor command on the device page? With the same prior condition of the bulb....