DWD WarnWetter markdown card

hi,
can i send this information via Telegram-Bot?

Yes you can. If I recall correctly you just need to send the state of the sensor in your message.

I have also tried to build a Telegram-Bot-Forwarding ā€¦ However, the bot either spams me with the slightest change or shows me too littleā€¦ which attribute do you use as a trigger? It is already a state, isnā€™t it? The warning count? Or the respective description? It works with only one warning, but with several ā€¦ I only have problems :smiley:
I would be happy about a working Telegram bot automation :slight_smile:

Hi All,

i integrated the ā€œDWD Weather Warningsā€ in my HA but i have some requirements fullfilled:

a.) i want to see when was the last update
b.) i want to monitor three regions
c.) i would like to see the ā€œnameā€ of the region
d.) when submitted from DWD, i would like to see the ā€œinstructionsā€
e.) the warning-start/-end - Time are in the original Code 1 hour back as at german time (and DWD-Time)

OK, let we do.

First my sensor-Code in the configuration.yaml

sensor:
  - platform: dwd_weather_warnings
    region_name: 805362004
    name: Warnwetter Bedburg

  - platform: dwd_weather_warnings
    region_name: 105315000
    name: Warnwetter Kƶln

  - platform: dwd_weather_warnings
    region_name: 805378004
    name: Warnwetter Bergisch-Gladbach

You can see the three ! named ! regions.

This name is integrated in the sensor-name like:

  • sensor.warnwetter_bedburg_current_warning_level
  • sensor.warnwetter_koln_current_warning_level
  • sensor.warnwetter_bergisch_gladbach_current_warning_level
  • sensor.warnwetter_bedburg_advance_warning_level
  • sensor.warnwetter_koln_advance_warning_level
  • sensor.warnwetter_bergisch_gladbach_advance_warning_level

And now my lovelance-Card-Code:

type: markdown
title: WarnWetter (DWD)
content: >-
  {# Beginn: Letzte Aktualisierung #}  

  {% set sensor_region_name ="warnwetter_bedburg" %}

  {% set current_last_update = state_attr("sensor." ~ sensor_region_name ~
  "_current_warning_level", "last_update") %} {% set weekday_last_update =
  as_timestamp(current_last_update) | timestamp_custom("%w", True) | int %}
  Stand: {{
  ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_last_update-1]
  ~ ", " ~ as_timestamp(current_last_update) |
  timestamp_custom('%d.%m.%Y-%H:%M:%S') }}

  {# Ende: Letzte Aktualisierung #} 

  {# Beginn: 1. Region #}

  {% set sensor_region_name ="warnwetter_bedburg" %}

  {% set current_region_name = state_attr("sensor." ~ sensor_region_name ~
  "_current_warning_level", "region_name") %} {% set current_count =
  state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level",
  "warning_count") %} {% set advance_count = state_attr("sensor." ~
  sensor_region_name ~ "_advance_warning_level", "warning_count") %} 

  ****{{ current_region_name }}****

  {% if ((current_count == 0 or current_count == None) and (advance_count == 0
  or advance_count == None)) %} **<font color=#c5e566>Keine Warnungen</font>**{%
  else %}
    {% for i in range(current_count) %}
      {% set headline = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**     
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% 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." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor.sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% if not loop.last %}***{% endif %}
    {% endfor %}
  {% endif %}   

  {# Ende: 1. Region #}

  <hr>

  {# Beginn: 2. Region #}

  {% set sensor_region_name ="warnwetter_koln" %}

  {% set current_region_name = state_attr("sensor." ~ sensor_region_name ~
  "_current_warning_level", "region_name") %} {% set current_count =
  state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level",
  "warning_count") %} {% set advance_count = state_attr("sensor." ~
  sensor_region_name ~ "_advance_warning_level", "warning_count") %} 

  ****{{ current_region_name }}****

  {% if ((current_count == 0 or current_count == None) and (advance_count == 0
  or advance_count == None)) %} **<font color=#c5e566>Keine Warnungen</font>**{%
  else %}
    {% for i in range(current_count) %}
      {% set headline = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**     
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% 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." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor.sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% if not loop.last %}***{% endif %}
    {% endfor %}
  {% endif %}   

  {# Ende: 2. Region #} 

  <hr>

  {# Beginn: 3. Region #}

  {% set sensor_region_name ="warnwetter_bergisch_gladbach" %}

  {% set current_region_name = state_attr("sensor." ~ sensor_region_name ~
  "_current_warning_level", "region_name") %} {% set current_count =
  state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level",
  "warning_count") %} {% set advance_count = state_attr("sensor." ~
  sensor_region_name ~ "_advance_warning_level", "warning_count") %} 

  ****{{ current_region_name }}****

  {% if ((current_count == 0 or current_count == None) and (advance_count == 0
  or advance_count == None)) %} **<font color=#c5e566>Keine Warnungen</font>**{%
  else %}
    {% for i in range(current_count) %}
      {% set headline = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_current_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**     
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% 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." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_headline") %}
      {% set description = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_description") %}
      {% set instruction = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_instruction") %}
      {% set level = state_attr("sensor.sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_level") %}
      {% set time_start = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_start") %}
      {% set weekday_start = as_timestamp(time_start) | timestamp_custom("%w", True) | int %}
      {% set time_end = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_end") %}
      {% set weekday_end = as_timestamp(time_end) | timestamp_custom("%w", True) | int %}
      {% set color = state_attr("sensor." ~ sensor_region_name ~ "_advance_warning_level", "warning_" ~ loop.index ~ "_color") %}
    **<font color={{ color }}>{{ headline }}</font>**
    **{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_start-1] ~ ", " ~ as_timestamp(time_start) | timestamp_custom('%H:%M') ~ " Uhr - " ~ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][weekday_end-1] ~ ", " ~ as_timestamp(time_end) | timestamp_custom('%H:%M') ~ " Uhr" }}**
    *{{ description|trim }}*
    {% if (instruction|trim != "None") %}
    ****{{ instruction|trim }}****
    {% endif %}
    {% if not loop.last %}***{% endif %}
    {% endfor %}
  {% endif %}   

  {# Ende: 3. Region #} 

Use the Code-Editor and not the Visual-Editor!

At the ā€œBeginn: Letzte Aktualisierungā€ and at the Beginn from each ā€œRegionā€, you find (in my code-Example at four places):

  {% set sensor_region_name ="warnwetter_bedburg" %}

Change this to your own sensor-Name like your configuration.

If you have less like three regions, delete the Region-Block from {# Beginn: x. Region #} ā€¦ {# Ende: x. Region #}

If you have more then like three regions, copy one Region-Block from {# Beginn: x. Region #} ā€¦ {# Ende: x. Region #} and paste it at the end.
Donā€™t forget to change the ā€œsensor_region_nameā€!

Many thanks to @stephan19 for the original!

Have fun!

8 Likes

Thanks for this!
I noticed one minor issue, though: time_start and time_end are always an hour off.

Using
set time_start=as_local(state_attr("sensor.dwd...
fixes that.

2 Likes

hi all,

i tried several of your beautiful templates.
but i cant seem to get any warnings. my dwd app shows heat and weather warnings but this integration always shows no warnings what so ever.

any clues why this could be?

Does the sensor itself show any level (Current Warning Level or Advance Warning Level)?
Are the listed sensor attributes valid? Neither Region ID nor Region name are empty?

My guess:
Either you do have a typo in your configuration (ID or name) or you selected an outdated region.

Quote from the docs:

thank you for your reply <3

i did try id and name - maybe it is outdated but i have no clue what the new one would be.
i also tried the capital of my country with no luck :frowning: even with the values listed here:

do you have a region which works for you? so i can check with a known working value?

Sorry, but did you ever read the integrations documentation?

The warncell ids are only numbers and listed in the following document
https://www.dwd.de/DE/leistungen/opendata/help/warnungen/cap_warncellids_csv.html

The following warncell is currently reporting: ā€œAmtliche WARNUNG vor STURMBƖENā€
Id = 815085370
Name = Stadt Wernigerode

very strange - not for me o.o

# Custom
## Sensors
sensor:
  - platform: dwd_weather_warnings
    region_name: 815085370
    name: DWDweather

You named the sensor DWDweather
In my configuration i named it Warnwetter
So the markdown code will not work for you.

If you use 100% of my example and just replace ENTER_YOUR_REGION_HERE with 815085370 it should work. Be carefull with the indentation in the markdown card.

You named the sensor DWDweather
In my configuration i named it Warnwetter
So the markdown code will not work for you.

oh gott now i feel really stupid :'D

sorry for all the trouble exactly that was my mistake

type: custom:vertical-stack-in-card
cards:
  - type: conditional
    conditions:
      - entity: sensor.aachen_warnung_current_warning_level
        state_not: '0'
    card:
      type: markdown
      content: >-
        {% set dwd_sensor = "sensor.aachen_warnung_current_warning_level" %} {%
        set type_to_img = {
          11: "",
          12: "",
          13: "",
          14: "",
          15: "",
          16: "",
          22: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Frost_gelb.png?__blob=normal&v=6",
          24: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Glaette_gelb.png?__blob=normal&v=4",
          31: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_gelb.png?__blob=normal&v=4",
          33: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_ocker.png?__blob=normal&v=4",
          34: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_ocker.png?__blob=normal&v=4",
          36: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_ocker.png?__blob=normal&v=4",
          38: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_ocker.png?__blob=normal&v=4",
          40: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          41: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          42: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          44: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          45: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          46: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          48: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          49: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          51: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_gelb.png?__blob=normal&v=4",
          52: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_ocker.png?__blob=normal&v=4",
          53: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_ocker.png?__blob=normal&v=4",
          54: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_rot.png?__blob=normal&v=4",
          55: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_rot.png?__blob=normal&v=4",
          56: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_lila.png?__blob=normal&v=4",
          57: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_gelb.png?__blob=normal&v=4",
          58: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Wind_ocker.png?__blob=normal&v=4",
          59: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Nebel_gelb.png?__blob=normal&v=4",
          61: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_ocker.png?__blob=normal&v=4",
          62: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_rot.png?__blob=normal&v=4",
          63: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_ocker.png?__blob=normal&v=4",
          64: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_rot.png?__blob=normal&v=4",
          65: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_lila.png?__blob=normal&v=4",
          66: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Regen_lila.png?__blob=normal&v=4",
          70: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_gelb.png?__blob=normal&v=4",
          71: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_ocker.png?__blob=normal&v=4",
          72: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_rot.png?__blob=normal&v=4",
          73: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_lila.png?__blob=normal&v=4",
          74: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_ocker.png?__blob=normal&v=4",
          75: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_rot.png?__blob=normal&v=4",
          76: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Schnee_lila.png?__blob=normal&v=4",
          79: "",
          82: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Frost_ocker.png?__blob=normal&v=4",
          84: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Glaette_gelb.png?__blob=normal&v=4",
          85: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Glaette_ocker.png?__blob=normal&v=4",
          87: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Glaette_rot.png?__blob=normal&v=4",
          88: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Tauwetter_ocker.png?__blob=normal&v=5",
          89: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Tauwetter_rot.png?__blob=normal&v=5",
          90: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_gelb.png?__blob=normal&v=4",
          91: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_ocker.png?__blob=normal&v=4",
          92: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_rot.png?__blob=normal&v=4",
          93: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          95: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          96: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Gewitter_lila.png?__blob=normal&v=4",
          98: "",
          99: "",
          246: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/UV_lila.png?__blob=normal&v=4",
          247: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Hitze_lila.png?__blob=normal&v=5",
          248: "https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/pictogramme/Hitze_dunkellila.png?__blob=normal&v=1"}
        %}

        {% for idx in range(1, state_attr(dwd_sensor, "warning_count")+1) %}  
        <table width="100%">
          <tr>
            <td>
            <!--font color="{{state_attr(dwd_sensor, ("warning_" ~ idx)).color}}"-->
              <h3>{{ state_attr(dwd_sensor, ("warning_" ~ idx)).headline }}</h3>
            <!--/font-->
            </td>
            <td>
              <img src="{{type_to_img[state_attr(dwd_sensor, ("warning_" ~ idx)).event_code]}}"/>
            </td>
          </tr>
        </table>


        *GĆ¼ltig bis {{ as_timestamp(state_attr(dwd_sensor, ("warning_" ~
        idx)).end_time) | timestamp_local }} Uhr:*

        {{ state_attr(dwd_sensor, ("warning_" ~ idx)).description }} {% endfor
        %}

Iā€™ve been using this card by mfdlr and itā€™s working well. My problem is, I want to change the card to only show warnings at or above level 2.

I think this clause would work, I just donā€™t know if pass can be written in plain text and if not, how I can integrate that into the clause.

{% if "{{state_attr(dwd_sensor, ("warning_" ~ idx)).level}}" < 2 %}
  pass
{% else %}

Integrating it into the card, I think it should go here:

        {% for idx in range(1, state_attr(dwd_sensor, "warning_count")+1) %}  
        {% if "{{state_attr(dwd_sensor, ("warning_" ~ idx)).level}}" < 2 %}
           pass
        {% else %}
        <table width="100%">
          <tr>
            <td>
            <!--font color="{{state_attr(dwd_sensor, ("warning_" ~ idx)).color}}"-->
              <h3>{{ state_attr(dwd_sensor, ("warning_" ~ idx)).headline }}</h3>
            <!--/font-->
            </td>
            <td>
              <img src="{{type_to_img[state_attr(dwd_sensor, ("warning_" ~ idx)).event_code]}}"/>
            </td>
          </tr>
        </table>

I am a noob at coding, any help would be greatly appreciated!

Edit: Spelling

@Fugazzy Compare the two sensor names from your examples, and youā€™ll see why. :wink:

Oh, sorry, I missed that on two days . . . :frowning: Thank you!

someone send these outputs to his handy too, and can send my his script/automatisation?

Please stay with english in this forum. It is mandatory, as this is the universal language that was agreed on, so moderators and other users can read what youā€™re writing. If necessary, please us a translation program like Google translate or whatever suits your needs! :slight_smile:

See here for the forum rules:

German:
Bitte nutze in diesem Forum Englisch als Sprache. Das ist hier die Regel, damit auch z.B. Moderatoren lesen kƶnnen, was geschrieben wird. Falls nƶtig, benutze bitte ein Ɯbersetzungsprogramm wie z.B. Google translate oder ein anderes, dass gut fĆ¼r Dich nutzbar ist. :slight_smile:


Edit: What is it that youā€™re after? Sending the warning messages via Telegram? Did I understand that right? :slight_smile: If so, please open a new topic and describe what exactly youā€™re after, as this is not related to the Markdown card, but more to the Telegram integration. :slight_smile: Thanks!

Hello @Stephan19! Great script. Works like a charm.

One question I canā€™t seem to find an answer for. Is there a setting or way to convert the warnings into English? Although we can sort of make out the warnings, not all in the household read German.

Hi @fspatt, no as far as i know there is no option to translate the messages to English. DWD only issues warnings in German.
The only thing that comes to my mind, but i donā€™t no how or even if it is at all possible, pipe the messages through some translation engine.

1 Like

Thanks, Iā€™ll keep looking. Maybe someone will see this post and respond. Happy with your work though!