Buienradar binding

By chance I found in the documentation a (new) binding voor Buienradar.
How do I install the binding? I can’t find it in paperui or marketplace. Google won’t let me find the jar file either.

Hey @ljsquare, did you find a solution? I’m facing the same problem.

It’s currently only available in the 2.5.0-SNAPSHOT version (which is used for testing).

You can install it via Paper UI:

thx @wborn that ends my search :wink:

I’m using version 2.5m1 and I’ve extracted the binding from the snapshot addon kar file.

You can also add this org.openhab.binding.buienradar-2.5.0-SNAPSHOT.jar to your addons dir. I gave it a brief test and it seemed to work with the 2.4.0 release. :slight_smile:

Thank @wborn Plugin is installed, no errors. Seems to work, now waiting for rain to see if it really works. Kind of doubdfull dough. I’ve excpected a 0 for current rainfall but i get a -.
We’ll see in a couple of days i gues :wink:

Hehehe. Nice, i love this binding.

1 Like

I see correct values for rainfall when I add a location where it will rain on the map: :slight_smile: :umbrella:

Nice, good to know.
I’m so happy with this binding. I am a big aquarium lover.
Planning on gathering rainwater, so now i know when i have to empty my barrels for new water :slight_smile:
I’m kinda new to openhab but each day i love it more and more.

2 Likes

It only gets better after you get through the initial (sometimes frustrating) learning phase! I also don’t mind some bad weather in a while since I’m into wind energy. :slight_smile: :cloud_with_lightning: :cyclone:

1 Like

There’s probably something wrong in the documentation of the Buienradar binding, and a small bug with the binding itself.

The short story:

  1. The binding documentation incorrectly states that there are 1 “current” + 24 “forecast” rain channel items. In practice, the Buienradar.nl web API only returns 24 forecast values.
  2. The binding only reports values for 23 forecast channels (buienradar:rain_forecast:<thingID>:forecast_5buienradar:rain_forecast:<thingID>:forecast_115).

See also the following issue on GitHub:

Here’s the long story.

I’m running the binding on 2.5.0-SNAPSHOT (build #1601).

First, I use groups to aggregate the forecast by hour as follows:

Group:Number:SUM gBuienRadarForecastRain "Rain forecast (0-120 min) [%.1f mm]" <rain>
Group:Number:SUM gBuienRadarForecastRainHour01 "Rain forecast (0-60 min) [%.1f mm]" <rain>
Group:Number:SUM gBuienRadarForecastRainHour02 "Rain forecast (60-120 min) [%.1f mm]" <rain>

Then I add the forecast items as follows:

// Forecast for the first hour:
Number  Wx_buienradar_forecast_000_min  "Rain forecast in 0 minutes [%.1f mm]"   <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_0"    }
Number  Wx_buienradar_forecast_005_min  "Rain forecast in 5 minutes [%.1f mm]"   <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_5"    }
Number  Wx_buienradar_forecast_010_min  "Rain forecast in 10 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_10"   }
Number  Wx_buienradar_forecast_015_min  "Rain forecast in 15 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_15"   }
Number  Wx_buienradar_forecast_020_min  "Rain forecast in 20 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_20"   }
Number  Wx_buienradar_forecast_025_min  "Rain forecast in 25 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_25"   }
Number  Wx_buienradar_forecast_030_min  "Rain forecast in 30 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_30"   }
Number  Wx_buienradar_forecast_035_min  "Rain forecast in 35 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_35"   }
Number  Wx_buienradar_forecast_040_min  "Rain forecast in 40 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_40"   }
Number  Wx_buienradar_forecast_045_min  "Rain forecast in 45 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_45"   }
Number  Wx_buienradar_forecast_050_min  "Rain forecast in 50 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_50"   }
Number  Wx_buienradar_forecast_055_min  "Rain forecast in 55 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour01) { channel="buienradar:rain_forecast:home:forecast_55"   }

// Forecast for the second hour:
Number  Wx_buienradar_forecast_060_min  "Rain forecast in 60 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_60"   }
Number  Wx_buienradar_forecast_065_min  "Rain forecast in 65 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_65"   }
Number  Wx_buienradar_forecast_070_min  "Rain forecast in 70 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_70"   }
Number  Wx_buienradar_forecast_075_min  "Rain forecast in 75 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_75"   }
Number  Wx_buienradar_forecast_080_min  "Rain forecast in 80 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_80"   }
Number  Wx_buienradar_forecast_085_min  "Rain forecast in 85 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_85"   }
Number  Wx_buienradar_forecast_090_min  "Rain forecast in 90 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_90"   }
Number  Wx_buienradar_forecast_095_min  "Rain forecast in 95 minutes [%.1f mm]"  <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_95"   }
Number  Wx_buienradar_forecast_100_min  "Rain forecast in 100 minutes [%.1f mm]" <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_100"  }
Number  Wx_buienradar_forecast_105_min  "Rain forecast in 105 minutes [%.1f mm]" <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_105"  }
Number  Wx_buienradar_forecast_110_min  "Rain forecast in 110 minutes [%.1f mm]" <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_110"  }
Number  Wx_buienradar_forecast_115_min  "Rain forecast in 115 minutes [%.1f mm]" <rain> (gBuienRadarForecastRain, gBuienRadarForecastRainHour02) { channel="buienradar:rain_forecast:home:forecast_115"  }

I enabled debug logging for the buienradar binding through the Karaf console to verify how the forecast values were propagated to the items linked to the channels provided by the binding:

log:set DEBUG org.openhab.binding.buienradar

Here’s what I get in openhab.log:

2019-06-12 17:00:24.734 [DEBUG] [uienradarapi.BuienradarPredictionAPI] - Returned result from buienradar: 000|17:05
000|17:10
000|17:15
000|17:20
000|17:25
000|17:30
000|17:35
000|17:40
000|17:45
117|17:50
099|17:55
000|18:00
000|18:05
000|18:10
000|18:15
000|18:20
092|18:25
112|18:30
106|18:35
087|18:40
000|18:45
000|18:50
000|18:55
000|19:00

Here it’s clear that the Buienradar.nl web API returns 24 forecast values and not 25 values as suggested by the documentation. In Paper UI I also only see 24 Things defined, with forecast for 0, 5… 115 minutes, corresponding to:

  • buienradar:rain_forecast:home:forecast_0
  • buienradar:rain_forecast:home:forecast_115

In openhab.log the forecasts are also reported:

2019-06-12 17:00:24.751 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 5 at 2019-06-12T17:05+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.758 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 10 at 2019-06-12T17:10+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.764 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 15 at 2019-06-12T17:15+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.771 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 20 at 2019-06-12T17:20+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.777 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 25 at 2019-06-12T17:25+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.784 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 30 at 2019-06-12T17:30+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.790 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 35 at 2019-06-12T17:35+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.797 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 40 at 2019-06-12T17:40+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.803 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 45 at 2019-06-12T17:45+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.809 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 50 at 2019-06-12T17:50+02:00[Europe/Amsterdam] is 1.78
2019-06-12 17:00:24.818 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 55 at 2019-06-12T17:55+02:00[Europe/Amsterdam] is 0.49
2019-06-12 17:00:24.824 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 60 at 2019-06-12T18:00+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.830 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 65 at 2019-06-12T18:05+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.837 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 70 at 2019-06-12T18:10+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.845 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 75 at 2019-06-12T18:15+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.850 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 80 at 2019-06-12T18:20+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.860 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 85 at 2019-06-12T18:25+02:00[Europe/Amsterdam] is 0.29
2019-06-12 17:00:24.866 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 90 at 2019-06-12T18:30+02:00[Europe/Amsterdam] is 1.24
2019-06-12 17:00:24.871 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 95 at 2019-06-12T18:35+02:00[Europe/Amsterdam] is 0.81
2019-06-12 17:00:24.877 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 100 at 2019-06-12T18:40+02:00[Europe/Amsterdam] is 0.21
2019-06-12 17:00:24.882 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 105 at 2019-06-12T18:45+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.888 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 110 at 2019-06-12T18:50+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.895 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 115 at 2019-06-12T18:55+02:00[Europe/Amsterdam] is 0.00
2019-06-12 17:00:24.902 [DEBUG] [uienradar.internal.BuienradarHandler] - Forecast for 120 at 2019-06-12T19:00+02:00[Europe/Amsterdam] is 0.00

This means that the Buienradar Web API only returns 24 values, not 25 (current + 24 5-min forecasts). Also, the binding reports that it processed 24 forecast values.

My understanding is that the first forecast spans “now” until “now + 5 minutes”, etc. But it is unclear what the binding does use as time convention (also, due to a missing value - see below):

In events.log the binding then reports the following state changes (note: lots of 0.0mm forecasts that remain unchanged):

2019-06-12 17:00:25.616 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_005_min changed from NULL to 0.00
2019-06-12 17:00:25.641 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour01 changed from NULL to 0.00 through Wx_buienradar_forecast_005_min
2019-06-12 17:00:25.665 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from NULL to 0.00 through Wx_buienradar_forecast_005_min
2019-06-12 17:00:26.716 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_010_min changed from NULL to 0.00
2019-06-12 17:00:26.807 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_015_min changed from NULL to 0.00
2019-06-12 17:00:26.831 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_020_min changed from NULL to 0.00
2019-06-12 17:00:26.863 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_025_min changed from NULL to 0.00
2019-06-12 17:00:26.895 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_030_min changed from NULL to 0.00
2019-06-12 17:00:26.924 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_035_min changed from NULL to 0.00
2019-06-12 17:00:26.944 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_040_min changed from NULL to 0.00
2019-06-12 17:00:26.961 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_045_min changed from NULL to 0.00
2019-06-12 17:00:26.979 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour01 changed from 0.00 to 1.78 through Wx_buienradar_forecast_050_min
2019-06-12 17:00:26.996 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 0.00 to 1.78 through Wx_buienradar_forecast_050_min
2019-06-12 17:00:27.014 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_050_min changed from NULL to 1.78
2019-06-12 17:00:27.032 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 1.78 to 2.27 through Wx_buienradar_forecast_055_min
2019-06-12 17:00:27.051 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour01 changed from 1.78 to 2.27 through Wx_buienradar_forecast_055_min
2019-06-12 17:00:27.070 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_055_min changed from NULL to 0.49
2019-06-12 17:00:27.091 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour02 changed from NULL to 0.00 through Wx_buienradar_forecast_060_min
2019-06-12 17:00:27.109 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_060_min changed from NULL to 0.00
2019-06-12 17:00:27.126 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_065_min changed from NULL to 0.00
2019-06-12 17:00:27.144 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_070_min changed from NULL to 0.00
2019-06-12 17:00:27.161 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_075_min changed from NULL to 0.00
2019-06-12 17:00:27.178 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_080_min changed from NULL to 0.00
2019-06-12 17:00:27.195 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 2.27 to 2.56 through Wx_buienradar_forecast_085_min
2019-06-12 17:00:27.211 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_085_min changed from NULL to 0.29
2019-06-12 17:00:27.247 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour02 changed from 0.00 to 0.29 through Wx_buienradar_forecast_085_min
2019-06-12 17:00:27.265 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour02 changed from 0.29 to 1.53 through Wx_buienradar_forecast_090_min
2019-06-12 17:00:27.284 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 2.56 to 3.80 through Wx_buienradar_forecast_090_min
2019-06-12 17:00:27.304 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_090_min changed from NULL to 1.24
2019-06-12 17:00:27.324 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_095_min changed from NULL to 0.81
2019-06-12 17:00:27.342 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour02 changed from 1.53 to 2.34 through Wx_buienradar_forecast_095_min
2019-06-12 17:00:27.360 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 3.80 to 4.61 through Wx_buienradar_forecast_095_min
2019-06-12 17:00:27.377 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_100_min changed from NULL to 0.21
2019-06-12 17:00:27.395 [GroupItemStateChangedEvent] - gBuienRadarForecastRain changed from 4.61 to 4.82 through Wx_buienradar_forecast_100_min
2019-06-12 17:00:27.412 [GroupItemStateChangedEvent] - gBuienRadarForecastRainHour02 changed from 2.34 to 2.55 through Wx_buienradar_forecast_100_min
2019-06-12 17:00:27.431 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_105_min changed from NULL to 0.00
2019-06-12 17:00:27.448 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_110_min changed from NULL to 0.00
2019-06-12 17:00:27.470 [vent.ItemStateChangedEvent] - Wx_buienradar_forecast_115_min changed from NULL to 0.00

If I want to display the forecast items on a sitemap, as in:

Default item=gBuienRadarForecastRainHour01
Default item=gBuienRadarForecastRainHour02

then I see that only 23 values are reported, and the 0 minute forevcast always has UNDEF as state (item linked to channel buienradar:rain_forecast:home:forecast_0).

If I add an item linked to the 120 minute forecast, then its state also always remains UNDEF.

So probably the binding lost one of the forecast items.

It seems to have resolved itself, thanks to a nonzero forecast value…

Has anyone figured out a nice (graphical) way to display the data?

Hi shutterfreak: I still think this is a bug… But part of it is due to the buienradar API itself. Sometimes the values are not updated, or the clock is not synchronized. I am now changing the binding to regard the first value as the current situation instead of using the date/time of the machine on which the binding is running.

Nice graphical way on Grafana / Influxdb with the ‘discrete’ plugin:

I guess I’ll add it to the README.md. Anyone knows how to make references to screenshots in the code?

3 Likes

Ah Thanks!
(I should have thought of that, as I am using the discrete plugin already for central heating and hotwater status…:sunglasses:)

Do you mean to add screenshots in the markdown README file?

Already did that. I added it in the docs/img folder.

1 Like

I’ve just seen your PR on GitHub. You did quite some changes!

I’m looking forward to try out your changes. I’m currently running 2.5.0~S1618-1 (Build #1618).