Rain forecast on dashboard #194
Replies: 14 comments
|
You can do this with this integration via the weather or precipitation sensor and a template sensor where you describe your logic. |
|
Any tips how to do it? :) |
|
Yes ;-) The following code interpolates the temperature forecast from the hourly temperature sensor: template:
- name: weather_forecast_temperature_interpolated
state_class: measurement
unit_of_measurement: "°C"
state: >
{% set temperature = state_attr('sensor.temperature_wiesbaden_biebrich_1h', 'data') %}
{% set t = now() %}
{% set index = ((as_timestamp(t) - as_timestamp(temperature[0]['datetime'])) // 3600) | int %}
{% if index < 0 %}
{% set result = temperature[0]['value'] %}
{% else %}
{% set result = temperature[index]['value'] + (temperature[index+1]['value'] - temperature[index]['value']) * t.minute / 60 %}
{% endif %}
{{ result | round(1) }}
device_class: temperatureI hope you get the idea. You should study the Home Assistant template documentation, and then it should be straightforward to write your own template. The hourly temperature: 24.4
humidity: 56
pressure: 1007.4
wind_bearing: 233
wind_speed: 14.8
visibility: 28.9
forecast:
- datetime: '2022-06-24T00:00:00Z'
condition: lightning-rainy
temperature: 24
templow: 18
precipitation: 2.7
wind_bearing: 245.57
wind_speed: 4.12
wind_gusts: 8.75
precipitation_probability: 51
- datetime: '2022-06-25T00:00:00Z'
condition: sunny
temperature: 27
templow: 15
precipitation: 0
wind_bearing: 198.46
wind_speed: 3.09
wind_gusts: 6.17
precipitation_probability: 13
[...]A possible (imperative) strategy would be to
With advanced filters (like Python's I could write the solution up, but you have to know what you want and you'll have to maintain it – "Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime." |
|
Thank you for explanation. I get the idea. Let's see if I will have some time to play around with it. |
|
Maybe it's easier if this is implemented directly within the integration. There's more flexibility with python. I cannot promise if I find time (and delight) the next days. |
Hi, any news on this topic? Have you found some time to implement this? I think it would be super usefull and easier directly in python. |
|
I think I found a solution. |
|
@FL550 i have also a question to the forecast? |
|
alterative solution might be this: https://morgenwirdes.de/api/index.php |
|
I am relying on my custom code that is based on Openweathermap, and it is working great and very accurate. Solution from Morgenwirdes is nor reliable and API is not providing allot of data. |
|
@duczz Please see https://github.com/FL550/dwd_weather/wiki#how-to-add-a-weather-chart |
|
There is now a radar based option available for this in 4.0.0 |

Uh oh!
There was an error while loading. Please reload this page.
Hi, I would like to display on my dashboard when the next rain will start, what is the level (low, medium, strong) and when it will end.
Is it possible with this integration? I saw there are precipitation sensors that one can play with, but didn't found any example of YML code that I can reuse.
something like this:
Strong precipitation possible around 08:25 will end around 11:30.
Basically, I just want to know when the next rain will start and how long it will rain. If it is not that day maybe to display next date when the rain is forecasted.
All reactions