I have configured a script that is being called by an automation which is triggered by pressing the main door ring bell button.
The main goal of the script would be:
Get the current initial light state at the moment of pressing the main door ring bell, then make the light blinking for 5 seconds and finally get back to the lights initial state at the moment of pressing the main door ring bell.
Somehow my code is not working, the light starts to blink but then won’t get back to its initial state. What am I missing?
Thanks in advance!
I haven’t performed tests to confirm it but your results suggest a snapshot scene doesn’t record the state of a light’s effects (just the basics like the light’s state, brightness, color).
After you created the snapshot scene, you applied an effect to the light (“breathe”). When you restored the scene, it had no record of what effect, if any, the light had previously so the light continues to “breathe”.
I found out by myself. Somehow I have to turn off the light completely after blinking, then it works.
Here’s the code in case that might help someone else: