Piston not reading virtual switch correctly?


#1

I created a piston to turn on the pool pump at 7am and turn it off at 10am. As part of the piston, i have a virtual switch that I added in there to allow me to bypass the schedule when i want to (by turning off the virtual switch), so that I dont have to pause the piston. The problem I am having is that the piston works perfectly when i first start it with the virtual switch on. But whenever i turn the virtual switch off and back on again, it never fires again, even though the virtual switch is on. What I’ve found is that once i turn the virtual switch off and back on, after that it will never schedule the next event. The only way to fix it is to pause and unpause the piston.

I will figure out how to capture and upload logs if i need to. But i thought maybe its something simple, since i’m pretty new to this.

Here is a screenshot of the piston. Note, next scheduled shows “never”. The virtual switch is currently turned on, but i had turned it off and back on.

And this happens whenever I pause and unpause the piston (its not shown in above screenshot, but i also have it scheduled to turn the pump on at 4pm and off at 7pm). So pausing and unpausing causes it to start working again.


#2

For giggles, drag the Time happens so that the trigger is above the Pool pump condition.


#3

As @eibyer suggests, I’m pretty sure you need to move the time happens triggers above the virtual switch conditions.

Your piston can only run automatically at the two times you set. If the switch is off when the piston runs the time trigger is not evaluated (the AND is already false so there is no need) and if it is not evaluated it won’t reset the schedule.

As a general rule, if you have a trigger condition in your piston that causes it to subscribe to certain device events or schedule time events, always make sure that trigger gets evaluated when those events happen.