Page 1 of 4

Python Plugin: PWS (Personal Weather Station)

Posted: Sunday 25 August 2019 15:40
by Xorfor
I have written a Python plugin, to capture data directly from my weather station. So no need to upload the data first to WeatherUnderground, Ecowitt, WeatherCloud, WOW, etc.
The README describes the use of WS View to connect your weather station to your router and upload data to Domoticz.

https://github.com/Xorfor/Domoticz-PWS-Plugin

In general, if the station is supplied with 'EasyWeather' software, it is likely that the station will work with this Domoticz plugin!

Please tell me your experience, which weather station you are using, which tool (WS Tool, WS View) you used, etc.

Re: Python Plugin: Personal Weather Station (PWS)

Posted: Friday 30 August 2019 19:22
by Xorfor
Final version is available, with some extra devices.

Re: Python Plugin: Personal Weather Station (PWS)

Posted: Wednesday 04 September 2019 22:32
by Xorfor
Added some improvements for the Rain sensor.

Re: Python Plugin: Personal Weather Station (PWS)

Posted: Saturday 07 September 2019 22:35
by Xorfor
Added extra device for wind direction.
Extra documentation to link your PWS to Domoticz.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 16 September 2019 23:42
by Xorfor
Some code cleanup (Black formatting) and more documentation https://github.com/Xorfor/Domoticz-PWS- ... /README.md

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Tuesday 01 October 2019 19:48
by Xorfor
I removed the extra checks on WeatherUnground and Ecowitt protocols. And added extra documentation about EasyWeatherV1.4.5 which is available now for weatherstations.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Thursday 17 October 2019 21:35
by Xorfor
New version available and also tested on the latest EasyWeather version.

Fixed: Sometimes the total precipitation from a day was added to the next day, because of different times settings on the PWS and Domoticz server.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Sunday 20 October 2019 22:47
by andreo
I'm using a Alecto WS-5500 weather station and WSView software to setup the device and its work very well, today i updated to the latest release because i encountered the rain gauge issue. A few minutes ago at 00:00h the rain value of the previous day is still copied to the next day :?: I will see tomorrow if the problem still exists.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 21 October 2019 18:41
by Xorfor
I have seen the same problem. Also with my latest fix. It is difficult to debug this. Now I am not sure if it is a bug in my plugin or in Domoticz.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 21 October 2019 19:33
by brommetje
Using Alecto WS-5500 software version 1.4.4 working great, selected for now Ecowitt protocol.
Thanks Xorfor all the work.
Do you know what the difference is between Ecowitt and Weather Underground protocol only the "Dew point"?

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 21 October 2019 19:59
by Xorfor
Do you know what the difference is between Ecowitt and Weather Underground protocol only the "Dew point"?
Also WindChill is not reported in the Ecowitt protocol

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Tuesday 22 October 2019 0:23
by andreo
andreo wrote:I'm using a Alecto WS-5500 weather station and WSView software to setup the device and its work very well, today i updated to the latest release because i encountered the rain gauge issue. A few minutes ago at 00:00h the rain value of the previous day is still copied to the next day :?: I will see tomorrow if the problem still exists.
The issue still exists. 1 minute after midnight the total rainfall of the previous day is visibleImage

Verstuurd vanaf mijn MHA-L29 met Tapatalk


Re: Python Plugin: PWS (Personal Weather Station)

Posted: Tuesday 22 October 2019 21:29
by Xorfor
I didn't have this problem this time. In my log I saw that the correct data was send and the sensor showed this data.

I am running an other test, and it seems that updating the Rain sensor does not work as expected! At this moment I have a plugin with a rain sensor and I send 1.5 as total precipitation, but the sensor still displays 0.0!!! I will do some more investigation...

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Thursday 24 October 2019 22:17
by andreo
Maybe this can help you, on 23:59 hour the last update is written to the graph, on 00:00 hour the value of the day total resets to 0mm. After 1 minute the total previous day total becomes negative and will be displayed as a positive value in the day graph. (Donderdag) see database.
grafiekrain.png
grafiekrain.png (101.65 KiB) Viewed 6653 times
database.PNG
database.PNG (29.72 KiB) Viewed 6653 times

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 04 November 2019 22:45
by andreo
Xorfor wrote: Tuesday 22 October 2019 21:29 I didn't have this problem this time. In my log I saw that the correct data was send and the sensor showed this data.

I am running an other test, and it seems that updating the Rain sensor does not work as expected! At this moment I have a plugin with a rain sensor and I send 1.5 as total precipitation, but the sensor still displays 0.0!!! I will do some more investigation...
After viewing the log there is 1 hour difference in time visible, is this possibly causing the double count?

2019-11-04 22:38:00.598 (WS5500) utcdate: 2019-11-04 21:37:58
2019-11-04 22:38:00.599 (WS5500) datetime.strptime(utcdate, '%Y-%m-%d %H:%M:%S'): 2019-11-04 21:37:58
2019-11-04 22:38:00.600 (WS5500) Protocol: Wunderground

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Wednesday 06 November 2019 20:48
by Xorfor
andreo wrote: Monday 04 November 2019 22:45 After viewing the log there is 1 hour difference in time visible, is this possibly causing the double count?

2019-11-04 22:38:00.598 (WS5500) utcdate: 2019-11-04 21:37:58
2019-11-04 22:38:00.599 (WS5500) datetime.strptime(utcdate, '%Y-%m-%d %H:%M:%S'): 2019-11-04 21:37:58
2019-11-04 22:38:00.600 (WS5500) Protocol: Wunderground
No that is not the problem, just a debug line added by me. Later on in the code, this utc time is converted to the local (time on the Domoticz) time, to be sure that the PWS is sending data for the correct date.

Meanwhile, I have found 2 problems in Domoticz with this rain counter. These problems are NOT related to python plugins, but can also be seen in other hardware like Buienradar!!!

1. You will see that almost every day, the first hour has no data (also no 0 mm). As you can see in your table of data, that Domoticz (so not the plugin) stores the data every 5 minutes (sometimes 1 second later). At the beginning of a new day Domoticz resets its own internal counter to 0. If the PWS sends in the first hour its total precipitation, this value is stored at dd-mm-yyyy 01:00:00, not at dd-mm-yyyy 00:59:59. The graph should not show 00:00, or store the total rain fall at hh:59:59.
2. Sometimes the 00:00 shows the value 0, but then you will see a negative value at 01:00. For the day total this is used as positive value for the new day. See image as an example.
Aantekening 2019-11-06 201145.jpg
Aantekening 2019-11-06 201145.jpg (60.92 KiB) Viewed 6588 times
I can not fix this. Hopefully the Domoticz programmers can do some more investigation.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Wednesday 27 November 2019 20:55
by Xorfor
I think I found a workaround for the problem in the Domoticz Rain device. I also addded a new Rain rate device.

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Saturday 30 November 2019 0:55
by andreo
tested the latest version for two days and now displays the correct amount of rain.

Verstuurd vanaf mijn MHA-L29 met Tapatalk


Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 09 December 2019 16:02
by mister006
The script worked for the evening, but the next day this error appeared:
2019-12-09 16:00:33.739 Error: (Weathi) 'onMessage' failed 'TypeError':'attribute of type 'NoneType' is not callable'.
2019-12-09 16:00:33.739 Error: (Weathi) ----> Line 380 in '/home/pi/domoticz/plugins/Domoticz-PWS-Plugin/plugin.py', function onMessage
2019-12-09 16:00:33.739 Error: (Weathi) ----> Line 161 in '/home/pi/domoticz/plugins/Domoticz-PWS-Plugin/plugin.py', function onMessage

What is going wrong here? Thanks

Re: Python Plugin: PWS (Personal Weather Station)

Posted: Monday 09 December 2019 16:50
by andreo
try once to completely reset domoticz, i have had this if you only restart the service.

Verstuurd vanaf mijn MHA-L29 met Tapatalk