Turn off Fountain when windy


I have a switch on a fountain but when its windy the water blows all over so I would like to shut it off if its windy.
I have only a couple basic pistons
I found this one in the forum but not sure how to define the integer when I used the backup code it wanted a temp sensor.


You can either use a device that has a wind sensor, or try to use the built-in TWC Weather codes:

It is important to mention that if you use the built-in codes, they can NOT be a trigger.
(IE: For the piston to see the wind speed, you will have to program some kind of logic to determine when the piston should run)


Thank you WCmore
Is this moving in the right direction


The dollar signs “$” and periods (in my last post) are required, as seen in that link…

Also, your piston will currently only run at the moment Switch 12 changes.
(as seen by the lightning bolts in the left margin)

Perhaps a better way is to base your trigger on Time, like this:

Every 15 minutes
    IF $twcweather.conditions.windSpeed is greater than 5
       $twcweather.conditions.windGust is greater than 5
       Turn off Switch 12
    END IF


A real wind sensor will detect wind speed changes nearly every second, but the TWC wind speed appears to be the “average” for that zip code… (meaning it may only change once or twice an hour, and any location within that zone can easily have more or less wind)


Thanks maybe in the future Ill get a wind sensor
Do you not have to difine a variable for the windspeed and windgust first
I have this but it does not look right


I think I got it


I am not sure if “Refresh” does what you want it to, but ignoring that for a moment, here is a slight modification on your last piston. This one will prevent spam to the weather server unless the fountain is actually turned on.


Well, that’s 2 of us. I don’t know what the refresh does either :smile:
I removed and added a time for the fountain to come on and off


It is your house, but I would highly encourage you to add a spam-block.

For example, your fountain is only on for < 4 hours a day, yet your current code pulls wind data all day every day. (144 times a day) For comparison, with my small tweak below, it only pulls data at the relevant times. (23 times a day, or 626% more efficient)

Essentially, it prevents useless queries unless the fountain is actually on.
(this is courteous, since SmartThings is billed for each TWC query you make)

If we abuse TWC, then I suspect SmartThings will start charging us for that data.

I took a few minutes to create this for you.

Note: Even if you manually turn on the fountain, the wind will still be checked properly.


I see the change you made. I didnt know that about charging for data each time I check for weather
Thanks for taking the time


Thankfully, SmartThings has not started charging us for this data yet…
(and hopefully, if we don’t abuse it, they never will)


So how is the latest piston working for you?


I think Ill have to get a device to monitor wind. We live on the lake so can be windy but not so in the rest of the town. When ever I pole the wind speed in the piston its always a 4. Dont know y that is
Thanks for your piston


The TWC wind data is horribly inaccurate… It is almost like an average of the previous 10 dataPoints. (IE: in real life, the wind changes every second or so… In TWC, you are lucky to get a 1 mph change in an hour)

Having a local device to capture the wind at your location is always preferred.

Pro Tip:

Keep in mind that some weather devices are compatible with WUnderground, so if you go that route, they should give you an API key to be able to pull your local data via all online methods.


Your Pro tip. If I purchase a weather device that gives me the data I want what would be the advantage in being able to connect to WUunderground. As you said its inaccurate.


I have always loved WUnderground… I don’t think I ever said they were inaccurate.
(It is the new TWC weather that I am not really impressed with)

If WUnderground is compatible with your weather sensor, then (if things are still the same) you are entitled to all of that data available online. (API calls, pistons, fuel streams, SmartThings etc) The last time I checked, they also allowed access to all past data (historical) as well as future forecasts.

I think the concept is, by you agreeing to share your weather data with them, they agree to share their algorithmic observations with you.

There may still be a daily limit on queries though (often in the thousands), so it’s worth reading the small print before doing any real coding with that data. (Their API structure went thru some major changes a few months back)