I have a piston to turn my pool pump on and off. Its connected to a solar heater on the roof. Is there any way to only turn the pump on between say 10am and 5pm but only if its above a certain temp using local weather somehow or another option would be to turn the pump on during the day only if its not cloudy
Thanks
Rick
Piston related to weather
I have found some info from WCmore so I added if over 70 but one of the conditions he mentions is Partly Cloudy I cant figure how to add that.
This is what I have
Where you have $weather rises above 70, I think youâll need $weather.conditions.current_observation.temp_f
The weather string you are talking about for âPartly Cloudyâ is found at $weather.conditions.current_observation.weather but it can have many values so youâll need to identify all the strings you want to match or not match. A full list is available here: https://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases
Itâs not clear what you are trying to do, you mention Partly Cloudy but whatâs the overall plan? If you can edit the first post to match the format given when you create a new thread it would be much clearer.
For your project, you might want something like this:
Set variable wuCurrent = $weather.conditions.current_observation.weather
Set variable cloudy = (contains(wuCurrent,'Cloud') ? 'true' : 'false')
IF cloudy is true and time is between 10AM and 5PM, then turn on Pool
The trick though is those weather variables do not populate automatically. The method that I usually use is to have my âweather pistonâ gather the data every 20 or 30 minutes, and store the important data into global variables. I can then use those globals in queries from many other pistons. (in other words, one piston to focus on weather data gathering, and one piston to monitor the pool pump USING the weather data already gathered.) This method keeps things grouped together nicely for editing, but more importantly, it keeps duplicate commands from being run needlessly. (since there are MANY pistons that can benefit from having access to weather conditions)
Although, you COULD combine them into one piston, by doing something like this:
If you import the code âpfa3tâ, youâll want to replace my bulb with your Pool Pump.
(Also note, it will take 20 minutes after you save the piston for it to start working)
Why would you want the pool pump on when its cloudy? I think @trickyrick only wants it on in clear sunlight, but I canât be sure as the original post isnât detailed enough.
Yes, âif cloudy is true
â can be changed to âif cloudy is false
â if I misunderstood the original post.
Thanks guys
Yes I edited original post
on if not cloudy
Made the change to false
I will see what happens tomorrow and report back
Rick
P.S. WCmore what is the line (hour24) is inside of range 10 and 16
It means that section of the piston will only run between 10am and 4:59pmâŚ
(think of the first two digits in military time)
Thanks for the piston the pool pump came on today. Ill have to wait for a cloudy day to see what happens
Glad to help. One thing that might be worth adding to your code at some point is:
When it is overcast, or raining, or snowing etc, the current weather will NOT say Cloudy, so the pool pump will still come on⌠(It is currently coded to look for Partly Cloudy, Cloudy & Mostly Cloudy)
If you look at the API link I posted you can see the full list of values that variable can return. Itâs probably easier to code for when you want the pump on, then when it shouldnât come on.
Follow up
This is really the first day its being overcast (is this the same as cloudy) and it is also raining and its also 65 degrees out. The pump still came on
Is there any way to read the weather conditions that its drawing from
OK thanks but in the piston as one of the conditions it temp is greater then 70
This morning when the pool pump came on it was only 65
If you only want the pump to come on if it is clear, instead of trying to match every possibility of bad weather, why not simplify it by only matching when it is Clear outside. Like this:
Change line 30 to:
Set variable {cloudy} = (contains(wuCurrent,'Clear') ? 'false' : 'true')
The following IF only needs to say:
IF {temp} is greater than 70
AND
{cloudy} is false
THEN
Turn on Pump
This way, the pump will only come on if it is CLEAR and over 70 degreesâŚ
If it is raining, Cloudy, snowing, overcast etc, the pump will not come on.
(delete lines 36-50)
Thanks WCmore
I will make those changes but with the existing piston I donât understand why the pump came on as I stated the temp this morning was only 65 degrees. Is there any way to see the weather forecast from where ever the piston gets it info