Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WeeWX rain accumulation reporting differs from Netatmo rainfall reporting #12

Open
FranzStein opened this issue Sep 2, 2019 · 18 comments

Comments

@FranzStein
Copy link

I use WeeWX together with the WeeWX driver for Netatmo weather stations to control my OpenSprinkler garden watering system. Instead of sending the data to Wunderground the data is forwarded to the OpenSprinkler server process, which uses the same data format as Wunderground.

Additionally, I use Meteoware as the service to push the weather data to Wunderground. The Netatmo weather station and my.netatmo.com site is reporting correct rain accumulation data. Unfortunately, the rain totals reported by WeeWX differ from this and results in less rainfall data.

Below is an extract of the Meteoware data forwarded on August 18th to Wunderground:

Time   Temp.   Dewp. Hum. Wind dir Wind speed Wind gust	Bar. 1h Prec. 24h Prec.
01:32	17	14.6	86	216	0.3	0.6	1013.7	0.0000	0.0000
01:42	17	14.6	86	230	0.3	0.6	1013.5	0.1010	0.1000
01:52	16.9	14.5	86	232	0.3	0.6	1013.3	0.1010	0.1000
02:02	16.8	14.4	86	270	0.3	0.6	1013.1	0.1010	0.1000
02:12	16.7	14.5	87	270	0.3	0.6	1013.1	0.1010	0.1000
02:22	16.6	14.4	87	270	0.3	0.6	1013.1	0.1010	0.1000
02:32	16.5	14.3	87	206	0.3	1.1	1013.1	0.1010	0.1000
02:43	16.5	14.5	88	217	0.3	1.1	1012.9	0.0000	0.1000
…..

18:41	30.2	18	48	60	0.3	1.1	1009.1	0.0000	0.1000
19:08	27.5	18.2	57	225	1.7	3.3	1010.3	5.1510	5.3000
19:18	25.5	17.9	63	255	1.7	3.9	1010	5.2520	5.4000
19:28	24.2	17.9	68	246	1.4	3.9	1010.5	5.2520	5.4000
19:39	23.2	17.4	70	251	1.7	3.9	1010.4	5.2520	5.4000
19:49	22.4	17.1	72	283	1.7	3.9	1010.7	5.2520	5.4000
19:59	21.6	16.8	74	253	1.4	3.9	1010.6	4.9490	5.4000
20:09	21.2	16.6	75	240	1.4	3.1	1010.5	0.1010	5.4000
20:19	20.8	16.6	77	238	1.4	3.3	1010.6	0.0000	5.4000
20:29	20.6	16.8	79	236	1.1	3.1	1010.6	0.0000	5.4000

There was about 0.1 mm rain falling at 1:40 in the morning followed by a heavy rainfall of 5.3 mm between 18:58 and 20:29 the same day. The total rainfall sums up to 5.4 mm on this day, which can be also found in the Netatmo reports.

If this is compared with the WeeWX Syslog extract between 18:56 and 20:31 on August 18th it can be seen that less rainfall is summarized:

Aug 18 18:56:06 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.749","dewptf":"64.3","humidity":"048","dateutc":"2019-08-18 16:55:00","dailyrainin":"0.01","winddir":"060","tempf":"86.4","windspeedmph":"0.6","windgustmph":"2.5","rainin":"0.00"}
Aug 18 19:01:08 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.749","dewptf":"64.3","humidity":"048","dateutc":"2019-08-18 17:00:00","dailyrainin":"0.01","winddir":"060","tempf":"86.4","windspeedmph":"0.6","windgustmph":"2.5","rainin":"0.00"}
Aug 18 19:06:09 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.804","dewptf":"63.8","humidity":"050","dateutc":"2019-08-18 17:05:00","dailyrainin":"0.02","winddir":"225","tempf":"84.6","windspeedmph":"1.2","windgustmph":"5.6","rainin":"0.01"}
Aug 18 19:11:10 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.804","dewptf":"63.8","humidity":"050","dateutc":"2019-08-18 17:10:00","dailyrainin":"0.03","winddir":"225","tempf":"84.6","windspeedmph":"1.2","windgustmph":"5.6","rainin":"0.02"}
Aug 18 19:16:10 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.795","dewptf":"64.8","humidity":"057","dateutc":"2019-08-18 17:15:00","dailyrainin":"0.04","winddir":"225","tempf":"81.5","windspeedmph":"3.7","windgustmph":"7.5","rainin":"0.03"}
Aug 18 19:21:12 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.795","dewptf":"64.8","humidity":"057","dateutc":"2019-08-18 17:20:00","dailyrainin":"0.05","winddir":"225","tempf":"81.5","windspeedmph":"3.7","windgustmph":"7.5","rainin":"0.04"}
Aug 18 19:26:12 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.793","dewptf":"64.3","humidity":"063","dateutc":"2019-08-18 17:25:00","dailyrainin":"0.05","winddir":"255","tempf":"77.9","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.04"}
Aug 18 19:31:14 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.793","dewptf":"64.3","humidity":"063","dateutc":"2019-08-18 17:30:00","dailyrainin":"0.06","winddir":"255","tempf":"77.9","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.05"}
Aug 18 19:36:14 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.814","dewptf":"64.2","humidity":"068","dateutc":"2019-08-18 17:35:00","dailyrainin":"0.06","winddir":"246","tempf":"75.6","windspeedmph":"3.1","windgustmph":"8.7","rainin":"0.05"}
Aug 18 19:41:16 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.814","dewptf":"64.2","humidity":"068","dateutc":"2019-08-18 17:40:00","dailyrainin":"0.06","winddir":"246","tempf":"75.6","windspeedmph":"3.1","windgustmph":"8.7","rainin":"0.05"}
Aug 18 19:46:16 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.814","dewptf":"63.4","humidity":"070","dateutc":"2019-08-18 17:45:00","dailyrainin":"0.06","winddir":"251","tempf":"73.8","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.05"}
Aug 18 19:51:18 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.814","dewptf":"63.4","humidity":"070","dateutc":"2019-08-18 17:50:00","dailyrainin":"0.06","winddir":"251","tempf":"73.8","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.05"}
Aug 18 19:56:18 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.826","dewptf":"62.8","humidity":"072","dateutc":"2019-08-18 17:55:00","dailyrainin":"0.06","winddir":"283","tempf":"72.3","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.05"}
Aug 18 20:01:20 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.826","dewptf":"62.8","humidity":"072","dateutc":"2019-08-18 18:00:00","dailyrainin":"0.06","winddir":"283","tempf":"72.3","windspeedmph":"3.7","windgustmph":"8.7","rainin":"0.05"}
Aug 18 20:06:20 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.826","dewptf":"62.2","humidity":"074","dateutc":"2019-08-18 18:05:00","dailyrainin":"0.06","winddir":"253","tempf":"70.9","windspeedmph":"3.1","windgustmph":"8.7","rainin":"0.04"}
Aug 18 20:16:22 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.825","dewptf":"61.9","humidity":"075","dateutc":"2019-08-18 18:15:00","dailyrainin":"0.06","winddir":"240","tempf":"70.2","windspeedmph":"3.1","windgustmph":"6.8","rainin":"0.02"}
Aug 18 20:21:24 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.825","dewptf":"61.9","humidity":"075","dateutc":"2019-08-18 18:20:00","dailyrainin":"0.06","winddir":"240","tempf":"70.2","windspeedmph":"3.1","windgustmph":"6.8","rainin":"0.01"}
Aug 18 20:26:24 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.829","dewptf":"61.9","humidity":"077","dateutc":"2019-08-18 18:25:00","dailyrainin":"0.06","winddir":"238","tempf":"69.4","windspeedmph":"3.1","windgustmph":"7.5","rainin":"0.00"}
Aug 18 20:31:26 raspberrypi npm[31824]: OpenSprinkler Weather Observation: {"action":"updateraw","ID":"anyText","PASSWORD":"anyText","softwaretype":"weewx-3.9.1","baromin":"29.829","dewptf":"61.9","humidity":"077","dateutc":"2019-08-18 18:30:00","dailyrainin":"0.06","winddir":"238","tempf":"69.4","windspeedmph":"3.1","windgustmph":"7.5","rainin":"0.00"}

The daily rainfall in inch sums up to only 0.06 inch = 1.5 mm for this day, which seems to be not Ok!

I have seen this error mostly if there is a heavy rainfall in a short period of time. Any idea what goes wrong or need to be changed! A correct total rainfall reporting is very important for me, as this data will be used for calculating the time the sprinkler will be running.

@emontolivo
Copy link

Hi Franz,
Your comment is more than on year old so I do not know if you are still monitoring the forum. Anyway, as a new Netatmo weather station owner, I am observing in these days the same issue you reported months ago. After digging in the problem I think I understood its origin.

Weewx-netatmo driver collects the data from the Netatmo server by using the getstationsdata method provided by the Netatmo API. The behaviour of this method is weird. Indeed, as you said, summing up over one day the rain data reported by the /getstationsdata for each observation period you do not have the same amount of rain given directly by the station for the day (that, by the way is wrong as well but to a minor extent), usually you have a much lower value . The reason for this is that he station sends the rain data to the server every 10 minutes. Each data packet includes the report for 2 five minute observation periods but he /getstationdata method reports the rain for just one of these periods the other is simply dropped. You can see evidence of this in the picture below where I compare the data of my station downloaded from the netatmo.com website as an xls file (that are correct) with those reported by the /getstationsdata (on the right) where each second five minutes data are missed. As you noticed, the error is greater during heavy rain. Indeed, there is no error in some cases, e.g. when during the missed observation period we have no rain at all.

image

In conclusion, using weewx with our Netatmo weather station is currently impossible.

I also understood how to fix the probelm but this would require to deeply modify Matthew Wall's driver and, unfortunately, my software developping skills are not strong enough for this.

Regards
Emilio

@jkrasinger
Copy link

Take a look at my answer in issue #18 and feel free to test it out.

Regards Jonny

@emontolivo
Copy link

emontolivo commented Mar 15, 2021 via email

@jkrasinger
Copy link

Hi Emilio,
very nice that you will try my code and keep me informed.

I'm really interested in your tests.

I have only tested with weewx 3.9.2 (with python 2), but created the code and made native tests under Python 3. The code "should" work in all weewx Versions.

You must use the new Configurations Parameters gm_device_id and gm_node_id in the netatmo section of weewx.conf on the same level as username and password.

The cloud mode requires credentials:

username      = [email protected]                                                                           
password      = password                                                                                    
client_id     =   <client id>                                                                      
client_secret = <client secret>                                                               
gm_device_id  = xx:xx:xx:xx:xx:xx       <- MAC of Base-station
gm_node_id    = yy:yy:yy:yy:yy:yy        <- MAC of rain Module

Best regards
Jonny

@emontolivo
Copy link

emontolivo commented Mar 15, 2021 via email

@FranzStein
Copy link
Author

Jonny. Thanks a lot,

I need some time to set this up. I haven’t worked on it for more than a year. I'll let you know the results asap. I hope it's OK to test it with WeeWX version 3.9.2.

Best regards
Franz

@jkrasinger
Copy link

jkrasinger commented Mar 15, 2021 via email

@FranzStein
Copy link
Author

Hi Jonny,

I updated the driver by following your installation instruction, which means download and install the driver -> stopping weewx -> modifying the weewx.conf file:

Looking at the Netatmo configurations I found for the main module:
Modell: Innenmodul
MAC-Adresse: 70:ee:50:27:6c:9c
Firmware: 178

and for the rain sensor:
Modell: Regenmesser
Seriennummer: k032940
Firmware: 12

I added gm_device_id = 70:ee:50:27:6c:9c and gm_node_id = 70:ee:50:03:29:40 to the weewx.conf file. I chnaged nothing else.

After starting weewx again, the following errors are reported:

pi@raspberrypi:~ $ sudo /etc/init.d/weewx stop
[ ok ] Stopping weewx (via systemctl): weewx.service.
pi@raspberrypi:~ $ sudo nano /etc/weewx/weewx.conf
pi@raspberrypi:~ $ sudo /etc/init.d/weewx start
[ ok ] Starting weewx (via systemctl): weewx.service.
pi@raspberrypi:~ $ sudo tail -f /var/log/syslog
Mar 16 17:53:01 raspberrypi weewx[25747]: restx: WOW: Posting not enabled.
Mar 16 17:53:01 raspberrypi weewx[25747]: restx: AWEKAS: Posting not enabled.
Mar 16 17:53:01 raspberrypi weewx[25747]: engine: Starting up weewx version 3.9.2
Mar 16 17:53:01 raspberrypi weewx[25747]: engine: Starting main packet loop.
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: exception in netatmo-client: list index out of range
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: exception in netatmo-client: list index out of range
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: exception in netatmo-client: list index out of range
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: exception in netatmo-client: list index out of range
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: exception in netatmo-client: list index out of range
Mar 16 17:53:02 raspberrypi weewx[25747]: netatmo: netatmo-client: failed to get data after 5 attempts

Not sure what's going wrong. Is there a need do delete the old driver first? I'm little bit out of this topic. It would be nice if you can help me out of this issue.

Thanks and regards

Franz

@jkrasinger
Copy link

jkrasinger commented Mar 17, 2021 via email

@FranzStein
Copy link
Author

Hi Jonny,

Thanks a lot. I have found the correct rain sensor MAC address (05:00:00:03:29:40) and WEEWX reporting is now working. I will monitor the rain data and let you know if there are still any issues. It's still cold here in Germany and more rainy days are forecasted. There is a good chance that I can report results soon.

Regards

Franz

@jkrasinger
Copy link

jkrasinger commented Mar 17, 2021 via email

@FranzStein
Copy link
Author

Hello Jonny,
Not sure if this belongs to the Netatmo driver itself. The WeeWX STD report always shows the Battery Status as LOW.

Battery Status
Wind Battery | LOW
Rain Battery | LOW
Outside Temperature Battery | LOW

From the debug information it can be seen that the percent values are reported correctly. No hurry, but maybe you have a chance to look at this also.

Thanks and regards

Franz

@jkrasinger
Copy link

Hi Franz,
i know, that's the same problem as for me, but it's not the netatmo driver, it's weewx code itself. I ignore this because i'm also working with my Home-Automation (Home Assistant) and there i'm checking the battery states my own way.

Sorry for this, in the moment i will not check for the reason of the wrong battery state ...

BTW: Within the next hour i will release the new code for the netatmo driver which includes the automatic detection of the rain Module, so there is no more need to specify the two additional parameters. They can be left in the configuration file and will be ignored (or you can remove them).

Regards Jonny

@jkrasinger
Copy link

Hi Franz,
my new weewx-netatmo driver is released.

The problem with the LOW Battery Status is easy to fix, you must change one line in the skins. If you use the "Seasons" skin, then you must change the File "skins/Seasons/sensors.inc" on line 11:

Change "#if $x == 0" to (for example) "#if $x > 50",

then you will see OK if the Battery percentage is greater then 50.

Regards Jonny

@FranzStein
Copy link
Author

Hi Jonny,
thanks a lot. I have updated my WeeWX installation to your new driver version. No issues found. The battery status is also showing the correct information now.

Rain was predicted. However, it's not raining till now at my home location. I will let you know about any results from the rain tests ASAP.

Regards

Franz

@jkrasinger
Copy link

jkrasinger commented Mar 18, 2021 via email

@FranzStein
Copy link
Author

Hi Jonny,

Everything is fine. First results are available now. We have had some snow in the early morning, which was melting away during the day. The rain summaries given on the different web interfaces this evening are as follows:

We have a perfect match for all three rain summaries.

Please note that I'm not using WeeWX to send my weather data to Weather Underground. I'm occupied this interface to send the weather data to my OpenSprinkler weather service. Weather Underground is connected with my Netatmo weather station via the Meteoware Plus service.

Regards
Franz

@jkrasinger
Copy link

jkrasinger commented Mar 20, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants