Stop automation when I overwrite it manually

Hello,
I have a node red automation that turns on the lights when it is getting dark.
Sometimes I want to turn the lights off, but then the automation triggers again and the lights turn on again.
How can I solve this?

Many ways of achieving this. Maybe try adding an extra condition like a switch that is turned on. So when you turn on/off the switch you can practically enable/disable the automation in NodeRed

It is a zwave bulb, the wall switch is dumb and has to stay on all the time.
Any other ideas?

It depends…

  1. When you turn off the lights how do you do it? Apparently not with the physical switch. So, how?
  2. What triggers the node red automation?

Have a input boolean that is a condition in your automation.
Have this boolean reset every midnight or so and it should be an ok system

I turn on/off the light with hass or with a voice command (via rhasspy).
The node red automation is triggered when a movement is detected by aeotec multisensor.

I don’t understand your idea, can you please explain it with more details?

Add a helper input_boolean.
In your node red flow, before you turn on the light add a get state node and get the state of the input_boolean.
If the boolean is true then stop the message, if it’s false pass it on to turn on the light.

Ad an new sequence with a inject as the start, set it to trigger every night at 0:00 and add a call service to set the boolean to false.

Now add your boolean to your Lovelace.
This boolean is now your manual override.
If it’s off the automation will trigger as usual, if you set the boolean to on, the automation is disabled

Sorry input booleans have the states on or off I remembered. Just replace true with on in the above text

Thank, i will give it a try.

Tried and it works


Do you think I should move the Boolean check to the beginning of the sequence?

Generally, everything that can stop a code from running should be done as soon as possible.
It’s not much, but each time this runs it could “waste” CPU on sending the turn off command.

1 Like

So i understand the answer is yes?

Yes that is correct

I want to make a logic change to this sequence and don’t know how.

This Is the logic
The default is dynamic, which means:
When motion sensor event sends on turn light on.
When motion sensor event sends off turn light off.
I need to break this logic when I mark “always on” or “always off”.
Can’t seem to figure how to do it :frowning: