Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Weather Alerts
- description: ""
- triggers:
- - entity_id:
- - sensor.weatheralerts_1_active_alerts
- trigger: state
- conditions:
- - condition: template
- value_template: "{{ trigger.to_state.state | int > trigger.from_state.state | int }}"
- actions:
- - parallel:
- - if:
- - condition: state
- entity_id: schedule.quiet_time_hours
- state: "off"
- then:
- - sequence:
- - metadata: {}
- data:
- preannounce: true
- preannounce_media_id: >-
- https://depsjgbyptrpahqike5brkz6xal30abd.ui.nabu.casa/local/mp3/usa-eas-alarm-249125.mp3
- message: >
- {% set idx = states('sensor.weatheralerts_1_active_alerts')
- | int %} {% set alert = 'sensor.weatheralerts_1_alert_' ~
- idx %} {{ state_attr(alert, 'spoken_title') }}
- {{ state_attr(alert, 'spoken_message') }}
- target:
- device_id:
- - 973e40faee86d5d6dcffaf72f58f6d73
- - 38acae3bacfe0c3b2c31f5bc7ae453cc
- - 044b5980efd47baf8c27a8fbcf1abe6e
- - 6f648a6952ef9fa1343184e70a62fad7
- action: assist_satellite.announce
- - metadata: {}
- data:
- preannounce: false
- media_id: >-
- https://depsjgbyptrpahqike5brkz6xal30abd.ui.nabu.casa/local/mp3/eas.mp3
- target:
- device_id:
- - 973e40faee86d5d6dcffaf72f58f6d73
- - 38acae3bacfe0c3b2c31f5bc7ae453cc
- - 044b5980efd47baf8c27a8fbcf1abe6e
- - 6f648a6952ef9fa1343184e70a62fad7
- action: assist_satellite.announce
- - parallel:
- - metadata: {}
- data:
- title: >
- {% set idx = states('sensor.weatheralerts_1_active_alerts') |
- int %} {% set alert = 'sensor.weatheralerts_1_alert_' ~ idx %}
- {{ state_attr(alert, 'alert_title') }}
- message: >
- {% set idx = states('sensor.weatheralerts_1_active_alerts') |
- int %} {% set alert = 'sensor.weatheralerts_1_alert_' ~ idx %}
- {{ state_attr(alert, 'alert_instruction') }}
- action: notify.mobile_app_noah_s_phone
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement