Change LED color if door left open

Thank you r.balneaves for your rule.

I spent some time trying to play around with this because I need something similar to let me know when the garage doors are open - i.e. turning lights on if off and setting them to 100% red, then when all garage doors close, turn the lights back to their original colour/brightness and turn them off if they were off or leave them on, if was on.

It isn't finished since I have to add more lights and the time (after 10pm), but I added a delay in certain places and was able to get my lights to restore to their original colour and brightness.

I think the Hubitat needs a few seconds to process the Capture and Restore functions before the light is turned off.

Note: when the light was on, without the delay the Capture and Restore worked for me

Could use some help with adding to the above rule.

I want to actually have multiple lights do the above:
If on: stay on and turn red, then turn back to original color and stay on.
If off: turn on, change to red, then turn back to original color and then turn off.

I've been trying this with groups but I cant make the variable part work (the if on, keep on/if off, turn on then change).

I think the rule above would get rather messy if i add 4 local variable for the 4 bulbs I want to control. But I will try this when i have some more time.

Hubitat will report only one current switch state for the group, on or off, depending on your settings in the Groups and Scenes "Group" app. From the 2.1.5.124 release notes where this feature was introduced last fall:

There are now three choices available: (1) The group device on/off state reflects the most recent activity of the group device, and does not reflect anything about the actual state of the group members; (2) The group device will be on if any of the group members are on; and (3) The group device will be off if any of the group members are off.

If you want to remember the on/off state for each bulb within the group, you will have to use some workaround like your suggestion above (e..g, one variable per bulb). You will also run into the same problem for color and level--the group only reports one state.

An alternative to the above might be creating a scene with all of these bulbs. Select all relevant bulbs as belonging to the scene. "Initialize" the scene with whatever settings you want; it will soon not matter. Choose the option to create a "capture device" for this scene. Instead of all the capture/restore actions for the bulbs or groups in RM (and the extra "on/off" variable step), just activate the "scene capture" device before and the "scene activator" device afterwards. The only downside I see here is you have an "extra" device on your system that you are not using for any purpose besides this, but I'd say that's a good tradeoff if it makes everything easier.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.