Flickering lights and outlets

Hello everyone
I want to create a scene that detects a door opening; while this door is open I make a lamp blink in yellow. As long as the door is open the lamp must blink. Then when the door is closed the lamp changes color and must stop blinking but remain steady. A door contact sensor on the door and that’s it.
The problem is that Gladys’s blinking function is timed and therefore does not react to the door closing because the lamp keeps blinking inexorably. So I turn the lamp off!, but when I turn it back on in steady mode the blinking takes over.

So there should be a solution in the blinking function that is not tied to that timing. Permanent blinking until the lamp is turned off.

or else
@bjm says: « it seems to me that it is impossible to kill a scene when it is running ».
That would be the idea, to have a function kill a task or Stop

which could interrupt the start of the blinking, a timer (to be sure the timer ends), of a scene started inadvertently
What do you think? (I have no idea how this could be implemented)
I saw there was already a feature request about running scenes here, but the same thing would be needed for timers

Indeed!

You have some slightly more « hacky » options in the meantime, like having a virtual device « lamp should blink », and a scene that runs every X seconds to check if that device is at 1, and if so blink for the same interval as the scene’s check interval

Otherwise it’s also doable via Node-RED :slight_smile:

But I agree it would be nice to have an exit condition in the « blink » action

2 Likes

Am I making a feature request?

Do you have any idea what it might look like?

I don’t have any idea, to be honest.

For me, you start the blinking and as long as you don’t turn off the lamp, it keeps blinking.
I noticed

The issue is that right now there’s no way to know whether the lamp is off because it’s in the « OFF » phase of the blinking cycle, or if it’s OFF because someone turned it off manually — there’s no distinction.

But I admit we could compare the update timestamps, and if they’re not exactly the same, stop. This will be investigated in any case :slight_smile:

I’d appreciate it if you could create a feature request!

Ok I’ll do it
Thanks @pierre-gilles

1 Like