Advertisement
Flo_R1der

Home Assistant / NINA Warnmeldungen Automation

Aug 19th, 2023 (edited)
1,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.95 KB | None | 0 0
  1. alias: NINA Warnmeldung Benachrichtigung
  2. description: ""
  3. trigger:
  4.   - platform: state
  5.     entity_id:
  6.      - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_1
  7.       - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_2
  8.       - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_3
  9.       - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_4
  10.       - binary_sensor.warning_meckenbeuren_bodenseekreis_baden_wurttemberg_5
  11.     to: "on"
  12.     alias: "State trigger: warning_meckenbeuren_bodenseekreis_baden_wurttemberg_1-5"
  13. condition:
  14.   - condition: or
  15.     conditions:
  16.       - condition: template
  17.         value_template: >-
  18.           {{ trigger_severity == 'Moderate' and
  19.           is_state('input_boolean.nina_warnmeldung_moderat', 'on') }}
  20.         alias: Severity = Moderate
  21.       - condition: template
  22.         value_template: >-
  23.           {{ trigger_severity == 'Severe' and
  24.           is_state('input_boolean.nina_warnmeldung_hoch', 'on') }}
  25.         alias: Severity = Severe
  26.       - condition: template
  27.         value_template: >-
  28.           {{ trigger_severity == 'Extreme' and
  29.           is_state('input_boolean.nina_warnmeldung_extrem', 'on') }}
  30.         alias: Severity = Extreme
  31.     alias: Check Severity & Notification-Configuration
  32. action:
  33.   - service: script.custom_flexible_notification
  34.     data:
  35.       title: NINA Warnmeldung
  36.       message: "{{ trigger_headline }}"
  37.       data:
  38.         notification_icon: mdi:alert-outline
  39.         tag: "{{ entity_id }}"
  40.         actions:
  41.           - action: URI
  42.             title: Meldung ansehen (warnung.bund.de)
  43.             uri: "{{ hyperlink }}"
  44. variables:
  45.   trigger_severity: "{{ trigger.to_state.attributes.severity }}"
  46.   trigger_headline: "{{ trigger.to_state.attributes.headline }}"
  47.   entity_id: "{{ trigger.to_state.entity_id }}"
  48.   hyperlink: https://warnung.bund.de/meldungen/{{ trigger.to_state.attributes.id }}
  49. mode: parallel
  50. max: 10
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement