Physical Overrides for Motion Lighting in Node-RED

For those of you that use NR for your motion lighting automations, do any of you have a feature where the physical control of a switch, namely the brightness control of a dimmer, acts as an override to maintain the current and recently changed level until the light is turned off, and maybe even to keep the light on until it is manually turned off?

Currently I have a way to control whether or not the motion sensors are looked at for both on and off automations, but that is referencing a separate device as an input obviously. My worry is that if the input and output devices are the same, i.e. if I use the change in state of the switch to stop the change in state of the switch, it will be an endless loop that I cannot break out of.

Any ideas on how to solve this problem? I know it can be done as it is a feature of the HE Motion Lighting app, but I have not been able to get my head around it yet.

I am using a variable with change and switch nodes as a flow over-ride. I actually use a few in combination like this for some of my more advanced flows, like the system determining if I get a text to my phone when mail is delivered versus my googles playing an alert.

For lighting specifically I have a virtual switch for each room that toggles the automations on or off. This switch can be set via a button or with the voice command “hey google motion off”

Perhaps later today I will create a simple flow to share showing a couple ways of creating and controlling toggles in NR

1 Like

Yeah I have something similar, but I guess my question more is how to do you detect a physical brightness level change versus a digital one and further how do you keep the level, but maintain the auto off? Do you have a disable for the on and off sides of the flow so that you have more granular control?

For reference, here is one of my motion lighting flows, but all rooms are more or less consistent:

"Clean" Flow

Flow w/ Link Connections

As an aside, do you guys prefer using context variables or virtual switches for configurations like disable/enabling the automation? Also on the CORE, will there be an frontend interface for changing NR context variables?

Edit: I was just thinking, maybe I already have this feature and just didn’t know it. To prevent retriggers, I have the status of the light saved to a context variable, and the lights only turn on if the light is off, and conversely off if the light is on. Is it just me or would that not keep the current level accurate until it turns off via automation?

Same. I have dark point in lux for both light on and light off. If the lux level goes above a certain level (easily configurable), then the lights turn on/off depending on whether they are already on/off.