Deutscher Wetterdienst (DWD) Weather Warnings
The Deutscher Wetterdienst Weather Warnings integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] uses the Deutscher Wetterdienst (DWD)
Configuration
To add the Deutscher Wetterdienst (DWD) Weather Warnings service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Deutscher Wetterdienst (DWD) Weather Warnings.
-
Follow the instructions on screen to complete the setup.
Identifier of the region. It can be a warncell ID (integer) or a warncell name. It is heavily advised to use warncell ID because a warncell name is sometimes not unique. A list of valid warncell IDs and names can be found here" (not unique used ID)!" will be added to the reported region_name.
Attributes
| Attribute | Description |
|---|---|
last_update |
(time) Time and date (UTC) of last update from DWD. |
region_name |
(str) Requested region name. This should be the same as the region name in the configuration, if a name was given. |
region_id |
(int) Region ID assigned by DWD. This should be the same as the region id in the configuration, if an id was given. |
warning_count |
(int) Number of issued warnings. There can be more than one warning issued at once. |
warning_<x> |
(list) The warning as a whole object containing the following attributes as nested attributes. |
warning_<x>_level |
(int) Issued warning level (0 - 4). 0: Keine Warnungen 1: Wetterwarnungen 2: Warnungen vor markantem Wetter 3: Unwetterwarnungen 4: Warnungen vor extremem Unwetter |
warning_<x>_type |
(int) Issued warning type. More information can be found here |
warning_<x>_name |
(str) Warning name correlated with the warning type and represented as a short string. |
warning_<x>_headline |
(str) Official headline of the weather warning. |
warning_<x>_start |
(time) Starting time and date (UTC) of the issued warning. |
warning_<x>_end |
(time) Ending time and date (UTC) of the issued warning. |
warning_<x>_description |
(str) Details for the issued warning. |
warning_<x>_instruction |
(str) The DWD sometimes provides helpful information about precautions to take for the issued warning. |
warning_<x>_parameters |
(list) A list of additional warning parameters. More information can be found here |
warning_<x>_color |
(str) The DWD color of the warning encoded as #rrggbb. |
In the attribute name x is the counter of the warning starting from 1.
Some example automations
The following example reads out the headline and its description of the DWD warnings above 2 to your local media player.
alias: DWD-Warning at level 3
description: DWD-Warnings at level 3
triggers:
- entity_id: sensor.<your_city>_current_warning_level
above: 2
trigger: numeric_state
conditions:
- condition: state
entity_id: sensor.<your_city>_current_warning_level
state: "3"
- condition: time
after: "06:20:00"
- condition: time
before: "22:00:00"
actions:
- data:
volume_level: 0.14
target:
device_id: <your_device_id>
action: media_player.volume_set
- target:
entity_id: media_player.<your_mediaplayer>
data:
message: >
Warning! There are {{
state_attr('sensor.<your_city>_current_warning_level',
'warning_count') }} weather-warnings from DWD.· {%
for i in range(0,
(state_attr('sensor.<your_city>_current_warning_level',
'warning_count')|int) + 1 | int ) %}
{% set headline = state_attr('sensor.<your_city>_current_warning_level', 'warning_' ~ i ~ '_headline') %}
{% set description = state_attr('sensor.<your_city>_current_warning_level', 'warning_' ~ i ~ '_description') %}
{% set instruction = state_attr('sensor.stadt_osnabruck_current_warning_level', 'warning_' ~ i ~ '_instruction') %}
{% if headline and description %}
Warning {{ i }}:
{% if headline %} {{ headline }} {% endif %}
{% if description %} {{ description }} {% endif %}
{% if instruction %} {{ instruction }} {% endif %}
{% endif %}
{% endfor %}
action: tts.google_translate_say
enabled: true
mode: single
Substitute <your_city>, your <your_device_id> and <your_mediaplayer> with your entity-names.