How to trigger on both presence sensor status and system variable change


#1

1) Give a description of the problem
I want to change Smart Home Monitor Status and Location Mode based on presence sensors and the time of day.

2) What is the expected behavior?
Piston runs on changes of either presence sensors and system variables

3) What is happening/not happening?
The piston does what I want if I manually click the Test button. If the presence sensor changes status, the piston also executes correctly, but changes in the $hour24 system variable don’t seem to trigger the piston.

**4) Post a Green Snapshot of the piston

or

How do I achieve the desired behavior?


#2

It looks like that I should use the virtual device “Time” instead of $hour24.


#3

Yes, you should use the virtual device ‘time’ but this still won’t trigger on time since this will be a condition vs a trigger. I suggest you add a forced run every day at 7 and 11.


#4

This actually triggers correctly both on set times and on presence state changes. I think it’s because I don’t have a trigger in my conditional statements.


#5

Got it. I had read for conditionals it will only evaluate the first one but since you made them groups there is only one in each if so it all works. Very good.