How do you handle manual overrides in motion-sensor-controlled flows?

Hey!

i´ve got a motion-sensor-controlled flow and i´m writing functions that set and get context to get over this problem, but i want another more nice solution for manual overrides.

Do you have one?

Specific problem:
I´ve got my lights in Lovelace to turn them on and off. If i do so, i want to “override” the motion-sensor control for the light.
Possible solutions:

  • make an input boolean as switch for the lights and read current state
  • poll state of the light to context, and check, based on a intervall
  • ???

There has to be a really simple solution, that i can´t see.

Please enlighten me! :slight_smile:

Does this help?

Yes, of course thats possible, and several ways to achieve it. I am just employing an internal node red logic for that. If the automation from NodeRed Triggers, it will set a variable to 1. Only if this variable is 1 the motion activated lights will change or turn off after some time.
If the lights, are already on, turn off or are changed for anything outside this automation the variable is set to 0 or doesnt change to 1. That works wonderfully for me for ages. Seems like you are using the same logic for this.

Another option would be to check for the user id of the light change.
i.e.:
data.new_state.context.user_id

Your NodeRed will have a unique user_id as will your commands from lovelace.

1 Like

How about using the traffic light to block messages going to the nodes that turn on/off the lights ?
When control should be disabled, you put the traffic light to red. It will block all messages then.

That is the way i´ll go!