Rain gauge for WU

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Rain gauge for WU

#1 Post by mr-varga » 18 Apr 2018, 19:35

Dear all, I'am back here with another challenge to win, obviously with your help.
I have 3d printed a simple rain gauge, who is connected to one ESP8266 with ESP Easy Mega.
This simply cont every time the rain gauge shift the position. (for now i simply count the shift at the end i transform this in mm/m2 of rain)
This is my situation:
rg.PNG
rg.PNG (43.34 KiB) Viewed 4566 times
For send this data to wu (weather underground) every 5 minutes i need:
rg60min - [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min
Total - [rain inches so far today in local time]
- Total, thi is not a problem I think the Total value in Generic - Pulse counter RGC do this hob)
- rg60min, this is the problem, I use the formula (see below) but this is not correct in my opinion, in my formula i reset the counter every hour, i need a costant value of rainfall in the past 60 min.

Code: Select all

Rule 1
on Clock#Time=All,00:00
   TaskValueSet 1,1,0
   TaskValueSet 1,2,0
   TaskValueSet 2,1,0
   TaskValueSet 2,2,0
endon
on Clock#Time=All,**:00 do
   TaskValueSet 2,1,0
endon
on RGC#Count do
   TaskValueSet 2,1,[RG#prec]+[RGC#Count]
   TaskValueSet 2,2,0
   TaskValueSet 2,2,[RG#rg60min]
   Publish %sysname%/RG/Count,[RG#rg60min]
   Publish %sysname%/RG/Total,[RGC#Total]
endon
Haw I can obtain this value with the rules? Any Idea? :?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Rain gauge for WU

#2 Post by Drum » 18 Apr 2018, 20:09

I do not know if this is possible in the rules, but I was able to do this in node red fairly easily. I was not trying to upload to WU, just to a local sqlite database.

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Rain gauge for WU

#3 Post by mr-varga » 18 Apr 2018, 20:17

Drum wrote: 18 Apr 2018, 20:09 I do not know if this is possible in the rules, but I was able to do this in node red fairly easily. I was not trying to upload to WU, just to a local sqlite database.
Dear Drum,
unfortunately i don't use node red (i think i have to learn more about it), to client side I have the raspberry with mosquitto for mqtt and Home Assistant for home automation.
I think i can collect this data over mqtt in raspberry with one python script elaborate it and send all to wu, but for now I'am not able to do this...
For this reason I try to do this all in ESP, also in this way the weather station is standalone and it's able to send data also without raspberry...

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Rain gauge for WU

#4 Post by Drum » 19 Apr 2018, 14:30

From my understanding you need to send the following EVERY 5 MINUTES
1. Rainfall over the last 60 minutes.
2. Accumulated rainfall since 00:00

Not sure this is possible in ESPEasy. The second should not be too much of a problem, I think, but I have never tried.
The first is a problem because without a database of rainfall totals every 5 minutes for the last hour, I don't see how to do it. It looks like you need 12 variables and overwrite the oldest one every 5 minutes then sum them and sent the total, but then the plugin must total the rain fall every 5 minutes and add to a variable for the daily accumulation and reset at 00:00.

It may be possible but I think it would take more than just rules, and with the constant changing of variables, I don't know if that would affect the life of the ESP. Too many memory writes is a bad thing from my understanding.

Take a look at uPyEasy, it is in micro python and while it is not stable yet, it make make the process of doing this all on a ESP possible, without having to do as much programming.

I don't see a quick or easy way to do what you want, and personally I think it would be far easier to let the pi gather all the data and send it at once.

mr-varga
Normal user
Posts: 22
Joined: 29 Jan 2018, 18:41

Re: Rain gauge for WU

#5 Post by mr-varga » 19 Apr 2018, 16:11

Dear Drum,

Thank you for your answer.
I think i have find the solution for the 60min rainfall, but tonight i have to make some test if it's possible to do this. I try to create 3 dummy device each with 4 variables. Than i make role who switch the variabes (the value of the 12 in 11, the 11 in 10, 10 in 9 ecc...) and at the end store the last value in the last variable... At the and i make a addition of this i have my value. I think can works.
For the total there is no problem, i have the total in counter device. I just put it to 0 at 0:00.

This is a sort of empiric solution, i think i have to study some better and professional dolution. I will study node red or python in this way i receive all data in py i store it elaborate this an after i send all this to wu.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests