Skip to content

Siewert308SW/domoticz-buienradar

 
 

Repository files navigation

Domoticz Buienradar.nl Weather Lookup Plugin

Short summary

This is a virtual hardware plugin to add weather information from Buienradar.nl to your Domoticz interface.

It gets the xml weather feed from http://xml.buienradar.nl, finds the weather station nearby your location and add the relevant weather information to your Domoticz interface.

Since it uses buienradar.nl it only works for locations in The Netherlands.

This plugin is open source and it can be found at https://github.com/ffes/domoticz-buienradar/

Why yet another weather plugin?

Q: Why did I spend a couple of evenings to write this plugin when I could have spend just a couple of minutes to set up the existing Weather Underground or AccuWeather plugin?

A: Because I can, because it is much easier for Dutch users (no need to setup or register an API key, etc), because I want to learn how to extend my Domoticz, because I improve my Python skills, because it is fun.

Installation and setup

If you are use a Raspberry Pi to host your Domoticz, you probably need to install libpython3.4 for plugins to work.

sudo apt install libpython3.4

At the moment of writing you also need to install:

sudo apt install python3-dev

In your domoticz/plugins directory do

cd domoticz/plugins
git clone https://github.com/ffes/domoticz-buienradar.git

Alternatively you can download the latest version from https://github.com/ffes/domoticz-buienradar/archive/master.zip and unzip it. Then create a directory on your Domoticz device in domoticz/plugins named buienradar and transfer all the files to your device.

Restart your Domoticz service with:

sudo service domoticz.sh restart

Now go to Setup, Hardware in your Domoticz interface. There you add Buienradar.nl (Weather lookup).

Make sure you enter all the required fields.

In the log you should see the plugin coming to life, picking the weather station nearby and adding the weather information to your interface.

Known bugs

At the moment there is no way to determine the type of the devices from within the plugin. So when you want to change any of those settings you need to remove all the devices and restart Domoticz. The new devices will be added matching your settings.

Other then that use GitHub Issues for feature request or bug reports.

State of development

With the current implementation of the Python plugin framework this plugin is quiet feature complete. Only rain levels could be added.

A useful features in the plugin framework to have would be:

  • Get the TypeName of the plugins devices. With that it would be possible to determine if new devices need to be created when the user changes one of the selections on the hardware page.

Developing the plugin

To local test there is a localtest.py script that can be run from the command line.

python3 localtest.py

There is also a very small module named fakeDomoticz.py. It is used so localtest.py can use Domoticz.Log() and Domoticz.Debug(). The output is simply printed to the console.

To do a real local test download the xml once with

wget http://xml.buienradar.nl -O buienradar.xml

localtest.py will use this file when it is found in the current directory. This way you can avoid hammering the website when testing.

If you want to summit a pull request, please use an editor that supports EditorConfig so the line endings and indent style remain consistent.

About

Domoticz Buienradar.nl Weather Lookup Plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%