rszimm / sprinklers_pi

Sprinkling System Control Program for the Raspberry Pi
GNU General Public License v2.0
310 stars 100 forks source link

Netatmo weather adjust #143

Open fabm78 opened 5 years ago

fabm78 commented 5 years ago

Hello, I found DarkSky data not very good (it tells it's been raining in my garden when it definitely did not!), so I'd like to use my Netatmo weather station instead. Could someone add Netatmo to Sprinklers-PI as a weather data provider?

thanks a lot

nhorvath commented 5 years ago

I looked at their API just now and I do not see any ability to get historical (yesterdays) data. Without this information it's unlikely we can use it.

fabm78 commented 5 years ago

thanks for looking. Reading at their API description, I understand API calls return the day's min and max temp, the current humidity and the humidity & pressure trend, which helps evaluating possible upcoming rain. Plus if you have a rain gauge, you have the cumulated rain for the last hour and the last 24h. But you can also get this info using public data from your neighbors' rain gauge.

https://dev.netatmo.com/resources/technical/reference/weather/getstationsdata

My GreenIQ was using Netatmo for weather adjustment, and I have to say is was very very efficient (before they closed, that is!)

fabm78 commented 5 years ago

I believe that if you need yesterday's data, you would have to ask everyday and save the results locally. So you can have past data available...

rszimm commented 5 years ago

So I'm going to chime in here a bit as I did a lot of research back when I first put the weather adjustments into the system. The weather calculations are better separated into a separate process (or a separate thread, or pseudo thread in our event driven sprinklers_pi model). There's something called the Penman-Monteith equation which specifically derives evaportranspiration with daily mean temp, wind speed, humidity and solar radiation. Solar radiation is unlikely from a local weather station, but if you can generalize to a geographic area (which you generally can), there are sources for that (although I'll admit I don't particularly remember where I found them). So to derive the daily means you would likely have to have a process wake up every 10 minutes or so, read the data from the station, compute the means, store them somewhere (in a file that the sprinklers_pi system could read for example), and go back to sleep. Likely best as a rolling 24 hour average. The same process would likely get information on past and current rain and store it in the same file. Then the sprinklers_pi weather plugin would just read from the local file. Again, architecture wise this could be a separate process or part of the pluggable weather handler (you would have to add a 10 minute event handler that polls the weather source).

Hope this helps. Wish I had more time to help with all this stuff, but things are looking fantastic...

On Sat, May 18, 2019 at 7:27 AM fabm78 notifications@github.com wrote:

I believe that if you need yesterday's data, you would have to ask everyday and save the results locally. So you can have past data available...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rszimm/sprinklers_pi/issues/143?email_source=notifications&email_token=ABGVAYFIT2UID6ED2R6DIETPWAG4FA5CNFSM4HNYWUF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWPTRA#issuecomment-493681092, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGVAYFCQKBQKZQGYZ3YL5LPWAG4FANCNFSM4HNYWUFQ .

poiuztr123 commented 5 years ago

Not related to the Netatmo topic, but it would be great to have a true evaportranspiration model as described by rszimm that calculates the water demand based on such a scientific model (I assume that it is scientific...).

I found a lot of details and even calculation examples on how to implement it on: http://www.fao.org/3/X0490E/x0490e00.htm#Contents

Looks like some detailed agriculture knowledge (water demand and model factors depending on different crops etc) and coding experience is required here to do it right. I don't have any of the two, but wanted to pass the link along in case somebody would like to dive into it in order to implement it in sprinklers_pi.