Add config flow to dwd_weather_warnings (#26914)

This commit is contained in:
andarotajo 2023-05-07 18:26:31 +02:00 committed by GitHub
parent 7957140382
commit dae9701581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,9 @@
--- ---
title: Deutscher Wetterdienst (DWD) Weather Warnings title: Deutscher Wetterdienst (DWD) Weather Warnings
description: Instructions on how to integrate Deutsche Wetter Dienst weather warnings into Home Assistant. description: Instructions on how to integrate Deutscher Wetterdienst weather warnings into Home Assistant.
ha_category: ha_category:
- Weather - Weather
ha_config_flow: true
ha_release: 0.51 ha_release: 0.51
ha_iot_class: Cloud Polling ha_iot_class: Cloud Polling
ha_domain: dwd_weather_warnings ha_domain: dwd_weather_warnings
@ -10,76 +11,39 @@ ha_codeowners:
- '@runningman84' - '@runningman84'
- '@stephan192' - '@stephan192'
- '@Hummel95' - '@Hummel95'
- '@andarotajo'
ha_platforms: ha_platforms:
- sensor - sensor
ha_integration_type: integration ha_integration_type: integration
--- ---
The `dwd_weather_warnings` sensor platform uses the [Deutsche Wetter Dienst (DWD)](https://www.dwd.de) as a source for current and advance warnings. The Deutscher Wetterdienst Weather Warnings integration uses the [Deutscher Wetterdienst (DWD)](https://www.dwd.de) as a source for current and advance weather warnings. The configured sensor checks for data every 15 minutes.
- A name is optional but if multiple regions are used a name will be required. {% include integrations/config_flow.md %}
- The sensor checks for new data every 15 minutes.
## Configuration {% configuration_basic %}
Warncell ID or name:
To add the DWD WarnApp sensor to your installation, add the following to your `configuration.yaml` file: description: 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](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/cap_warncellids_csv.html). Some of the warncells are outdated but still listed. If the setup fails, search the list for a similar sounding warncell. If the warncell name is not unique, `" (not unique used ID)!"` will be added to the reported `region_name`. Setting this field is required.
{% endconfiguration_basic %}
```yaml
# Example configuration.yaml entry
sensor:
- platform: dwd_weather_warnings
region_name: Hansestadt Hamburg
```
<div class="note">
- The `region_name` can either be a so called `warncell id` (integer) or a `warncell name` (string). It is heavily advised to use `warncell id` because `warncell name` is not unique in some cases.
A list of valid warncell ids and names can be found at [here](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/cap_warncellids_csv.html).
- Some of the warncells are outdated but still listed. If setup fails search the list for a similar sounding warncell.
- If you selected a `warncell name` and the name is not unique `" (not unique used ID)!"` will be added to the reported `region_name`.
</div>
{% configuration %}
region_name:
required: true
description: The region name = warncell name (string) or region id = warncell id (integer) taken from DWD homepage.
type: [string, integer]
name:
required: false
description: The name you would like to give to the warnapp sensor.
type: string
default: DWD-Weather-Warnings
monitored_conditions:
description: List of warnings you want to be informed about.
required: false
default: all
type: list
keys:
current_warning_level:
description: The current warning level.
advance_warning_level:
description: The expected warning level.
{% endconfiguration %}
### Attributes ### Attributes
| Attribute | Description | | Attribute | Description |
| ------------ | -------------------------------------- | | ------------ | -------------------------------------- |
| `last_update` | *(time)* Time and date (UTC) of last update from DWD. | | `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_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. | | `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_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>` | *(list)* The warning as a whole object containing the following attributes as nested attributes. |
| `warning_<x>_level` | *(int)* Issued warning level (0 - 4).<br/>0: Keine Warnungen <br/>1: Wetterwarnungen <br/>2: Warnungen vor markantem Wetter<br/>3: Unwetterwarnungen<br/>4: Warnungen vor extremem Unwetter | | `warning_<x>_level` | *(int)* Issued warning level (0 - 4).<br/>0: Keine Warnungen <br/>1: Wetterwarnungen <br/>2: Warnungen vor markantem Wetter<br/>3: Unwetterwarnungen<br/>4: Warnungen vor extremem Unwetter |
| `warning_<x>_type` | *(int)* Issued warning type. <br/>More information can be found [here](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/warning_codes_pdf.pdf?__blob=publicationFile&v=5). | | `warning_<x>_type` | *(int)* Issued warning type. More information can be found [here](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/warning_codes_pdf.pdf?__blob=publicationFile&v=5). |
| `warning_<x>_name` | *(str)* Warning name correlates with the warning type and represents it as a short string. | | `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>_headline` | *(str)* Official headline of the weather warning. |
| `warning_<x>_start` | *(time)* Starting time and date (UTC) of the issued 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>_end` | *(time)* Ending time and date (UTC) of the issued warning. |
| `warning_<x>_description` | *(str)* Details for 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>_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. <br/>More information can be found [here](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/warning_codes_pdf.pdf?__blob=publicationFile&v=5). | | `warning_<x>_parameters` | *(list)* A list of additional warning parameters. More information can be found [here](https://www.dwd.de/DE/leistungen/opendata/help/warnungen/warning_codes_pdf.pdf?__blob=publicationFile&v=5). |
| `warning_<x>_color` | *(str)* The DWD color of the warning encoded as `#rrggbb`. | | `warning_<x>_color` | *(str)* The DWD color of the warning encoded as `#rrggbb`. |
<div class="note"> <div class="note">