Buienalarm custom_component

Many thanks Giel!
I just want to correct myself as for the average I forgot to multiply by 60 minutes. The correct definition is:
precipitation_forecast_average: The total mentioned above divided by 15 minutes (therefore shown in mm/h) multiplied by 60 minutes.

These are the definitions I created for myself:
- temperature #what is the temperature right now
- precipitation #How hard it is raining right now (shown in mm/h). This is not affected by timeframe.
- precipitation_forecast_average #How much it will rain in total between right now and selected timeframe (in mm).
- precipitation_forecast_total #The total mentioned above divided by timeframe and multiplied by 60 minutes (therefore shown in mm/h)
- next_rain_forecast #-1 means no rain forecast within timeframe, 0 means it is currently raining, N means rain is forecast within N minutes. Impact of timeframe: if you set timeframe to 15 and it will rain in 16 minutes, the value will be -1 and then become 15 one minute later.

is there a way to get the times in the further? as the timing now doesn’t make sense…

exactly this. I’m looking for a graph which can display the upcoming rain, like the android app does.

e.g.:

tried several thins, but i don’t want the iframe work-around…

See here: Custom UI: Buienradar rain forecast graph
Best to use Spudjes updated version, down in the thread.

I have just installed this component a few days ago and noticed something odd.

It almost seems like the next_rain_forecast is always showing a value of “2021 min.” when rain is forecasted and it shows “Unknown” when there is no rain.

Has anyone seen this before? Any thoughts?

1 Like

Same here i reverted back to version 1.6

I am getting a lot of Bad Gateway errors in the log. Anyone else getting this?

Logger: custom_components.buienalarm
Source: helpers/update_coordinator.py:200
Integration: buienalarm (documentation)
First occurred: July 31, 2021, 13:18:10 (113 occurrences)
Last logged: 08:23:23

Same problem here, uninstall for now It makes HA very slow

Is there a solution on how @JJFourie did the bottom part of his setup with the picture element?

Hi I`m really new with this. I have installed buienalarm via ssh and the custom component via hacs. I also added the sensor template in configuration.yaml however am getting an error on restart:

ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{% if as_timestamp(states('sensor.buienalarm_next_rain_forecast')) %}
  {{ ( ( as_timestamp(states('sensor.buienalarm_next_rain_forecast')) - as_timestamp(now()) ) / 60 ) | round }}
{% else %}
  {{ states('nonexistent') }}
{% endif %}' but no default was specified

No clue what I did wrong.

@Culemsao
In my configuration.yaml file I have an entry

template: !include templates.yaml

In that templates.yaml file I’ve created the following:

- sensor:
    - name: "Buienalarm Next rain forecast (min)"
      unique_id: buienalarm_next_rain_forecast
      device_class: duration
      unit_of_measurement: m
      state: >
        {% if states('sensor.buienalarm_next_rain_forecast')=="unknown" %}
          {{ 0.0 }}
        {% else %}
          {{((as_timestamp(states('sensor.buienalarm_next_rain_forecast'))-as_timestamp(now()))/60)|round(2)}}
        {% endif %}
      icon: >
        {% if states('sensor.buienalarm_next_rain_forecast')=='unknown' %}
        mdi:weather-cloudy
        {% else %}
        mdi:weather-rainy
        {% endif %}

If your configuration.yaml entry is like “template:” then you create the sensor under that “branch” like such:

template:
  - sensor:
      - name: "Buienalarm Next rain forecast (min)"
        unique_id: buienalarm_next_rain_forecast
        device_class: duration
        unit_of_measurement: m
        state: >
          {% if states('sensor.buienalarm_next_rain_forecast')=="unknown" %}
            {{ 0.0 }}
          {% else %}
            {{((as_timestamp(states('sensor.buienalarm_next_rain_forecast'))-as_timestamp(now()))/60)|round(2)}}
          {% endif %}
        icon: >
          {% if states('sensor.buienalarm_next_rain_forecast')=='unknown' %}
          mdi:weather-cloudy
          {% else %}
          mdi:weather-rainy
          {% endif %}

Hi all,

I’m also really new to Home Assistant. But I’d really like the integration of Buienalarm. Anybody created a good automation on this sensor to check if it will go rain? I don’t want to be disturbed via messages (notify service) every minute of course when it will start raining :slight_smile:

Hopefully somebody has a good idea or has something implemented already.

Regards,
Pieter