Giter VIP home page Giter VIP logo

Comments (6)

FL550 avatar FL550 commented on July 21, 2024

This sounds like a nice idea. The precipitation forecast right now is, as you have already mentioned, only based on the mosmix model. So including the radar would be a nice add-on.

The reference implementation helps a lot, but right now I don't have much time to include this timely. Can you maybe assist with this?

from dwd_weather.

swa72 avatar swa72 commented on July 21, 2024

You may want to check out https://www.ajfriesen.com/rain-warning-sensor-with-home-assistant/

from dwd_weather.

alanmilinovic avatar alanmilinovic commented on July 21, 2024

You may want to check out https://www.ajfriesen.com/rain-warning-sensor-with-home-assistant/

This service (https://morgenwirdes.de) is not reliable and has a lot of incorrect information. I built my own radar based on OpenWeatherMap that can be used anywhere in the world. For germany it is also very accurate and I love it.

To get an idea, check this out.
https://community.home-assistant.io/t/morning-weather-notification-with-daily-high-temperature/385504/24

from dwd_weather.

diplix avatar diplix commented on July 21, 2024

actually i found morgenwirdes.de to delivery very good rain warnings from DWDs radolan (radar) rain data. from the data i can draw a bar chart with expected rain amounts over the next 2 hours, with datapoints every 5 minutes. however every now and then the morgenwirdes.de server returns no values or an error.

i found this library https://github.com/dimitri-rebrikov/dwd_utils which can fetch the radolan data directly from DWD. you can run the script https://github.com/dimitri-rebrikov/dwd_utils/blob/main/radolan.py directly from the command line and it gets radolan data over the next 2 hours for a (german) PLZ. usage seems to consume quite some CPU cycles but if you call it only every 5 minutes thats not to bad.
i changed the code a bit so it outputs a json string that i can read with a command line sensor.

with the json data a can build my bar chart or, as an example, a spark line graph. this is an example to test the radolan data in the HA template editor:

{% set data = {"timestamp": "2023-05-09T23:50:00.000Z", "forecasts": [{"forecast": "000", "value": 0.24, "timestamp": "2023-05-09T23:50:00.000000Z"}, {"forecast": "005", "value": 0.12, "timestamp": "2023-05-09T23:55:00.000000Z"}, {"forecast": "010", "value": 0.12, "timestamp": "2023-05-10T00:00:00.000000Z"}, {"forecast": "015", "value": 0.0, "timestamp": "2023-05-10T00:05:00.000000Z"}, {"forecast": "020", "value": 0.0, "timestamp": "2023-05-10T00:10:00.000000Z"}, {"forecast": "025", "value": 0.12, "timestamp": "2023-05-10T00:15:00.000000Z"}, {"forecast": "030", "value": 0.12, "timestamp": "2023-05-10T00:20:00.000000Z"}, {"forecast": "035", "value": 0.12, "timestamp": "2023-05-10T00:25:00.000000Z"}, {"forecast": "040", "value": 0.24, "timestamp": "2023-05-10T00:30:00.000000Z"}, {"forecast": "045", "value": 0.24, "timestamp": "2023-05-10T00:35:00.000000Z"}, {"forecast": "050", "value": 0.0, "timestamp": "2023-05-10T00:40:00.000000Z"}, {"forecast": "055", "value": 0.12, "timestamp": "2023-05-10T00:45:00.000000Z"}, {"forecast": "060", "value": 0.0, "timestamp": "2023-05-10T00:50:00.000000Z"}, {"forecast": "065", "value": 0.0, "timestamp": "2023-05-10T00:55:00.000000Z"}, {"forecast": "070", "value": 0.12, "timestamp": "2023-05-10T01:00:00.000000Z"}, {"forecast": "075", "value": 0.24, "timestamp": "2023-05-10T01:05:00.000000Z"}, {"forecast": "080", "value": 0.24, "timestamp": "2023-05-10T01:10:00.000000Z"}, {"forecast": "085", "value": 0.12, "timestamp": "2023-05-10T01:15:00.000000Z"}, {"forecast": "090", "value": 0.0, "timestamp": "2023-05-10T01:20:00.000000Z"}, {"forecast": "095", "value": 0.0, "timestamp": "2023-05-10T01:25:00.000000Z"}, {"forecast": "100", "value": 0.0, "timestamp": "2023-05-10T01:30:00.000000Z"}, {"forecast": "105", "value": 0.0, "timestamp": "2023-05-10T01:35:00.000000Z"}, {"forecast": "110", "value": 0.0, "timestamp": "2023-05-10T01:40:00.000000Z"}, {"forecast": "115", "value": 0.0, "timestamp": "2023-05-10T01:45:00.000000Z"}, {"forecast": "120", "value": 0.0, "timestamp": "2023-05-10T01:50:00.000000Z"}]} %}

dwd: 

{%- for fiveminutes in data.forecasts %}
{%- if loop.index > 24 %}{{""}}
{%- else %}
{%- set rainintensity = fiveminutes.value %}
{%- if rainintensity < 0.1 %}{{"▁"}}
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}}
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}}
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}}
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}}
{%- elif 2 <= rainintensity < 3.5 %}{{"▆"}}
{%- elif 3.5 <= rainintensity < 5 %}{{"▇"}}
{%- elif 5 <= rainintensity < 10 %}{{"█"}}
{%- else %}{{"▓"}}
{%- endif %}
{%- endif %}
{%- endfor %}

dwd → 8: 
{%- set raindata = namespace(list=[]) -%}
{%- for n in data.forecasts -%}
{%- set raindata.list = raindata.list + [n.value] %}
{%- endfor -%}
{%- for fiveminutes in raindata.list|batch(3) %}


{%- if loop.index > 8 %}{{""}}
{%- else %}
{%- set rainintensity = fiveminutes|max|float %}
{%- if rainintensity < 0.1 %}{{"▁"}}
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}}
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}}
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}}
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}}
{%- elif 2 <= rainintensity < 3.5 %}{{"▆"}}
{%- elif 3.5 <= rainintensity < 5 %}{{"▇"}}
{%- elif 5 <= rainintensity < 10 %}{{"█"}}
{%- else %}{{"▓"}}
{%- endif %}
{%- endif %}
{%- endfor %}
image

i guess adding the dwd_utils library to get radolan data into this custom component shouldn’t be too hard, though my coding skills are really limited and i wouldn’t be of much help. however, if anyone is interested i can share the code of the command line sensor stuff i built so far (and which i am still testing).

from dwd_weather.

alanmilinovic avatar alanmilinovic commented on July 21, 2024

actually i found morgenwirdes.de to delivery very good rain warnings from DWDs radolan (radar) rain data. from the data i can draw a bar chart with expected rain amounts over the next 2 hours, with datapoints every 5 minutes. however every now and then the morgenwirdes.de server returns no values or an error.

i found this library https://github.com/dimitri-rebrikov/dwd_utils which can fetch the radolan data directly from DWD. you can run the script https://github.com/dimitri-rebrikov/dwd_utils/blob/main/radolan.py directly from the command line and it gets radolan data over the next 2 hours for a (german) PLZ. usage seems to consume quite some CPU cycles but if you call it only every 5 minutes thats not to bad. i changed the code a bit so it outputs a json string that i can read with a command line sensor.

with the json data a can build my bar chart or, as an example, a spark line graph. this is an example to test the radolan data in the HA template editor:

{% set data = {"timestamp": "2023-05-09T23:50:00.000Z", "forecasts": [{"forecast": "000", "value": 0.24, "timestamp": "2023-05-09T23:50:00.000000Z"}, {"forecast": "005", "value": 0.12, "timestamp": "2023-05-09T23:55:00.000000Z"}, {"forecast": "010", "value": 0.12, "timestamp": "2023-05-10T00:00:00.000000Z"}, {"forecast": "015", "value": 0.0, "timestamp": "2023-05-10T00:05:00.000000Z"}, {"forecast": "020", "value": 0.0, "timestamp": "2023-05-10T00:10:00.000000Z"}, {"forecast": "025", "value": 0.12, "timestamp": "2023-05-10T00:15:00.000000Z"}, {"forecast": "030", "value": 0.12, "timestamp": "2023-05-10T00:20:00.000000Z"}, {"forecast": "035", "value": 0.12, "timestamp": "2023-05-10T00:25:00.000000Z"}, {"forecast": "040", "value": 0.24, "timestamp": "2023-05-10T00:30:00.000000Z"}, {"forecast": "045", "value": 0.24, "timestamp": "2023-05-10T00:35:00.000000Z"}, {"forecast": "050", "value": 0.0, "timestamp": "2023-05-10T00:40:00.000000Z"}, {"forecast": "055", "value": 0.12, "timestamp": "2023-05-10T00:45:00.000000Z"}, {"forecast": "060", "value": 0.0, "timestamp": "2023-05-10T00:50:00.000000Z"}, {"forecast": "065", "value": 0.0, "timestamp": "2023-05-10T00:55:00.000000Z"}, {"forecast": "070", "value": 0.12, "timestamp": "2023-05-10T01:00:00.000000Z"}, {"forecast": "075", "value": 0.24, "timestamp": "2023-05-10T01:05:00.000000Z"}, {"forecast": "080", "value": 0.24, "timestamp": "2023-05-10T01:10:00.000000Z"}, {"forecast": "085", "value": 0.12, "timestamp": "2023-05-10T01:15:00.000000Z"}, {"forecast": "090", "value": 0.0, "timestamp": "2023-05-10T01:20:00.000000Z"}, {"forecast": "095", "value": 0.0, "timestamp": "2023-05-10T01:25:00.000000Z"}, {"forecast": "100", "value": 0.0, "timestamp": "2023-05-10T01:30:00.000000Z"}, {"forecast": "105", "value": 0.0, "timestamp": "2023-05-10T01:35:00.000000Z"}, {"forecast": "110", "value": 0.0, "timestamp": "2023-05-10T01:40:00.000000Z"}, {"forecast": "115", "value": 0.0, "timestamp": "2023-05-10T01:45:00.000000Z"}, {"forecast": "120", "value": 0.0, "timestamp": "2023-05-10T01:50:00.000000Z"}]} %}

dwd: 

{%- for fiveminutes in data.forecasts %}
{%- if loop.index > 24 %}{{""}}
{%- else %}
{%- set rainintensity = fiveminutes.value %}
{%- if rainintensity < 0.1 %}{{"▁"}}
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}}
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}}
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}}
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}}
{%- elif 2 <= rainintensity < 3.5 %}{{"▆"}}
{%- elif 3.5 <= rainintensity < 5 %}{{"▇"}}
{%- elif 5 <= rainintensity < 10 %}{{"█"}}
{%- else %}{{"▓"}}
{%- endif %}
{%- endif %}
{%- endfor %}

dwd → 8: 
{%- set raindata = namespace(list=[]) -%}
{%- for n in data.forecasts -%}
{%- set raindata.list = raindata.list + [n.value] %}
{%- endfor -%}
{%- for fiveminutes in raindata.list|batch(3) %}


{%- if loop.index > 8 %}{{""}}
{%- else %}
{%- set rainintensity = fiveminutes|max|float %}
{%- if rainintensity < 0.1 %}{{"▁"}}
{%- elif 0.1 <= rainintensity < 0.5 %}{{"▂"}}
{%- elif 0.5 <= rainintensity < 1 %}{{"▃"}}
{%- elif 1 <= rainintensity < 1.5 %}{{"▄"}}
{%- elif 1.5 <= rainintensity < 2 %}{{"▅"}}
{%- elif 2 <= rainintensity < 3.5 %}{{"▆"}}
{%- elif 3.5 <= rainintensity < 5 %}{{"▇"}}
{%- elif 5 <= rainintensity < 10 %}{{"█"}}
{%- else %}{{"▓"}}
{%- endif %}
{%- endif %}
{%- endfor %}
image i guess adding the `dwd_utils` library to get radolan data into this custom component shouldn’t be too hard, though my coding skills are really limited and i wouldn’t be of much help. however, if anyone is interested i can share the code of the command line sensor stuff i built so far (and which i am still testing).

I am using OpenWeatherMaps for months now and am located in Germany. Data is very accurate and similar what DWD is returning (sometimes same) so I don't see a reason why using some custom complicated and not reliable solutions.

from dwd_weather.

diplix avatar diplix commented on July 21, 2024

I am using OpenWeatherMaps for months now and am located in Germany

i know, that’s what you wrote above and it’s great if you are happy with the OWM forceasts. however the radolan/radar forecasts from DWD are very precise (24 data points for 2 hour forecast) and according to my observations very reliable, so i use the DWD radolan forecasts in addition to rain forecasts from OWM, this components DWD mosmix data and also forecasts from weatherkit.

OWM claims to also use radar data for their forecasts

We collect and process weather data from different sources such as global and local weather models, satellites, radars and a vast network of weather stations

but according to my observation the OWM forecasts lack precision and reliability (i live in berlin) this might well differ from region to region. same with the mosmix forecasts from DWD and weatherkit that seem to be purely model based and deliver more or less accurate estimates with lots of false positives.

from dwd_weather.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.