Why doesn't this trigger like it should? Seems simple


#1

I’d like this to trigger if the light bulb downstairs is on (e.g. TV room is occupied) and there’s no one upstairs (e.g. motion sensor stays inactive for 45 minutes). I also only want it to trigger in the after 6 PM.

The first block seems simple enough, but it seems like it won’t trigger unless the bulb is on, I go upstairs, then go back downstairs, and 45 minutes later it’ll trigger.

What am I missing? I want it to trigger if the bulb is on and the motion sensor stays inactive.


#2

The problem is this will trigger as soon as motion has been inactive for 45 minutes but that might not be after 6 or when the light is on. So then when you go upstairs after 6 (or less than 45 minutes before 6) the timer resets and 45 minutes later it triggers again. It doesn’t trigger on the time or the light on as shown by the lightning bolts. It might work if you change the motion stays inactive to a group adding in motion is inactive for 45 minutes. Or you might need additional triggers for the case where no one has been upstairs for a while leading up to 6 pm.


#3

Triggers first conditions later…try that way


#4

I agree that’s the principle, but that’s not what’s happening. Case in point, I came home last night after work 9:30 PM, wife was already in bed. When I walked in the door, motion triggered. No problem. I got changed and went downstairs. I was down there for and hour and a half, TV and light on the whole time, no motion upstairs (verified by double checking the history of the motion sensor) and it still didn’t trigger.


#5

Does the order matter? It was my understanding that if there is a trigger and a condition in the same block, it’ll subscribe to the Trigger first and then check the conditions once the trigger “executes”. I didn’t think the order in the block mattered. Does it?


#6

I have learned from other programming languages to place the precise trigger first, and then do my conditional checks once the trigger fires. I have carried over that logic to webCoRE.