Trying to figure out how to override a scheduled rule in ST using a virtual switch


#1

1) Give a description of the problem
What I am trying to create is a way to override my pool pump running at its scheduled time by turning “On” a virtual switch that I call “Pool Pump Override Switch”. I have been trying today but am getting confused. This is my first attempt at a piston and really need guidance.

2) What is the expected behavior?
Virtual switch “ON” - Schedule interrupted until Virtual switch is turned “OFF”
Virtual Switch “OFF” - Normal schedule runs

3) What is happening/not happening?
(PUT YOUR INFO HERE)

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

#6


#3

That was a good read, but unfortunately all I got was more confused. I am a complete noob at this. How do I define the rule that I want paused when the virtual switch is in the “ON” state? (It is a smartthings Lighting Automation:Turn on Pool Pump at 12:01 AM and off at 6:00 AM )


#4

In addition to the very excellent advice from @Mike1616 (lots of really good information there), here’s a piston I created for controlling my Porch Fountain, It includes a virtual switch - ‘Switch 18’, to control if it runs at all. ‘Switch 18’ ‘can, of course, be turned on and off manually at any time. Switch 8’ is the fountain - or in your case, the pump switch.

In addition to what you specifically asked for, this piston also includes checking for my wife’s and my presence sensors before allowing the fountain to run - as well as two other sections that automatically turn the ‘flag’ switch on and off based on predetermined spring and fall dates.

Take these additional functions out and modify it to fit your specific needs.


#5

Thanks so much for the “visual aid”! LOL!! I think this will help me a lot with figuring this out. I really like the way you added the spring and fall dates. I want the pump to run whether or not anyone is home unless the virtual switch is “ON”, except for when the temperature goes below freezing whereas I want the system to jump in and turn it on anyway until the temperature goes back up above freezing. Thanks so much for your guidance.


#6

So In theory, this will work?


#7

You’re welcome. Yes, it’ll work as written. However, without anything more than you’ve written so far, turning on the override switch is exactly the same as turning the pump on or off directly. I’m assuming that you planning more logic to add the schedule, etc.


#8

Yeah, you need the schedule (or what we call the “Trigger”) to initiate the piston you’ve created.

Also, there’s no reason to have the same thing in both the the THEN and the ELSE section of the piston.

So add the “IF” part of the logic there. So that WC knows to do what you want when something happens.


#9

heres a working example for a pool pump to be turned on and off daily at a certain time. but if the virtual override switch is turned on and the pool pump is on the pool pump is turned off. if the virtual override switch is turned off and time is between when the pool pump runs daily the pool pump is turned on.


#10

Thanks Guys!! This brings even more clarity as to how this code is written. I may be on my way to another insatiable hobby! Thanks again for your support! One other question though…Do I need to delete the automation in smartthings so this will control all of it? or do I keep the original automation?


#11

In general, I try not to have multiple smart apps doing the same thing (OK, more honest, I try NEVER To have more than one SmartApp doing the same thing). WC certainly has more functionality than Smart Lighting when it comes to the type and quantity of rules that you can create. So I’d get rid of the Automation in SL and just use WC.


#12

you are welcome. delete the rule in ST otherwise it will conflict with the piston. also remember to update pump start and stop time in the piston. :slight_smile:


#13

Awesome!! This forum rocks! Logic told me to delete the Smart lighting automation. I just needed clarity. Now to see if this puppy works! Thanks Again!!


#14

Worked flawlessly! Thanks again for the help guys!