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

thanks aex351, am using the app, and have tested with the co-ordinates in the URL. Have read the readme file, and cannot see anything that I missed…Have dots in the Lat. & Lon.
Will continue to try and get it working, and will report back!

1 Like

Hey. excellent addon! I have it working but i got a question:

  1. Whats the ‘random’ number when i add the sensor ad entity to a card?
  2. How can i make an automation based on the precipitation data inside this sensor?

Maybe a stupid question, but what is the exact meaning of the main state values of the sensors?

  • Average rain over certain interval?
  • Total rain over certain interval?
  • Actual rain?
  • Other?

Or have I missed this somewhere above?

  1. The random number is to ensure your location does not get blocked from the server.
  2. You will need to create your own custom sensor for that if you want to make use of the the data.

However, I recommend to stop using the Neerslag Card - as this requires a lot of manual setup - and migrate to the Neerslag App. It is now available in HACS.

If you are using the Neerslag Card with the custom sensor and are using the provided template. Then it will display the timestamp of when the sensor was last updated. This is helpful when debugging. Because of this, each sensor update with data will get stored in Home Assistant history logs. If you don’t want this, then there is an option to make the state static, but setting a fixed value.

I thought, I’d add my question to the this thread, so it’s all under the same header…
I installed the Neerslag app via HACS. It then showed up under Configuration → Integrations and I added my co-ordinates.
However, when I wanted to add the Neerslag Card to Lovelace, I was not able to find it in the list. Did I miss a step?
Note:
On the filesystem, I see neerslag-card.js under homeassistant/custom_components/neerslag/hoe-assistant-neerslag-card
Any pointers ?
thanks,
chrisV

Sounds like you followed the installation instructions correctly, with a minor note: you might want to restart your Home Assistant after installing the integration and refreshing your browser cache. That should do the trick.

Edit: I opened a dedicated topic for the Neerslag App:

1 Like

Thank you so much for this great App @aex351 !
It is a very useful addition to HA
I had to clear the browser-cache ! (thank you to @_Mitch07 for pointing this out)
You may consider adding this in the Readme ( :wink: )
Another note regarding the Readme in the git repo:
Not having used HACS that much (yet), it took me quite a while to figure out what I had to do at this step:
Add the Neerslag App as an Integration in Home Assistant (config/integration);
I was looking at subdirectories in the file system. It turned out, I just had to go to “Configurations” → “Integrations” → “Add Integration” → and find the HACS integration here (!). I know, it is not easy to write fool-proof documentation for dummies like myself.
Thank you again for this great app
ChrisV

Huh? Now I’m confused. I’m talking about these values:
image
image

With the Neerslag App, the state value is a random number. For every sensor update a new random number will be generated.

Mmm, too bad. I’m looking for a way to determine whether either buienradar or buienalarm will forecast rain the coming 2 hours. I want to use that as a switch for a conditional rain card. So only show the rain card when rain is expected.

Currently I use the buienradar weather integration for that, but it is not always in line with buienalarm, so not always showing the graph while buienalarm still forecasts rain.

For the Neerslag Card you will need to create your own custom sensors for that, as this is just purely a front-end card with custom sensors.

However, for the Neerslag App it would be a nice enhancement. As it would be handy to have an indicators like ‘it is raining now’ or ‘in x minutes it will rain’ etc. or as part of some automation.

I quite often get the following warnings/error:

2021-08-30 14:29:33 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.neerslag_buienradar_regen_data is taking over 10 seconds
2021-08-30 14:29:38 ERROR (SyncWorker_6) [homeassistant.components.command_line] Timeout for command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat=52.8&lon=6.09&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}';    print(data);"
2021-08-30 14:29:38 WARNING (SyncWorker_6) [homeassistant.components.command_line.sensor] Empty reply found when expecting JSON data

Sometimes a reboot of home assistant fixes the issue for a while. But it always returns after some time. Is there something wrong in my buienradar sensor?

  - platform: command_line
    command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat={{state_attr("zone.home", "latitude") | round(2)}}&lon={{state_attr("zone.home", "longitude") | round(2)}}&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

or do I need to do something else to fix it?

No, there is nothing wrong with your custom sensor configuration. The problem occurs when the Buienradar service becomes unavailable or takes too long to answer - I too have experienced this. This produces the error message you are seeing in the Home Assistant logs. You can ignore the error message and restarting Home Assistant is not needed. The Neerslag Card and your custom sensor is working fine.

I can advice you to migrate to the Neerslag App. The Neerslag App handles these timeout errors internally, so they won’t be displayed in the logs.

I’m looking for exactly the same functionality as @spudje. I love the card but only want to show it if there is actually rain forecasted the upcoming 2 hours. Because now I’m constantly looking at a flat line. ‘it is raining now’ or ‘in x minutes it will rain’ could be used in a conditional card then I guess. Are you going to implement this or should be still request it?

@X1pheR, for the Neerslag App it is on the todo list. The idea is to provide additional sensors. This will allow for usage in automations.

The Neerslag Card is purely a front-end. While I could create something to visualize the information - be it extending the original Neerslag Card or add an additional Card - it wouldn’t be useable in automations.

Therefor I’m aiming towards adding additional sensors in the Neerslag App. I still need to define the specifications for these sensors. Because just saying it will rain in 10 minutes, actually doesn’t say much. The intensity and duration for example also plays a part.

2 Likes

Sounds great! :+1:
Very useful for my sunshade automation.

Cool, there’s use for both I assume.

  • Just a boolean/switch saying it will or will not rain in the coming (configurable) x minutes (2 hours would be my choice).
  • Details like intensity & duration (which I will not use)

For an initial start. A simply sensor sensor indicating rain has been detected for the upcoming period would be good.

However, to make this usable for automation it will need to be more detailed. Hence my point regarding the duration and intensity. Because 0,01 mm/h rain for a period of 5 minutes would be completly different compared to 5 mm/h rain for a period of 30 minutes.

@aex351 excellent! can’t wait for it. hope you make it configurable by specifying or which period you want to check. I would set this at 2 hours. since the lovelace card shows (or gets the data set) for the upcoming 2 hours. this way that would be my conditional lovelace trigger to show the neerslag card or a card stating no rain forecasted :wink:

Hi aex351,

After many unsuccessful attempts, I now get data if I use the default co-ords, when the integration is installed. But anytime I try to use Irish co-ords I return to the situation already mentioned above - I always reboot HA & clear cache after every change / test I’ve tried.
Can you share the co-ords that you used when testing, so that I can try those?

thanks in advance,