nws_alerts
nws_alerts copied to clipboard
Attribute Value Data?
Question about this integration. Wasn't sure where else to ask the question. I see that the integration outputs the following attribute products:
- Title
- Event ID
- Message Type
- Event Status
- Event Severity
- Event Expires
- Display Desc (Display Description)
- Spoken Desc (Spoken Description)
- icon: mdi:alert
I just set this integration up but I would like to set up automations for Severe Thunderstorm Warnings, Tornado Warnings, Tornado Watches, Severe Thunderstorm Watches, etc. Does anyone have screen shots of this integration and the attribute data that is populated for these attributes? Currently it just has 'null' as the attribute values obviously because there hasn't been a weather watch/warning issued since the setup. Just would like a little insight into the data values that will be populated. Thank you!
These are the header and the first alert. There are currently 4 in my area.
I hope this helps. Let me know if you need more shots of the data.
I would really like to have some example data so I can test my templates
Here's what I did to get data when my local forecast was all sunshine and pretty:
- Check the national weather map for forecasts of nasty weather. Also check the NWS site for the list if alerts. This week, most of California is getting drenched from another 2-banger atmospheric river.
- Set up another instance of NWS Alerts, but use the locale codes for the place with the nasty weather. This will generate the data you need to experiment. I put a "T" in front of the locale name for the test instance.
- Once you are done, change the sensor names to your locale and claim victory.
Have fun!
Can you guys share your yaml on the trigger method of the specific attributes? I see under "spoken_desc" attribute for my area:
FLOOD WATCH REMAINS IN EFFECT THROUGH WEDNESDAY MORNING
HIGH SURF ADVISORY REMAINS IN EFFECT UNTIL 4 AM PST TUESDAY
WIND ADVISORY REMAINS IN EFFECT UNTIL 4 AM PST TUESDAY
Title attribute:
title: Flood Watch - High Surf Advisory - Wind Advisory
I don't care about the high surf advisory but want the Wind and flood advisory as triggers
Ok I think I got it, might be a more graceful way to do multiple ORs in the template
trigger:
- platform: template
value_template: >-
{{ state_attr('sensor.nws_alerts', 'title') is search('Flood',
ignorecase=True) }}
- platform: template
value_template: >-
{{ state_attr('sensor.nws_alerts', 'title') is search('Wind',
ignorecase=True) }}
- platform: template
value_template: >-
{{ state_attr('sensor.nws_alerts', 'title') is search('Fire',
ignorecase=True) }}
- platform: template
value_template: >-
{{ state_attr('sensor.nws_alerts', 'title') is search('Tornado',
ignorecase=True) }}
- platform: template
value_template: >-
{{ state_attr('sensor.nws_alerts', 'title') is search('Storm',
ignorecase=True) }}
Found a better way by adding a template sensor, if you're interested:
sensor:
- platform: template
sensors:
weather_alert:
friendly_name: "Weather Alert"
value_template: >-
{{ 'flood' in state_attr('sensor.nws_alerts', 'title') | lower or
'rain' in state_attr('sensor.nws_alerts', 'title') | lower or
'storm' in state_attr('sensor.nws_alerts', 'title') | lower or
'tornado' in state_attr('sensor.nws_alerts', 'title') | lower }}
It's typically better to get help on implementation of automations in HA via the HA forums instead of opening an issue for something like this as it's not technically an issue.