Misting System Cycle Timer


#1

1) Give a description of the problem
Need help creating a Short cycle (10-30 second) On/Off cycle timer for a misting system

2) What is the expected behaviour?
Turn Patio Mister On. Stays On for xx seconds then turns Off for xx seconds, then back On for xx seconds. Stays in loop until Patio Mister is Turned Off.

3) What is happening/not happening?
Get a warning about short timing and resources. Suggests using a “Loop” instead. I don’t know how to create a Loop

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

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

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


#2

I think we need a little more information.
How are you turning the patio mister on and off? Timer? Switch?


#3

Hello

Thanks for helping. I currently am using Google Assistant to turn on and off an Innovelli relay outlet module. All is working but it puts out too much Mist if on constantly.

Steve


#4

I do not have Google Assistant, but I presume it works similar to Alexa. There are SEVERAL ways to do this. Others may have suggestions. My suggestion assumes that you know how to make virtual switches and how to control them with Google Assistant.
First, make a virtual switch Google_Mister_Switch. I presume those switches can be seen and controlled by webcore.

IF Google_Mister_Switch turns on
Then
While Google_Mister_Switch is on
        Turn on Mister
    	Wait 30 seconds
    	Turn off Mister
    	Wait 30 seconds
End While
End IF

Set the TCP (Task Cancellation Policy) to NEVER CANCEL.
Now you can say “Google, turn on the mister” and your mister will run, turning on and off every 30 seconds or so until you turn it off. Then say “Google, turn off the mister” and it will turn off.


#5

Wow Pantheon

Thank you very much!

I’ll put it in tomorrow and let you know how it goes.

Much simpler than what I was trying!

Steve


#6

Hi Pantheon

Following is a snapshot of the piston I tried to write. As a very new user with little actual coding experience aside from Fortran and Cobol 45 years ago I find WebCoRE a bit confusing. I couldn’t figure out the “End While” command or the “End If”.

The piston turns on the Virtual Device “Patio Mister” which then turns on the actual Device “Misting Pump” from a Google Command. The pump runs 15 seconds, then turns Off. It does not turn back on.

I have disabled the TCP in the piston, still no joy.

Any ideas?

Thanks again for the help.
Steve


#7

Hi,
Have you switched on the “show advanced statements” option? While editing your piston, click the options drop down at the top right of the screen and select it.

You should be able to add a while loop into your code.

Its very different to cobol!


#8

Thanks Paul

I’ll give it a shot. Didn’t think of Advanced options in a simple program.

Steve


#9

If your virtual switch is set up correctly, then you can remove the physically. Also, remove the if/end if as noted.

You will need a WHILE statement after the THEN:
Click the drop down for OPTIONS in the top right of your screen and click SHOW ADVANCED STATEMENTS. Then you can add a WHILE.

Then add code like my example above.


#10

Thanks Pantheon

You guys are great, but I’m running very slow.

Trying to add a “While Loop” broke the whole thing. I have the Google Assist working perfectly on my Virtual “Patio Mister” device. That then turns on the physical device “Misting Pump”. All good until the loop kicks in.

I’ll do a little more research into how WebCoRE really works before I bug you guys more. Thanks for everything.

I’ll be back.
Steve


#11

Not a bother at all. Just post your piston so we can help you debug. That’s why we are here.


#12

For what it’s worth, I think webCoRE offers (by far) the most advanced programming logic available for SmartHomes. If there is something better, I have yet to discover it!


#13

Hi Guys

Here is my latest attempt. I do not know if my “While Loop” is correct and for some reason I lost the ability to disable TCP. I cannot find the option anymore???

Questions:

How do I disable TCP again so the loop runs continuously until the Virtual Switch “Patio Mister” is turned “Off”?

How do I “End” the routine? Does the “While Loop” automatically kick out of the loop when the condition is not met? (Patio Mister is now “Off”)

Sorry to be so obtuse. For some reason this is not that intuitive to me.

Thx
Steve


#14

Sorry

Wrong image. This is the latest.


#15

Hello

I found the TCP and set it to Never. Didn’t realize you had to be on an “End” statement for the “Properties” tab to show up.

Still learning…;


#16

This version does the following:

Use Google to turn on virtual device “Patio Mister”. Patio Mister turns on, Misting Pump turns on.

Then the piston stops with both devices showing on in Smartthings.

I have done something wrong in the "While Loop) Help

Thx
Steve


#17

Hi Steve,

You need to move the “with misting pump” inside the while loop, after the do. If you drag the with line, to after the do, all the relevant code from the “with” should go in to the right place.

I think it should work then. There’s no need to set TCP.


#18

Thanks Paul

Here is what I did:

Virtual Switch "Patio Mister " turns On, Actual Device “Misting Pump” turns on. Misting Pump turns off after 20 seconds.

Then everything stops with Patio Mister in the On State and Misting Pump in the Off state.

Acts like it freezes.

Thanks
Steve

PS I donated $30 for all the help. You guys are great.


#19

Make these changes and you should be good to go. I use TCP because I frequently have problems when I use WAIT statements. I think, without TCP set to NEVER…If you where to say “Google, turn off the mister” while the piston is in the 20 seconds WAIT that your have after it is turned on, then the condition of the Trigger (Patio Mister’s switch changes to on) will be a change of state. The piston will stop where it is and begin execution from the beginning again. And it will not make it into the While loop and the Misting Pump will not be turned off.


#20

Hi Pantheon

You are right,

Leaving the TCP on creates some odd behavior…

But… The following with TCP at Never, when Virtual Switch Patio Mister is turned On, Misting pump turns On for 20 seconds, turns Off for 20 seconds, Turns On forever. Ouch - So close!

Now what did I screw up?

Thx
Steve