Wait until with PIR sensor

Hi,
I have a slightly odd use case. We have a humidistat fan in an en-suite bathroom. To stop it going off at night I have installed a smart socket to control it based on a timer, I know it slightly defeats teh idea of the humidistat, but if it works for the other 18 hours of the day it should be OK.

I have set the timer so it provides power enabling the fan to work at 6:45am, off at 22:30 pm which is when we usually get up/go to sleep, but in an ideal world, I would like to add a PIR to delay the on-time i the morning until either a PIR detected movement or an hour of time has passed.

I’ve set up a node-red timer using light schedular to create an on/off timer, and I was thinking about using a wait-until node to wait for detection of movement from a Sonoff PIR sensor for an hour of time to pass (whichever is sooner) before turning the switch on.

I thought I could do that with this:

But it never seems to trigger on PIR, what am I doing wrong?

Thanks
Paul

You want to wait until the state is on not the entity_id

image

1 Like