Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
content: >-
{% set level_colors = ["#c5e566", "#ffeb3b", "#fb8c00", "#e53935", "#880e4f"]
%} {% set current_count = state_attr("sensor.dwd_leer_current_warning_level",
"warning_count") %} {% set advance_count =
state_attr("sensor.dwd_leer_advance_warning_level", "warning_count") %} {% if
((current_count == 0) and (advance_count == 0)) %} **<font color={{
level_colors[0] }}>Keine Warnungen</font>** {% else %}
{% for i in range(current_count) %}
{% set headline = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_headline") %}
{% set description = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_description") %}
{% set instruction = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
{% set level = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_level") %}
{% set time_start = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_start") %}
{% set time_end = state_attr("sensor.dwd_leer_current_warning_level", "warning_" ~ loop.index ~ "_end") %}
**<font color={{ level_colors[level] }}>{{ headline }}</font>**
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
*{{ description }}*
*{{ instruction }}*
{% if not loop.last %}***{% endif %}
{% endfor %}
{% if ((current_count != 0) and (advance_count != 0)) %}***{% endif %}
{% for i in range(advance_count) %}
{% set headline = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_headline") %}
{% set description = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_description") %}
{% set instruction = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
{% set level = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_level") %}
{% set time_start = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_start") %}
{% set time_end = state_attr("sensor.dwd_leer_advance_warning_level", "warning_" ~ loop.index ~ "_end") %}
**<font color={{ level_colors[level] }}>{{ headline }}</font>**
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
*{{ description }}*
*{{ instruction }}*
{% if not loop.last %}***{% endif %}
{% endfor %}
{% endif %}
type: markdown
title: DWD Wetterwarnungen
# Example Uhrzeit und Wettwerwarnungen DWD
sensor:
- platform: dwd_weather_warnings
region_name: DEINEREGION
type: conditional
conditions:
- entity: sensor.dwd_warnungen_current_warning_level
state_not: '0'
card:
type: vertical-stack
cards:
- type: picture-glance
entities: []
camera_image: camera.dwd_wetterwarnungen
tap_action:
action: more-info
hold_action:
action: none
- type: markdown
content: >-
{% set level_colors = {0:'#c5e566', 1:'#ffeb3b', 2:'#fb8c00',
3:'#e53935', 4:'#880e4f', 20:'#fe68fe', 50:'#fe68fe', 51:'#9e46f8'} %}
{% set current_count =
state_attr("sensor.dwd_Warnungen_current_warning_level",
"warning_count") %} {% set advance_count =
state_attr("sensor.dwd_warnungen_advance_warning_level",
"warning_count") %} {% if ((current_count == 0) and (advance_count ==
0)) %} **<font color={{ level_colors[0] }}>Keine Warnungen</font>** {%
else %}
{% for i in range(current_count) %}
{% set headline = state_attr("sensor.dwd_warnungen_current_warning_level", "warning_" ~ loop.index ~ "_headline") %}
{% set description = state_attr("sensor.dwd_warnungen_current_warning_level", "warning_" ~ loop.index ~ "_description") %}
{% set level = state_attr("sensor.dwd_warnungen_current_warning_level", "warning_" ~ loop.index ~ "_level") %}
{% set time_start = state_attr("sensor.dwd_warnungen_current_warning_level", "warning_" ~ loop.index ~ "_start") %}
{% set time_end = state_attr("sensor.dwd_warnungen_current_warning_level", "warning_" ~ loop.index ~ "_end") %}
**<font color={{ level_colors[level] if level_colors[level] is defined else level_colors[1] }}>{{ headline }}</font>**
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
*{{ description|trim }}*
{% if not loop.last %}***{% endif %}
{% endfor %}
{% if ((current_count != 0) and (advance_count != 0)) %}***{% endif %}
{% for i in range(advance_count) %}
{% set headline = state_attr("sensor.dwd_warnungen_advance_warning_level", "warning_" ~ loop.index ~ "_headline") %}
{% set description = state_attr("sensor.dwd_warnungen_advance_warning_level", "warning_" ~ loop.index ~ "_description") %}
{% set level = state_attr("sensor.dwd_warnungen_advance_warning_level", "warning_" ~ loop.index ~ "_level") %}
{% set time_start = state_attr("sensor.dwd_warnungen_advance_warning_level", "warning_" ~ loop.index ~ "_start") %}
{% set time_end = state_attr("sensor.dwd_warnungen_advance_warning_level", "warning_" ~ loop.index ~ "_end") %}
**<font color={{ level_colors[level] }}>{{ headline }}</font>**
{{ time_start.strftime("%a %H:%M") ~ " - " ~ time_end.strftime("%a %H:%M") }}
*{{ description }}*
{% if not loop.last %}***{% endif %}
{% endfor %}
{% endif %}
title: Wetterwarnungen
#Zivile Dämmerung
sensor:
- platform: template
sensors:
dusky:
value_template: >-
{% if (state_attr('sun.sun', 'elevation') < -3) %}
{{ true }}
{% else %}
{{ false }}
{% endif %}
#Sonnenaufgang & Sonnenuntergang
- platform: template
sensors:
nextsunrise:
entity_id: sun.sun
friendly_name: 'Next Sunrise'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sun.sun
friendly_name: 'Next Sunset'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-down
YAML:
# Example Uhrzeit und Wettwerwarnungen DWD
sensor:
- platform: dwd_weather_warnings
region_name: DEINEREGION
sensor:
darf nicht doppelt gelistet sein. Schau mal ob es funktioniert, wenn Du nur - platform: dwd_weather_warnings
region_name: DEINEREGION
type: entity
entity: sensor.dwd_weather_warnings_advance_warning_level
type: entity
entity: sensor.dwd_weather_warnings_current_warning_level