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

Tags: #<Tag:0x00007fc406940c10>

While working on a card that has the ability to plot a graph (which didn’t exist), I implemented this functionality in to a rain forecast graph. In the Netherlands we have Buienalarm and Buienradar as a service for such functionality and I wanted to have this integrated within Home Assistant. The outcome of this is the Neerslag Card.

The Neerslag card has the ability to show the rain forcast of Buienalarm and/or Buienradar in one graph.

The usage of the Neerslag card currently consists out 2 actions 1) The actual card 2) Setting up custom sensors in configuration.yaml.

While the installation proces is pretty straightforward, I am looking to see if I can simplify this by creating one complete package (plug-and-play / home-assistant micro app). Most likely a first step would be to create a custom integration for the custom sensors.

The Neerslag Card repository is compatible with HACS so you can add the GIT repository as a custom HACS repository. I also created a request to have the Neerslag Card added to HACS itself.

7 Likes

Hi @aex351
Many thanks. Looks very nice & handy!

Is this also working outside The Netherlands? It seems it’s not working in Belgium?
I see it uses a .nl website reference for generating the sensors in configuration.yaml.
Changing these website references to .be is not working as the sensors mention : Onbekend.

Any idea to get it working?
Many thanks!

I have not tested this outside of the Netherlands. However I think these services are also available in Belgium. I see you made a mistake with the setup of the sensors. You also need to replace the <> characters.

Well that did the trick :slight_smile: :see_no_evil:
It’s working now … FYI I just used the initial .nl references.
It’s super handy. Many thanks for your work!

Is there any option to use different colors in the graph for buienradar en buienalarm?

I have installed this Card via HACS. However after a few minutes, I have seen that the contents of the graph has been disappeared. I have checked the logbook and have seen the errors below:

Configuration.yaml:

sensor:
  - platform: command_line
    command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat=51.76&lon=5.57&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}';    print(data);"
    name: Buienradar_Regen_Data
    json_attributes:
      - data
    value_template: 'last_changed: {{states.sensor.buienradar_regen_data.last_changed}}'
    scan_interval: 240

Error in logbook:

Thanks in advance for your help!

@tvds, using different colors is currently not an option.

@cmartens, you can ignore that error. It can be caused when the external service responds to slow or is down. You can try increasing the command_timeout value if it bothers you. https://www.home-assistant.io/integrations/sensor.command_line/#command_timeout.

1 Like

Hi @aex351,
would it be possible to plot the data using the apex charts card?
Could you show me how pls?

Thanks!

I think it should be possible. However I am not using the ApexCharts Card myself so I am not able to give an example. More info here: https://github.com/aex351/home-assistant-neerslag-card/issues/10.

Is it possible that we can use different colors for buienradar and buienalarm ?

@_Mitch07 currently that is not possible. I will probably make the colors configurable later on. Once other activities have been completed and the card has become more stable

You might also want to tryout the Neerslag App instead of the Neerslag Card. It has not been released yet to HACS, however you can manual import it and use it. The Neerslag App includes the Neerslag Card with sensors.

1 Like

@aex351,

Just installed the Neerslag app, looks good.

1 Like

Hi, I see the following warning in the HA logbook: Template variable warning: ‘None’ has no attribute ‘last_changed’ when rendering ‘last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed}}’. The graph is not displayed. I have reinstalled the Card via HACS and restarted the system, however still see the warning above. Can anybody help me to show the graph again? Thanks!

If the sensors do not work, then the card might remain blank. No data = no graph to be displayed. Currently the Neerslag Card does not explicitly inform you of this (i.e. there is no information message). However, in developer tools you can look up the sensors and check if there is data present. If there is data present and the card still remains blank, please inform me.

Also be sure to fetch the latest updates of the Neerslag Card. I recommend you to migrate to the Neerslag App.

1 Like

Great! This is what I was waiting for quite a long time. Thanks for making this! I have it running now for a few hours and see some attention points:

  • As others mentioned, 2 colors would be great. I now simply have 2 graphs on my page.
  • Quite often at least one of the graphs is not showing and sometimes the data seems to be a bit old.
  • It seems to be a bit heavy on system resources. The average CPU usage after installation seems to consistently be a bit higher than before installation (this might also be caused by the update of another custom component which I updated at the same time)
  • 55 errors and warnings in the log in just 13 hours:
  • Card doesn’t always show:
    image

Updating the card to the latest version did the trick. Thanks!

@Plevuus, the timeouts are typically related to 1) Home Assistant being slow (or busy with other stuff - during start-up for example) 2) the weather service not responding or responding fast enough. 3) your internet connection not being stable.

The only thing I can do is to increase the timeout threshold or hide the error message.

The error regarding the card not always getting displayed should now be fixed with the latest update (version 2021.04.08.1). Make sure to refresh your page (shift + F5).