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

Did think the same.

Tested this on my pc bij clearing cache on my browser or login in incognito mode, both times it doesn’t work.

Also tested clearing cache on my Android my Android app, then the card app is still working on mobile network but is not working when I’m connected to wifi to my local network.

This confuses me. How can after clearing cache it still work on mobile, but not on local network?

Since the 2022.6 Update I do get this warning in the logs, could this be related?

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:103
First occurred: 8 June 2022, 18:53:39 (2 occurrences)
Last logged: 8 June 2022, 18:53:39

Detected integration that uses deprecated `async_get_registry` to access device registry, use async_get instead. Please report issue to the custom component author for neerslag using this method at custom_components/neerslag/sensor.py, line 43: dev_reg = await hass.helpers.device_registry.async_get_registry()
Detected integration that uses deprecated `async_get_registry` to access entity registry, use async_get instead. Please report issue to the custom component author for neerslag using this method at custom_components/neerslag/sensor.py, line 44: ent_reg = await hass.helpers.entity_registry.async_get_registry()

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).