Is it possible to capture a device status and then restore it to another?
The use case is, I'm trying to get the outdoor light next to front door to turn green when the door is unlocked. When the door is re-locked, the bulb can't simply turn off, I need it to fall back in sync with the other outdoor lighting, there are a few possible states.

Just capture the bulb, turn it green, wait for event, restore the bulb.

I might try that, however the reason I didn't... it get's a little complicated. When motion is detected outside, the level of these bulbs increases for a few minutes, then returns to 33%. I figured the most accurate way would be to simply copy the state of another bulb to avoid any issues with things syncing back up.

without a way to copy and paste state, if I just return the bulb to white, 33%, worst case scenario is it takes a few minutes for the other bulbs to return from 100 to 33. Not perfect but not bad :slight_smile:

Hypothetically, you could store (in a Hub variable) the brightness level (as a Number) that your outdoor lights are supposed to be set to – keeping it updated as various Modes or Actions dictate – and read that variable to set the Level of the light next to the door.

Another path to consider is having a Scene Activator (virtual switch) associated with the "scene" that involves motion, such that when that "scene" happens to be active, the following IF-THEN in RM could appropriately set the door light to the appropriate level:
IF (Activator = ON) THEN
Set Door_Light LEVEL = 100
Set Door_Light LEVEL = 33

Just my $0.02

You can copy the attributes of the "source" bulb into local variables in your Rule, and then set the "copy" bulb with them, like this:

Screenshot 2022-09-15 at 13-20-13 Copy Bulb 1 to Bulb 2

Screenshot 2022-09-15 at 13-19-34 Copy Bulb 1 to Bulb 2

1 Like

I prefer @LibraSun 's method of using a variable for "normal" state....

I currently have a variable that is adjusted at select intervals to mimic circadian rhythm in my basement where there is minimal ambient light. I have rules that break the normal cycle (watching a movie [dimmed to 10%], game night [full brightness], etc). The return to normal condition is based on the variable value no matter what the previous state was.

1 Like

Download the Hubitat app