I’ve completely wrecked my piston... please help


#1

1) Give a description of the problem
I have to be honest, I need to restructure this entire piston.

2) What is the expected behavior?
I have a z-wave pool pump and heater which can also control my spa. Using the ST Device IDE takes 3-5 steps to turn on the pool heater or hot tub which does not meet my approval or the wife approval.
What I would like to happen is to hit a switch (virtual) to turn on the pool heater and set it to a temperature and hit a switch (virtual) to turn on the spa.
The challenge is two-fold… I cannot have both virtual switches on simultaneously AND I have to turn off the pool pump to switch to SPA mode as to not damage the pool pump.

3) What is happening/not happening?

Simply put, I overbuilt this piston with too many functions and need advice on organize the piston to better automate the pool. RIght now turning on the pool heater or spa does nothing.

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

**5) Attach any logs (From [ST IDE](https://graph-na02-
Honestly, i crafted this on an iPad making it difficult to copy/paste so I apologize.

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


#2

i am afraid to import the piston. :smile:

why not do something like this, where virtual switch 1 = pool mode and virtual switch 2 = spa mode:

if virtual switch 1 changes to on
   turn off pool pump
   switch to pool mode
   turn on pool pump
   turn off virtual switch 2
end if
if virtual switch 2 changes to on
   turn off pool pump
   switch to spa mode
   turn on pool pump
   turn off virtual switch 1
end if

#3

The problem is that when I need a method to turn off VS1 or VS2 which will turn off the pump and reduce the pool temperature.

So, in your example, turning on VS1 also turns off VS2. I need to instruct the piston that if I were to turn off VS2 turn off the pump which is precisely what needs to occur when I turn on VS1.


#4

so if both switches are off, turn off the pump wouldn’t work?


#5

If both switches are off the pump should also be off. The challenge is in the pure logic (which is why you see a conflict variable).

If turning on the spa requires the piston to turn off the pool heater, that would trigger an action associated with the condition of turning off the pool heater which turns off the pump which must be on in order to run the spa. (eyes are now crossed again)


#6

hmm … missing something here. none of the actions in the snippet i suggested takes action based on the pool heater turning off. it relies on the state of virtual switches changing to take the appropriate action.


#7

I solved my own problem with some inspiration from the group. I am posting the piston below, but essentially re-worked the logic so that the turning off of 1 VS when the other switch was already off triggered a turning off of both switches.

I don’t know who will use the piston, but the logic concept may help some users with ‘colliding’ device events.