How was the weather yesterday

weather
temperature
piston

#1

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?


#2

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”?


#3

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

At midnight, set @rainYesterday = @rainToday

… and then make your queries to @rainYesterday


#4

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.


#5

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


#6

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


#7

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?


#8

My apologies, I do not understand your question.


#9

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:

define
   boolean rainYesterday
end define

every day at 11:55 PM
   if $twcweather.conditions.precip24Hour > 0
   then
      set rainYesterday=true
   else
      set rainYesterday=false
   endif
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.


#10

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?


#11

It is a decimal. Here is an example output:

4.52

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


#12

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.


#13

Ok, thanks!


#14

Hi,

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.

Thanks
32


#15

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?