Neerslag App (rain forecast) (Buienalarm and/or Buienradar)

Don’t know what changed last few hours, did no uptdate or anything, but it seems to work again. Only difference there is, there is nog rain expected. Yesterdag it was raining al day.

Really love this! On my wall tablet I would like to be able to put a sentence like ‘In 30 minutes it will lightly rain, in 45 min it will rain heavily’. I am not the best jinja code programmer but was trying something like this. I have not figured out how I run this in reverse so I get the earliest moment (and not the latest). And somehow I am unable to extra the data from precip.

I realize that I have just started the coding and that there is some steps to go, but hopefully you can point me in the right direction to get this going.

Thanks!

{% set threshold_licht = '0.4' | float %}
{% set threshold_matig = '2.0' | float %}
{% set threshold_zwaar = '5.0' | float %}
{% for regen in state_attr('neerslag_buienalarm_regen_data', 'precip') %}
  {% if regen | float >= threshold_licht %}
    {{ 'Light rain' }}
  {% elif regen | float >= threshold_matig %}
    {{ 'Medium rain' }}
  {% elif regen | float >= threshold_zwaar %}
    {{ 'Heavy rain' }}
  {% endif %}
{% endfor %}

I am receiving the same “custom element does not exist” error on my wallmounted iPad Air. Strangely, my PC’s both show the card correctly.
On the iPad I have already cleared the cache and cookies, but it’s still not displaying correctly. Other newly added cards show correctly on it, so it seems to be a neerslag-card specific issue.

Any clue? Perhaps my iOS 12 tablet is too old?

It seems to be a caching issue on your iPad. Try loading Home Assistant in a private browser window and you should see it working correctly.

Hi @mn_box,

Here’s an implementation example. This template will tell you whether or not it’s going to rain in the next 30 minutes even though the data set is longer (2hrs).

{% set myWeatherData = state_attr("sensor.neerslag_buienalarm_regen_data","data") %}
{% set mySlicePoints = 1800 / myWeatherData.delta|round %}
{% set ns = namespace() %}
{% set ns.myPrecip = 0 %}
{% for precipItem in myWeatherData.precip %}
    {%- if loop.index <= mySlicePoints -%}
      {% set ns.myPrecip = ns.myPrecip + precipItem -%}
    {% endif %}
{%- endfor %}

The weather delta is {{ myWeatherData.delta }}.
The weather precip is {{ myWeatherData.precip }}.
The slicePoints is {{ mySlicePoints }}
The ns.myPrecip is {{ ns.myPrecip }}
It's {% if ns.myPrecip == 0 -%} not {% endif -%} going to rain.

Points to note:

  • This uses sensor.neerslag_buienalarm_regen_data as the source of data.
  • If you want to change the duration from 30 minutes, change the 1800 value (seconds).
  • Determining if it’s going to rain is basically summing up the precipItem and checking the total.
  • Carrying a value from within a loop body to an outer scope requires a namespace.

Since you want to know how much it’s going to rain, you’d do something slightly different but you should get the idea.

1 Like

I sum up the first 6 data points, which are five minutes each (half an hour) to determine if it is going to rain:

{{ state_attr("sensor.neerslag_buienalarm_regen_data","data").precip[:6] | sum() }}
2 Likes

Wow Alfred J and Parrel, super helpful. Thanks for the examples, this is also helping me for future templating!

@aex351 I am getting not in coverage or Not found: location must be inside the Netherlands or Belgium when installing these. I’m in the UK, but both sites support the UK.

What’s going on ?

The error message is from the external API (Buienalarm or Buienradar). It seems the location you are trying to use isn’t supported by the API. Unfortunately that is out of my control. If there is an API (or service) that supports your location I can add this.

I don’t know what happened, but it is no longer working. It was working yesterday. And I am from the Netherlands.

type: custom:neerslag-card
entities:
  - sensor.neerslag_buienradar_regen_data
  - sensor.neerslag_buienalarm_regen_data
title: Rain Forecast
autozoom: true

image

It can be that the external API’s are down. This will result in no data shown in the graph. Typically this happens when the external API’s can’t handle the load and will go down for a minute or two.

1 Like

Old Threat… but… Fix it with removing rule with buienrainforecast from configuration.yaml!

Since today -12 april - and after the updates yesterday of HA core, the Neerslag App can not be found. Issue is in Chrome (also incognito mode) and on Companian app.

Pushed an update. Buienalarm data should now be more accurate. In case of any issues. Clear your browser/app cache. That should reload the graph.

I really like the app and I am now using it to also show weather data on a screen powered by OpenHasp.
However, it seems that the integration is only updating every 15 minutes. Is that something that I can change somewhere to 5 minutes? (my screen now shows sometimes that it will start raining in -3 minutes ;))
Thanks!

I think that I found it myself. In sensor.py it states that the scan interval is 180 seconds which suggests updates every 3 minutes. However, the Buienalarm data is often >10 minutes old. Any thoughts what I can do about it? (already decreased the scan interval to 60 seconds)
Thanks for any help!

Your problem could be related to OpenHasp. Currently I am not observing any bug with the Neerslag App and Home Assistant. I will monitor this situation. Also I would advice against lowering the default poling value, as I observed before that Buienalarm will shadow ban you by returning cached data.

Thank you for your response.
I tried lowering the interval time but concluded that it didn’t help indeed. Perhaps due to the shadow ban. So I increased the value again (now even to every 4 minutes).

tried to install it but i am getting an unavailable…

any directions to look?

Is there a way to make the entire card clickable? I would like it to open a pop-up displaying the Buienradar Map (Camera).