I have a Wyze PIR that controls the light in my bathroom. This flow was a bit complicated bc I needed to prevent the light from going off when someone is in the shower.
When the PIR goes ON/detected, it stays in that state for about 45 seconds, then flips back to OFF/clear. The ON side of this flow is working pretty well - it’s the OFF side where I’m failing.
When the OFF state fires, it passes to a 3 minute Stoptimer before passing through to the turn_off node. However…if the PIR gets tripped (within that 3 minute timer) it doesn’t come through and reset the timer - so no matter what, the light turns off at the end of the timer.
It’ll turn right back on if you’re in there and the PIR trips again, but having the light go off…then back on is not pleasing to my wife
I’ve only been messing with Node-REd for about 10 days, so I’ve kind of exhausted my knowledge. How can this be modified to avoid this OFF/ON cycle?
Here is an export of this flow: https://pastebin.com/sH9ZaPtM
Edit: Version #2 here - maybe better? https://pastebin.com/cjEjWc5L