Recommendation: Use the
Neerslag App
or migrate from theNeerslag Card
to theNeerslag App
(all-one-package: sensors + card). The Neerslag App is part of the default HACS repository.
Display rain forecast using Buienalarm and/or Buienradar sensor data.
The graph will auto-scale (auto-zoom) depending on the amount of rain. You can interact with the graph to see how much rain will fall on a specific moment. This card is fully functional on both mobile as well as desktop.
The Neerslag card installation consists out of three actions:
1) Install via HACS or manual;
2) Configuring the Buienalarm and/or Buienradar custom sensor via configuration.yaml
3) Adding the the Neerslag Card to your dashboard
Note: Home Assistant requires a restart after making changes in:
configuration.yaml
.
This is the recommended option and also allows for easy updates. 1) Find this repository in HACS; 2) Add the Neerslag Card in the Home Assistant Community Store as front-end plugin.
For updates go to the Community Store (HACS) and click update
Not recommended, you will need to track updates manually by browsing to the repository;
1) Download the latest release of the Neerslag Card from this repository;
2) In Home Assistant, create the folder config/www/community
if it does not exist;
3) Add the Neerslag Card to the community
folder. (i.e. community/neerslag-card/
);
4) Add the Neerslag Card as a resource in Home Assistant (config/lovelace/resources);
5) Using the following details as resource: /hacsfiles/neerslag-card/neerslag-card.js
as Javascript module.
For updates: repeat step 1 to 3. Home Assistant will not delete any settings.
Add the following to configuration.yaml
:
sensor:
- platform: command_line
command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat=<lat-3-decimals>&lon=<lon-3-decimals>®ion=nl&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":'+dataRequest+'}'; print(data);"
name: Neerslag_Buienalarm_Regen_Data
json_attributes:
- data
value_template: 'last_changed: {{states.sensor.neerslag_buienalarm_regen_data.last_changed | default(now())}}'
scan_interval: 240
<lat-3-decimals>
with your latitude. For example: 55.000
Replace <lon-3-decimals>
with your longitude. For example: 5.000
Attention: delete the
<>
characters.
Add the following to 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=<lat-2-decimals>&lon=<lon-2-decimals>&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}'; print(data);"
name: Neerslag_Buienradar_Regen_Data
json_attributes:
- data
value_template: 'last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed | default(now())}}'
scan_interval: 240
<lat-2-decimals>
with your latitude. For example: 55.00
Replace <lon-2-decimals>
with your longitude. For example: 5.00
Attention: delete the
<>
characters.
Instead of manual configuring the latitude and longitude. There is an option to use the latitude and longitude that has been configured in Home Assistant.
<lat-3-decimals>
with your latitude. For example: {{state_attr("zone.home", "latitude") | round(3, default="not available")}}
<lon-3-decimals>
with your longitude. For example: {{state_attr("zone.home", "longitude") | round(3, default="not available")}}
Attention: delete the
<>
characters.Buienradar sensor configuration
<lat-2-decimals>
with your latitude. For example: {{state_attr("zone.home", "latitude") | round(2, default="not available")}}
Replace <lon-2-decimals>
with your longitude. For example: {{state_attr("zone.home", "longitude") | round(2, default="not available")}}
Attention: delete the
<>
characters.
Via the interface: 1) Go in to "Configure UI mode" on your dashboard 2) Click on "Add Cards" and find the "Neerslag card" in the list of cards
type: 'custom:neerslag-card'
title: Neerslag
entity: sensor.neerslag_buienalarm_regen_data
type: 'custom:neerslag-card'
title: Neerslag
entities:
- sensor.neerslag_buienalarm_regen_data
- sensor.neerslag_buienradar_regen_data
Enable auto zoom to have the graph dynamically zoom in or out depending on the amount of rainfall.
Note: By default auto zoom is disabled. Which gives the graph a fixed starting position displaying low, medium and heavy rainfall. Auto zoom will continue on extreme rainfall. Before version 2022.07.07.1 this setting was set to true.
autozoom: false