I have a Gledopto RGBW controller and a strip in a display case. I recently added a contact sensor to the case. My goal is to have the sensor trigger the lights to go to white, so it's easier to see what I have in the case while the door is open. Otherwise, the strips are part of my "mood lighting" and are set to the same color as the rest of my strips in my living room. I also have a floor lamp next to the case I want to turn on when it's opened. I want both devices to return to their previous setting when the case is closed.
This is how I've set up my rule:
Triggered on contact sensor opening;
Capture (case strip light)(floor lamp)
Set dimmer on floor lamp to 100%
Set color and level of case strip light to white + 85%
Wait for trigger event (contact sensor closed)
Restore (case strip light)(floor lamp)
This is working for the floor lamp, but my strip lights are not being restored correctly. It seems to do completely random things. Sometimes it restores to a random color, sometimes it restores to a similar color with a different hue (saturation? I don't know color vocabulary much), sometimes it just stays on. If the strip light was off before opening the case, it won't turn off again. I tried adding a Refresh at the beginning of the rule, but that didn't help. Any advice?
I haven't messed with this at all since posting, but I did have a thought today. This strip light is always set through all my other automations, or through Google Home, as part of a group. My "mood lights" contain 3 other devices, and I'm wondering if maybe something is getting lost in translation between setting the device via group control, but then capturing the device state directly. I think I may try changing my rule to capture and restore the entire group, rather than the single device. I'm eager to hear if anyone has any insight here, but if not, I'll report back myself after trying it out, if only for posterity.
Is the light directly connected to Hubitat or is this connected to a Hue Bridge?
If the light is reading the correct state in Hubitat, then it should restore it to that state. But if the state is wrong, then the wrong state will be set when it restores. The only way to be sure is to check it when you're in that "waiting" state.
It's connected directly. I think you've helped me identify a problem, though. Upon your suggestion, I went and checked the current status of my strip light. It is currently a shade of blue, along with the other mood lights in the group, but when I go into the individual device, the device page says it's white. I checked the other individual devices, and only one device actually matches the group settings. I have 2 Gledopto controllers, a Sylvania RGBW bulb, and a Magic Home powered string light. The Magic Home device is the only one where the device page shows the same color as the group page. I think this means that capturing and restoring the group, rather than the individual device will work, but it raises a whole other question of why my device settings aren't updating in the device page.
Another weird thing: I tried refreshing the strip light to see if it would capture it's correct settings. It returned with a completely random color, some redish orange hue... The lights are still lit blue. Strange. Something isn't working right with polling this device
Well, capturing and restoring the entire group is indeed working the way I want it to. Strange that the individual devices won't report correctly, but it doesn't actually matter for my automations, since this workaround did the trick.