Skip to content

Instantly share code, notes, and snippets.

@blindguynar
Created January 12, 2026 17:39
Show Gist options
  • Select an option

  • Save blindguynar/d68b71aa45a7aad6ac37837b09b3837d to your computer and use it in GitHub Desktop.

Select an option

Save blindguynar/d68b71aa45a7aad6ac37837b09b3837d to your computer and use it in GitHub Desktop.
NWS weather alert automation
alias: "Alert: NWS - Benton County Severity Based Actions"
description: ""
triggers:
- trigger: state
entity_id:
- sensor.nws_alerts_benton_county_alerts
conditions: []
actions:
- variables:
first_alert: >
{% set alerts = state_attr('sensor.nws_alerts_benton_county_alerts',
'Alerts') %} {{ alerts[0] if alerts is not none else {} }}
alert_severity: |
{{ first_alert.Severity | default('Unknown') }}
alert_headline: |
{{ first_alert.Headline | default('NWS Alert') }}
alert_event: |
{{ first_alert.Event | default('NWS Event') }}
alert_description: |
{{ first_alert.Description | default('NWS Event Description') }}
alert_id: |
{{ first_alert.ID | default('None') }}
alert_url: shortcuts://run-shortcut?name=Weather
county: Benton County
alert_ios_dist: all_ios_devices
- if:
- condition: template
value_template: >-
{{ alert_id !=
states('input_text.benton_county_active_weather_alert_id') }}
then:
- action: input_text.set_value
metadata: {}
data:
value: "{{ alert_id }}"
target:
entity_id: input_text.benton_county_active_weather_alert_id
- choose:
- conditions:
- condition: template
value_template: "{{ alert_severity == 'Minor' }}"
sequence:
- if:
- condition: time
after: "07:00:00"
before: "23:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
then:
- action: notify.{{ alert_ios_dist }}
data:
message: "NWS Alert (Minor) [{{ county }}]: {{ alert_headline }}"
data:
url: "{{ alert_url }}"
alias: If alert severity is Minor
- conditions:
- condition: template
value_template: "{{ alert_severity == 'Moderate' }}"
sequence:
- if:
- condition: time
after: "07:00:00"
before: "23:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
then:
- data:
message: >-
NWS Alert (Moderate) [{{ county }}]: {{ alert_headline
}}
data:
url: "{{ alert_url }}"
action: notify.{{ alert_ios_dist }}
alias: If alert severity is Moderate
- conditions:
- condition: template
value_template: "{{ alert_severity == 'Severe' }}"
sequence:
- action: notify.{{ alert_ios_dist }}
data:
data:
sticky: "true"
push:
sound:
name: default
critical: 1
volume: 1
url: "{{ alert_url }}"
message: "🚨 NWS Severe Alert [{{ county }}]: {{ alert_headline }}"
title: Severe Weather Alert
- action: script.alexa_send_alerts_to_devices
data:
group: all
message: >-
NWS Extreme Alert [{{ county }}]: {{ alert_headline }} {{
alert_description }}
alias: If alert severity is Severe
- conditions:
- condition: template
value_template: "{{ alert_severity == 'Extreme' }}"
sequence:
- action: notify.{{ alert_ios_dist }}
data:
data:
sticky: "true"
push:
sound:
name: default
critical: 1
volume: 1
url: "{{ alert_url }}"
message: "🚨 NWS Extreme Alert [{{ county }}]: {{ alert_headline }}"
title: Extreme Weather Alert
- action: script.alexa_send_alerts_to_devices
data:
group: all
message: >-
NWS Extreme Alert [{{ county }}]: {{ alert_headline }} {{
alert_description }}
alias: If alert severity is Extreme
default:
- data:
message: >-
NWS Alert [{{ county }}] received but severity unknown. Check
app
url: "{{ alert_url }}"
action: notify.{{ alert_ios_dist }}
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment