I created an automation that turns on the porch lights when motion is detected on my ring camera, then turns off the lights after a few minutes. The problem is that when I turn those lights on from the actual wall switch, and motion is detected, the automation will take over and turn the lights off. I want them to stay on when I manually flip the switch.
So, I created another automation that disables the motion automation when I turn the porch lights on from the wall switch. I then created yet another automation that re-enables the motion automation when I turn the lights off from the wall switch.
The problem is that when the motion automation turns the porch lights, it disables itself. There doesn’t seem to be a “manual” switch option listed in entities or anywhere else that I can see.
Does anyone have any suggestions on how to achieve this?
If you could post your actual automations, it’s much easier for us to help, because we can copy and/or edit what you already have. Not a requirement, but makes it easier!
I’ll assume, that your switch is somehow connected to HA, so you can get its state. If that’s the case, it’s relatively easy to circumvent your problem.
In theory, you would let the motion sensor trigger your (one!) automation, and if the switch is “in use” (aka on), you could simply break the automation at that point, so nothing would happen . If the switch is off, you could then let the motion take over and react on that.
It’s really hot here today, so I’m lazy, sorry: please post the automation and we’ll change it together to what is needed.
I solved this by using a timer for my exterior motion activated lights. The timer is started by the automation that turns them on, then a separate automation turns them off using the timer as a trigger. Operating the switch manually does not trigger the turn on automation, so…
In a similar situation, I have an input_boolean that is turned on when the manual switch is turned on and off when it is turned off, much as @paddy0174 suggests.
My automation controlling the light when motion is detected doesn’t run if the input_boolean is on. No need to touch the motion detector.
The input_boolean can also be turned on from a dashboard if I want to disable motion detection temporarily.
It appears that I was overthinking the problem. I simply went into the motion automation and made sure it also checked that the lights were off before it went any further. If the lights are on, it won’t run. Simple solution without creating a bunch of different automations!