Closed xlcnd closed 3 years ago
- alias: Alert me about weather warnings trigger: - platform: state entity_id: binary_sensor.meteoalarmeu attribute: message_id condition: - condition: state entity_id: binary_sensor.meteoalarmeu state: 'on' action: - repeat: count: "{{ state_attr('binary_sensor.meteoalarmeu', 'alerts') | int }}" sequence: - service: persistent_notification.create data: title: > {% set ext = "" if repeat.first else "_" + (repeat.index-1)|string %} {{ state_attr('binary_sensor.meteoalarmeu', 'awareness_type' + ext) }} ({{ state_attr('binary_sensor.meteoalarmeu', 'awareness_level' + ext) }}) message: > {% set ext = "" if repeat.first else "_" + (repeat.index-1)|string %} {{ state_attr('binary_sensor.meteoalarmeu', 'message' + ext) }} Effective from **{{ state_attr('binary_sensor.meteoalarmeu', 'from' + ext) }}** until **{{ state_attr('binary_sensor.meteoalarmeu', 'until' + ext) }}** notification_id: > {% set ext = "" if repeat.first else "_" + (repeat.index-1)|string %} meteoalarm_{{ state_attr('binary_sensor.meteoalarmeu', 'alert_id' + ext) }} - alias: Update weather warnings (special cases) trigger: - platform: homeassistant event: start - platform: state entity_id: binary_sensor.meteoalarmeu to: unavailable for: 00:10:00 action: - service: homeassistant.update_entity entity_id: binary_sensor.meteoalarmeu