I’m sorry if I ask a question that’s been answered 10 times before, but I’m new to HA and am not familiar with coding.
In my situation I turned off the sound of my Ring door bell because my dog goes nuts when he hears the sound. I used the GUI to activate a light after someone pressed the door bell. In this case one of the HUE-lights turns red to indicate that someone’s at the door. Normally I reset the light to the normal condition to press the remote. In case I’m not at home, the light stays red until the end of days, which gives a nice warm red glow from the house at night. I don’t really like this “brothel” appearance and would like the light to return to the initial state after 30 minutes. If the light was on, it should return to that state, if it was off, it should turn off.
I saw some posts that might do what I want, but don’t have a clue how to implement them.
The simplest way is to create a 30 minute timer helper and start that running at the same time as you turn the light red. Then a second automation to turn the light off when the timer expires - but it sounds as if the real issue is how to turn it back to its previous state?
To store the original state, you might have a look at Variables+History:
Due to my lack of experience, for that task I’d utilize Scenes for the light color changes. That is, set up two Scenes, one with the standard color/brightness, and the other the colored light.
I surmise you can take it from there with the GUI/Automation, but the waiting for 30 minutes to reset the light is prone to fail if HA loses power or restarts during the wait. In that case, utilizing a Timer Helper in an automation would be what you’d want to pursue. You may not need to be concerned about this practically, but I thought it should be noted.
On the other hand, you might consider looking into how to stop the doorbell triggering the light if you’re not currently home.
Expanding on bob.t’s answer above, you can create a scene in the automation, before setting the light to red, which will save its current (prior) state. Then after the timer has expired, revert to that saved scene, which will revert the light to whatever state it was in before it was red.
You’ll want scene.create with snapshot_entities in the automation actions, and then a scene.turn_on after the timer.