Hello,
I have modded some cheap smart lights that are controlled with an esp8266 to incorporate a PIR motion sensor in the centre of the light, the issue I’m facing when trying to get the PIR sensor to turn on the lights is that when the lights turn off, the PIR gets triggered, turning the lights back on, making a feedback loop. I figured this would happen, so I 3D printed a backout “nipple”
try to stop the light but it didn’t do anything.
i cant think of any solutions to this, does anyone have any way of getting the automation not to trigger when the lights turned off (and the pir fires again)?
split the automations into two - one for ‘on’ and one for ‘off’. then in the actions right before the light gets turned off put in an action to turn off the ‘on’ automation. then when the lights are off turn the ‘on’ automation back on.
I can’t think of a way to do it with one automation tho.
I do the same for some motion activated lights i have as well.
My OCD won’t allow me to have 2 automations to do 1 task, I was hoping that it was possible to disable the binary_sensor in ESPHome for a few seconds after the light is switched off. this would allow it to fit in 1 automation
IMHO, there is way too much of an emphasis that I see on “making it all in one automation” instead of making it easier, more readable/maintainable and most importantly functional.
there is literally no downside (not withstanding your OCD) to splitting it up into two automations if it helps with the above criteria.
See, but you aren’t doing one task. You are doing two (albeit related) tasks - one to turn on the light and another to turn off the light.
You are trying to force those two tasks into a single automation at the (likely) expense of functionality.
I’m not saying you can’t do that but aren’t you now just moving the “second automation” from HA into ESPHome?
Shouldn’t that also trigger your OCD?
Not to mention then it would be way more complicated because you would have way more moving parts since ESPHome would send the motion signal to HA then later HA would need to send a signal to ESPHome that the light needs to be turned off so ESPHome should disable the motion sensor then the light gets turned off by HA then HA needs to send a signal to ESPHome to turn on the motion sensor again.
If it was me I would just make them into two VERY easy automations and be done with it.