there is an awesome weather information integration by the German Weather Service, DWD (Deutscher Wetterdienst (DWD) Weather Warnings - Home Assistant). Unfortunately, they are saving all information inside a single entity’s attribute. It looks like this:
or even more specifically you might be able to use the entity attributes card:
But I generally do the same thing with my NWS alerts integration (adding all the info as attributes) so you could look at the examples I use to extract the data and display it on a Lovelace page. Of course you’ll need to just use it as a framework tho and change it to meet your needs.
I had the same problem with the BOM Australia Intergration.
See this link and it will give you the answers.
Using Brisbane as the location as it currently has 2 flood alerts…
`response_timestamp: 2022-05-18T00:11:45Z
copyright: This Application Programming Interface (API) is owned by the Bureau of Meteorology (Bureau). You must not use, copy or share this API without express permission from the Bureau. Please contact us for more information. Follow this link http://www.bom.gov.au/inside/contacts.shtml to view our contact details.
attribution: Data provided by the Australian Bureau of Meteorology
warnings:
id: QLD_RC097_IDQ20805
type: flood_warning
title: Flood Warning for Brisbane River downstream of Wivenhoe Dam
short_title: Flood Warning
state: QLD
warning_group_type: major
issue_time: ‘2022-05-17T22:51:08Z’
expiry_time: ‘2022-05-19T01:51:08Z’
phase: renewal
id: QLD_RC099_IDQ20815
type: flood_warning
title: Flood Warning for Logan River downstream of Yarrahappini
short_title: Flood Warning
state: QLD
warning_group_type: major
issue_time: ‘2022-05-16T23:49:51Z’
expiry_time: ‘2022-05-18T02:49:51Z’
phase: final
friendly_name: Brisbane Warnings`
This will list all warnings…
{%- for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
{{state.phase | upper}} - {{ state.title}}
{% endfor %}
RENEWAL - Flood Warning for Brisbane River downstream of Wivenhoe Dam
FINAL - Flood Warning for Logan River downstream of Yarrahappini
This will list only those that match a particular string in the title in this case. I have chosen “Brisbane” to distinguish the two, but you could search instead for “Thunderstorm” or choose another attribute to match by e.g. warning_group_type.
{% for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
{%- if 'Brisbane' in state.title %}
{{state.phase | upper}} - {{ state.title}}
{%- endif -%}
{%- endfor -%}
RENEWAL - Flood Warning for Brisbane River downstream of Wivenhoe Dam
Below is a Template Sensor. It shows “No Warning” if there is no matching warnings, & lists the warnings if they match. This one checks for a match of “Thunderstorm” in the title. Make sure you fix the indenting.
sensor:
name: Brisbane_Thunderstorm_Warning
state: >
{%- set ns = namespace(result=[]) -%}
{% for state in state_attr('sensor.brisbane_warnings', 'warnings') -%}
{%- if 'Thunderstorm' in state.title %}
{% set ns.result = ns.result + [state.title + "\n"] %}
{%- endif -%}
{%- endfor -%}
{% if ns.result|count == 0 %}
{{"No Warnings"}}
{% else %}
{{ ns.result | list | join() }}
{% endif %}
The below gives me a sensor for the weather warning phase output in words. ‘new’ NEW and RENEWAL, ‘update’ UPDATE, ‘downgrade’ DOWNGRADE, ‘final’ FINAL, ‘cancelled’ CANCELLED
- platform: template
sensors:
weather_warning_phase:
entity_id: sensor.devonport_warnings
friendly_name: "Weather Warning Phase"
value_template: >-
{%- for state in state_attr('sensor.devonport_warnings', 'warnings') -%}
{%- if 'new' in state.phase %}
{{state.phase | upper}}
{%- elif 'update' in state.phase %}
{{state.phase | upper}}
{%- elif 'downgrade' in state.phase %}
{{state.phase | upper}}
{%- elif 'final' in state.phase %}
{{state.phase | upper}}
{%- elif 'cancelled' in state.phase %}
{{state.phase | upper}}
{%- endif -%}
{%- endfor -%}