Buienradar Weather Lookup Plugin
Moderator: leecollings
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Buienradar Weather Lookup Plugin
Hi,
I put my first attempt to write a plugin for Domoticz on-line. It is a virtual weather station based on http://xml.buienradar.nl I have running on my installation at home for a couple of days now.
It can be found at https://github.com/ffes/domoticz-buienradar
At the moment after installing you need manually update your coordinates so the weather station nearby is automatically found. I hope there is a decent way to get this information from the Domoticz settings, but I have not found it yet.
Other then that it only works for the temperature at the moment. I need to figure out how I can generate some of the additional info you need to summit when for instance I add a humidity device.
Note that since it uses buienradar for weather information, it only works for location within (or close by) The Netherlands. Also note it only uses the xml feed of the weather information, not the rain images we all are so familiar with from buienradar.
Update 19-Feb-2017:
All relevant weather information (temperature, humitidy, barometer and wind) can be viewed.
I put my first attempt to write a plugin for Domoticz on-line. It is a virtual weather station based on http://xml.buienradar.nl I have running on my installation at home for a couple of days now.
It can be found at https://github.com/ffes/domoticz-buienradar
At the moment after installing you need manually update your coordinates so the weather station nearby is automatically found. I hope there is a decent way to get this information from the Domoticz settings, but I have not found it yet.
Other then that it only works for the temperature at the moment. I need to figure out how I can generate some of the additional info you need to summit when for instance I add a humidity device.
Note that since it uses buienradar for weather information, it only works for location within (or close by) The Netherlands. Also note it only uses the xml feed of the weather information, not the rain images we all are so familiar with from buienradar.
Update 19-Feb-2017:
All relevant weather information (temperature, humitidy, barometer and wind) can be viewed.
Last edited by ffes on Sunday 19 February 2017 17:50, edited 1 time in total.
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
Nice! Will certainly try this plugin.
You could also use the xml part of the script to add fields for lat and lon which the user can enter in the hardware page in stead of the script. But indeed even better to reuse the settings from Domoticz.
You could also use the xml part of the script to add fields for lat and lon which the user can enter in the hardware page in stead of the script. But indeed even better to reuse the settings from Domoticz.
Not using Domoticz anymore
- remb0
- Posts: 499
- Joined: Thursday 11 July 2013 22:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
wow nice! buienradar is easier and at my adress more accurate.
I hope rain will included in the future
I hope rain will included in the future

-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
Thanks guys to the positive feedback!
I just updated the repository on github. Now the user must fill in the latitude and longitude on the hardware page in the interface as suggested by G3rard. So you no longer need to manually edit the script
I just updated the repository on github. Now the user must fill in the latitude and longitude on the hardware page in the interface as suggested by G3rard. So you no longer need to manually edit the script

- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
I get this error after the update.
I entered some dummy lat lon data in the XML and restarted Domoticz, but that gives the same error.
After entering the lat lon in the hardware page, all works fine.
Maybe you can also add the wind devices?
Regarding getting the data from Domoticz, I just found that http://192.168.1.170:8080/json.htm?type ... =getconfig gives you the lat lon from Domoticz.
Don't know if you can use that in the Python script, but maybe it can help you.
Code: Select all
2017-02-10 00:48:18.650 Error: (Buienradar) 'onStart' failed 'ValueError':'could not convert string to float: '.
2017-02-10 00:48:18.650 Error: (Buienradar) ----> Line 44 in /home/gerard/domoticz/plugins/domoticz-buienradar/plugin.py, function onStart
After entering the lat lon in the hardware page, all works fine.
Code: Select all
2017-02-10 00:55:40.127 (Buienradar) Initialized version 1.0, author 'ffes'
2017-02-10 00:55:40.127 (Buienradar) Retrieve weather data from http://xml.buienradar.nl/
2017-02-10 00:55:40.213 (Buienradar) Found Meetstation Lelystad at 30.0 km from your home location
2017-02-10 00:55:40.213 (Buienradar) Temperature: -4.3
2017-02-10 00:55:40.213 (Buienradar) Wind Speed: 3.03
2017-02-10 00:55:40.213 (Buienradar) Wind Direction: 57.0
2017-02-10 00:55:40.213 (Buienradar) Wind Speed Gusts: 4.2
Regarding getting the data from Domoticz, I just found that http://192.168.1.170:8080/json.htm?type ... =getconfig gives you the lat lon from Domoticz.
Don't know if you can use that in the Python script, but maybe it can help you.
Not using Domoticz anymore
-
- Posts: 137
- Joined: Thursday 01 January 2015 9:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Buienradar Weather Lookup Plugin
Hello,
I really love this development. No more api calls with restrictions, etc.
I live in Lelystad. (lat: 52.50, lon: 5.49). I believe we have a weather station nearby. However, I get this message in the log: Found Meetstation Lopik-Cabauw at 11.8 km from your home location. I Think Lopik is a bit further away
.
Please keep up the good work and I hope you will add the other information too for use on the dashboard.
Rob
I really love this development. No more api calls with restrictions, etc.
I live in Lelystad. (lat: 52.50, lon: 5.49). I believe we have a weather station nearby. However, I get this message in the log: Found Meetstation Lopik-Cabauw at 11.8 km from your home location. I Think Lopik is a bit further away

Please keep up the good work and I hope you will add the other information too for use on the dashboard.
Rob
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
@G3rard
I had the similar problems with upgrading my script. Don't know why the default value didn't work. But entering it on the hardware page solves that indeed.
I will look at the web API way to get the coordinates. Feels really odd that a Python hardware plugin is able to create devices and set values, but to get some settings you need to use the web API. Then I still need to ask the use for hostname/ip, port and maybe even user/password. This is more then copying two numbers.
I will have to figure out how to calculate the wind chill temperatures when creating a wind device. According to https://www.domoticz.com/wiki/Domoticz_ ... URL's#Wind that needs to be one of the values in the sValue. I think I found the right formula on https://nl.wikipedia.org/wiki/Gevoelstemperatuur so hopefully this weekend I have some time to look at this a bit further (busy weekend ahead
)
I had the similar problems with upgrading my script. Don't know why the default value didn't work. But entering it on the hardware page solves that indeed.
I will look at the web API way to get the coordinates. Feels really odd that a Python hardware plugin is able to create devices and set values, but to get some settings you need to use the web API. Then I still need to ask the use for hostname/ip, port and maybe even user/password. This is more then copying two numbers.
I will have to figure out how to calculate the wind chill temperatures when creating a wind device. According to https://www.domoticz.com/wiki/Domoticz_ ... URL's#Wind that needs to be one of the values in the sValue. I think I found the right formula on https://nl.wikipedia.org/wiki/Gevoelstemperatuur so hopefully this weekend I have some time to look at this a bit further (busy weekend ahead

-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
@schulpr
I will test with your coordinates and see why Lelystad is not selected as your nearby station
I will test with your coordinates and see why Lelystad is not selected as your nearby station
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
@schulpr
I took a quick peek. It turns out buienradar changed (or better messed up) their xml format. The fields "latGarden" + "lonGraden" (used to be coordinates in decimal notation) are swapped with "lat" + "lon" (used to be coordinates in minutes notation).
But even worst... Take a look at the coords of for instance "Arnhem":
Notice the big difference between "lon" and "lonGraden"!!! 6.47 vs 5.88. The number in before the dot should always be the same.
I also noticed that they changed the formatting in the "datum" field, but that is no big deal for me. I ignore this field.
In my localtest I used the "lat" and "lon" fields and then "Meetstation Lelystad" is selected at 6.2 km from your location.
Not sure what the best fix is. I asked buienradar this question on their contact form, but don't expect too much from that (but maybe I an too negative). We will see.
I took a quick peek. It turns out buienradar changed (or better messed up) their xml format. The fields "latGarden" + "lonGraden" (used to be coordinates in decimal notation) are swapped with "lat" + "lon" (used to be coordinates in minutes notation).
But even worst... Take a look at the coords of for instance "Arnhem":
Code: Select all
<weerstation id="6275">
<stationcode>6275</stationcode>
<stationnaam regio="Arnhem">Meetstation Arnhem</stationnaam>
<lat>52.07</lat>
<lon>5.88</lon>
<datum>02-10-2017 12:40:00</datum>
<luchtvochtigheid>84</luchtvochtigheid>
<temperatuurGC>-2.1</temperatuurGC>
<windsnelheidMS>4.02</windsnelheidMS>
<windsnelheidBF>3</windsnelheidBF>
<windrichtingGR>64</windrichtingGR>
<windrichting>ONO</windrichting>
<luchtdruk>1023.42</luchtdruk>
<zichtmeters>3900</zichtmeters>
<windstotenMS>5.8</windstotenMS>
<regenMMPU>-</regenMMPU>
<zonintensiteitWM2>81</zonintensiteitWM2>
<icoonactueel ID="p" zin="half bewolkt">http://xml.buienradar.nl/icons/p.gif</icoonactueel>
<temperatuur10cm>-2</temperatuur10cm>
<url>http://www.buienradar.nl/nederland/weerbericht/weergrafieken/6275</url>
<latGraden>52.11</latGraden>
<lonGraden>6.47</lonGraden>
</weerstation>
I also noticed that they changed the formatting in the "datum" field, but that is no big deal for me. I ignore this field.
In my localtest I used the "lat" and "lon" fields and then "Meetstation Lelystad" is selected at 6.2 km from your location.
Not sure what the best fix is. I asked buienradar this question on their contact form, but don't expect too much from that (but maybe I an too negative). We will see.
-
- Posts: 137
- Joined: Thursday 01 January 2015 9:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Buienradar Weather Lookup Plugin
Hi ffes,
Thanks for your findings. For now I changed my settings to the numbers Buienradar is using. That's <latGraden>52.75</latGraden>
<lonGraden>5.89</lonGraden> for me in Lelystad. I will change this if you make adjustments to your great plugin.
Best regards,
Rob
Thanks for your findings. For now I changed my settings to the numbers Buienradar is using. That's <latGraden>52.75</latGraden>
<lonGraden>5.89</lonGraden> for me in Lelystad. I will change this if you make adjustments to your great plugin.
Best regards,
Rob
- Brutus
- Posts: 249
- Joined: Friday 26 September 2014 9:33
- Target OS: Windows
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
This sounds nice. It also works under Windows
It only selects the nearest Weather station 53km away. But that's a know issue now.

It only selects the nearest Weather station 53km away. But that's a know issue now.
1x Intel NUC8i5BEK (Windows 10 x64) Domoticz on Virtualbox with DietPi.
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
1x Aeon Labs USB Z-Stick S2
1x P1 Smart Meter USB
28x Fibaro Modules
SMA Solar System
Daikin Airco / Heating
Denon DHT-S716H & DSW-1H
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
I just pushed a new version to the github repository. When you pull in the new version the plugin will now use the fields <lat> and <lon> of the weather station. So make sure you use the right coordinates on the hardware page.
Other then that I am working on adding a wind device. It mostly works, but I need to figure what the best way is to upgrade, because a new device will be added. Probably just documenting how it should be done will enough right now.
Other then that I am working on adding a wind device. It mostly works, but I need to figure what the best way is to upgrade, because a new device will be added. Probably just documenting how it should be done will enough right now.
-
- Posts: 41
- Joined: Monday 12 October 2015 19:57
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
nice work!. Nicely picks a weatherstation nearby 
Looking forward to the wind device.
Are you also planning to use the other data available?

Code: Select all
2017-02-13 13:20:33.613 (Buienradar Weather) Devices created.
2017-02-13 13:20:33.613 (Buienradar Weather) Retrieve weather data from http://xml.buienradar.nl/
2017-02-13 13:20:33.664 (Buienradar Weather) Found Meetstation Rotterdam at 6.3 km from your home location
2017-02-13 13:20:33.664 (Buienradar Weather) Temperature: 4.2
2017-02-13 13:20:33.664 (Buienradar Weather) Wind Speed: 6.8
2017-02-13 13:20:33.664 (Buienradar Weather) Wind Direction: 85.0
2017-02-13 13:20:33.664 (Buienradar Weather) Wind Speed Gusts: 9.7
Are you also planning to use the other data available?
Code: Select all
<luchtvochtigheid>
<luchtdruk>
<zichtmeters>
<regenMMPU>
<zonintensiteitWM2>
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
@EldigoR
Yes, I am. But there are some things I need to dig in to. As I mention in my original post, how do I fill the extra parameters that are needed when you create those devices? I am a dev, don't know very little about meteorology.
Yes, I am. But there are some things I need to dig in to. As I mention in my original post, how do I fill the extra parameters that are needed when you create those devices? I am a dev, don't know very little about meteorology.
-
- Posts: 137
- Joined: Thursday 01 January 2015 9:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Buienradar Weather Lookup Plugin
Hi ffes,
I removed the old plugin and try to install the new version but it isn't visible anymore under "Hardware".
Did I do something wrong?
Kind regards, Rob
I removed the old plugin and try to install the new version but it isn't visible anymore under "Hardware".
Did I do something wrong?
Kind regards, Rob
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
Just ran into the same problem. Not sure what broke it, but these lines in the log must have something to do with it:
All I did was update to the latest beta a couple of minutes before. Not sure how to rollback to the version I was on this morning when it still worked. But hey, these are the joys of using the beta release 
Code: Select all
2017-02-13 21:06:21.568 PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
2017-02-13 21:06:21.570 PluginSystem: 'Weer' Registration ignored, Plugins are not enabled.

-
- Posts: 41
- Joined: Monday 12 October 2015 19:57
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: RE: Re: Buienradar Weather Lookup Plugin
The anwser should be here I thank...ffes wrote:@EldigoR
Yes, I am. But there are some things I need to dig in to. As I mention in my original post, how do I fill the extra parameters that are needed when you create those devices? I am a dev, don't know very little about meteorology.
http://www.domoticz.com/wiki/Developing_a_Python_plugin
The device has be of the right typename. For example "Temp+Hum+Baro"
Then set the proper sValue :
TEMP;HUM;HUM_STAT;BAR;BAR_FOR
TEMP = Temperature
HUM = Humidity
HUM_STAT = Humidity status
BAR = Barometric pressure
BAR_FOR = Barometer forecast
https://www.domoticz.com/wiki/Domoticz_ ... Fbarometer
Verstuurd vanaf mijn D5803 met Tapatalk
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: Buienradar Weather Lookup Plugin
Yes I know. But what are the right values for HUM_STAT and BAR_FOR?
How do I convert a percentage of humidity to a feeling (HUM_STAT). I found a table somewhere in the Internet. So I say < 45 = Dry, > 70 = Wet, everything else = comfortable. But are these are correct? I don't know.
How do I convert a air pressure in hPa to a prediction (BAR_FOR). I have looked some pictures of analogue barometers in the internet and I think I have some that should return a prediction. But again, if that is correct, I'm not sure.
I have just push that (weather) code, but haven't been able to add the devices yet. First my installation has to work again.
How do I convert a percentage of humidity to a feeling (HUM_STAT). I found a table somewhere in the Internet. So I say < 45 = Dry, > 70 = Wet, everything else = comfortable. But are these are correct? I don't know.
How do I convert a air pressure in hPa to a prediction (BAR_FOR). I have looked some pictures of analogue barometers in the internet and I think I have some that should return a prediction. But again, if that is correct, I'm not sure.
I have just push that (weather) code, but haven't been able to add the devices yet. First my installation has to work again.
-
- Posts: 41
- Joined: Monday 12 October 2015 19:57
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
Just use the values you seem best, you have to have a degree in weather
It can be ajusted afterwards.
Verstuurd vanaf mijn D5803 met Tapatalk

It can be ajusted afterwards.
Verstuurd vanaf mijn D5803 met Tapatalk
-
- Posts: 41
- Joined: Monday 12 October 2015 19:57
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Buienradar Weather Lookup Plugin
def Windchill(T, W):
# T Enter the temperature
# W = wind speed m/s
Wkm = W * 3.6 # m/s -> km/uur
windchill= 13.12 + (0.6215*T) + (0.3965*(T - 28.676)*(Wkm**0.16))
return windchill
Might help for the wind Chill..
Verstuurd vanaf mijn D5803 met Tapatalk
# T Enter the temperature
# W = wind speed m/s
Wkm = W * 3.6 # m/s -> km/uur
windchill= 13.12 + (0.6215*T) + (0.3965*(T - 28.676)*(Wkm**0.16))
return windchill
Might help for the wind Chill..
Verstuurd vanaf mijn D5803 met Tapatalk
Who is online
Users browsing this forum: No registered users and 1 guest