Set Color of All Lights

I have ~15 RGBW bulbs added using the Tuya cloud integration. I have another ~RGB light strips using the local MagicHome driver.

I'm looking for the best way to set the color of all the lights to red after 10 PM, then set the RGBW bulbs to 2300k CT and the strips to blue at 9 am. I do not have any modes setups. I do have groups for each device type using the Groups and Scenes app.

The problems I've ran into:

  • When using the group in RM to set the color, the lights turn on if they're off when the rule runs.
  • When using the individual bulbs in RM, they don't turn on, but it's a mixed bag of whether or not the change actually takes.
  • When manually setting the color using the group device, everything updates as it should and stays off if it's currently off.

It is normal for the "Set Color" command (along with "Set Color Temperature" and "Set Level") to turn on a light that is off, so that explains the first thing you see. It actually leaves the last as a bit of a mystery, since they should do the exact same thing, and for the most part, this behavior should be the same whether you're using the group or individual member devices (the only exception would really be Zigbee group broadcasting, which bypasses the Hubitat driver, but this doesn't sound like the protocol any of your lights use). The only exception for the commands I mentioned turning things on is "prestaging," which some drivers offer as a preference and should prevent this, but it can cause oddities in apps that expect the standard behavior, and I'd avoid it if you don't have a need. A way to preset level without this "legacy" preference has been created, which some drivers now offer, and hopefully we'll have something for color soon. I'm guessing this isn't your issue, but just in case...

Anyway, this means your second issue is also a bit odd. If I had to guess at that cause, maybe it's overwhelming your network with commands? Wi-Fi should certainly be able to handle this, but I'm not familiar with those particular lights, and if it uses the cloud, perhaps you're encountering throttling. Any error or warnings in "Logs" when things don't work? That may provide clues.

As to how to actually do what you want, Mode Lighting might be easier than making rules, assuming you have or could set up modes. But you should also be able to accomplish it with Rule Machine (and the right conditional actions, etc.) or a custom app. But hopefully this will give you some ideas to get started with regard ongoing device behavior.

1 Like

I did some more testing yesterday and figured a few things out:

  • For the RGBW Tuya bulbs intermittent's not a network congestion issue, but I did find that some of the bulbs appear to be having intermittent connectivity issues. One in particular that I found yesterday was showing intermittent drops through ping testing and was pretty consistently showing triple digit reply times. I did a power cycle and that cleared up. I have a pretty robust home network, so I don't think that's the issue. I'll monitor for a bit and see where I get. When checking the logs, there were some errors coming from the cloud integration for the device being "offline" but they were not a one for one parity.

I did stumble across the pre-staging and the odd behavior may be because of the device driver.

  • When setting any color on the Tuya bulbs, the Group device shows that the switch is turned on, but the bulbs don't actually come on. This same behavior occurs when using the individual devices instead of the group. They also stay off when the dimmer level is set individually. Where it got weird is that in the rule, I was setting color and the dimmer level. Apparently, doing both at the same time causes the lights to come on.

  • The RGB strips have a pre-staging option in the device preferences that was turned off. For these, any strips that were turned off when the rule runs wouldn't update their color. But, it would turn the strip back on (e.g. I have one in my living room that is often off when the rule runs. It would be set to blue. The rule would run to set it to red. It would just turn on, but still be blue). After enabling the pre-staging preference, the color does change, but the device still turns on. I may just have to write a rule around it.

All that to say, I rewrote the rule yesterday. I'm now just setting the color in one action and setting the dimmer level in another action. This is preventing the lights from being turned on when they change. So, the only outlying issues are the intermittent failures for the bulbs and the RGB strips coming on when adjusting the color.

Thanks for chiming in!

Download the Hubitat app