Advertisement
Flo_R1der

NINA Warnmeldungen / Home Assistant Card

Aug 19th, 2023 (edited)
1,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.67 KB | None | 0 0
  1. type: conditional
  2. conditions:
  3.   - entity: binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_1
  4.     state: 'on'
  5. card:
  6.   type: entity-filter
  7.   entities:
  8.    - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_1
  9.     - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_2
  10.     - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_3
  11.     - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_4
  12.     - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_5
  13.   state_filter:
  14.    - 'on'
  15.   card:
  16.     type: markdown
  17.     title: NINA Warnmeldungen
  18.     content: |-
  19.       {% for list in config.entities %}
  20.         {% if "Vorwarnung" not in state_attr(list.entity, 'headline') -%}
  21.           {% if state_attr(list.entity, 'severity') == "Extreme" -%} <ha-alert alert-type="error"
  22.           {%- elif state_attr(list.entity, 'severity') == "Severe" -%} <ha-alert alert-type="warning"
  23.           {%- else %} <ha-alert alert-type="info" {% endif %}
  24.           title="{{ state_attr(list.entity, 'headline') }}">
  25.          {{- state_attr(list.entity, 'description') -}}
  26.           <br> <br> {% if state_attr(list.entity, 'recommended_actions') != "" %} **Empfohlene Aktionen:**
  27.           {{ state_attr(list.entity, 'recommended_actions') }} <br> <br> {% endif -%}
  28.           [Meldung ansehen (warnung.bund.de)](https://warnung.bund.de/meldungen/{{ state_attr(list.entity, 'id') }})
  29.           {% if state_attr(list.entity, 'expires') != "" -%}
  30.           Endet: {{ as_datetime(state_attr(list.entity, 'expires')).strftime('%d.%m.%Y - %H:%M') }}
  31.           {%- endif %} </ha-alert>
  32.         {%- endif %}
  33.       {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement