How was the weather yesterday



Hello people,

I need to get information about yesterday’s weather. Is there any way to collect or save this information from yesterday?

I need to know if it rained yesterday, if it did, I don’t turn on the irrigation system.

Does anyone have any idea how to collect this information or save?


I don’t think $twcweather offers past or current rainfall amounts.
I believe it only shows the forecast. (shown at the same link)

IE: $twcweather.forecast.qpf

Would you be happy with future forecasts being saved as previous “facts”?


I guess, if we were thinking outside the box, you could make a query to:
every 30 minutes… and if it contained “rain”, then set @rainToday = true

At midnight, set @rainYesterday = @rainToday

… and then make your queries to @rainYesterday


There is $twcweather.conditions.precip24Hour which I presume would be the amount of precipitation in the last 24 hours since it is conditions and not forecast. Unfortunately, there is not much description of the contents, just a listing of what is available.


Good eye, @guxdude… I don’t know how I missed that.


The Accuweather Device in ST also offers precip1hr, precip2hr and precip3hr that might be used in the same way as described above.


Hi @WCmore,

But each running, the variables are replaced values.
In this case, I not declared a variable. The variable that will create if it is rain?


My apologies, I do not understand your question.


I also am not sure what you are asking but perhaps you are looking for how to use this data? I would suggest defining a boolean and the setting it true if there was rain Something like this:

   boolean rainYesterday
end define

every day at 11:55 PM
   if $twcweather.conditions.precip24Hour > 0
      set rainYesterday=true
      set rainYesterday=false
end every

If needed in another piston, you could make this a stand alone piston and define @rainYesterday as global rather than the local variable above.


OK thank you.

I will do the tests here and then let you know how it turned out.

What would be the value of $ twcweather.conditions.precip24Hour greater than 0?
What are the values in precip24Hour and their respective meanings?


It is a decimal. Here is an example output:


(that is the largest I have ever seen that number)


Any value other than 0 would mean it rained in the last 24 hours. You could run your piston at any time depending on what 24 hours you want to base your other logic on.


Ok, thanks!



My code is working after your help. Today is raining and not started my irrigation system.

@WCmore I think than precip is amount of in mm rained because my precip24h is it 11.18.



Thank you for this observation.
If it is like the other TWC dataPoints, it likely depends on your country.

For example, $twcweather.conditions.temperature displays Fahrenheit for me, but I bet it displays Celcius for you, right?