- Detailed Instructions
- Troubleshooting
- YAML Package Info
- Lovelace UI Examples
- GitHub Repository
- View Issues/Feature Requests
- Report an Issue/Feature Request
- Changelog
It is recommended to install weatheralerts via HACS. To install manually, put all the files from /custom_components/weatheralerts/
here:
<config directory>/custom_components/weatheralerts/
Once installed (via HACS or manually), continue reading below to configure the weatheralerts sensor platform.
You will need to configure the weatheralerts sensor platform via YAML (for now). This can be done by adding the platform to the
sensor:
section of your configuration.yaml or adding it to another dedicated YAML file you have setup for sensor configuration. The absolute minimum information your need to configure weatheralerts are your two-letter state or marine zone abbreviation and your zone ID number.
sensor:
platform: weatheralerts
state: <your state or marine two letter abbreviation>
zone: <your zone ID number>
Your state abbreviation is simply the standard two letter postal abbreviation. It can be found by going to https://alerts.weather.gov/, click the Land areas with zones
link, and click on your state name in the list. The URL in your browser address bar will contain search?area=XX
. The XX
after area=
in your browser address bar will be your two letter state abbreviation and that is what you would use for the YAML state configuration option.
To find your zone ID number for the YAML zone configuration option, go to https://alerts.weather.gov/, click the Land areas with zones
link, find your state in the list, and click the Public Zones
link for your state. In the Public Zones
list, find your county and its six character (3 letters and 3 numbers) zone ID. The last three characters is the three digit number portion of the zone ID. This three digit number is the zone ID number and will be used for your YAML zone configuration option. For example, Outagamie County in Wisconsin has a zone code of WIZ038
. The state config is WI
and the zone ID number for the zone config option is 38
(omit any leading zeros, so 038 = 38).
To find your county ID number, go to https://alerts.weather.gov/, click the Land areas with zones
link, find your state in the list, and click the County Zones
link for your state. In the County Zones
list, find your county and its six character (3 letters and 3 numbers) county zone ID. The last three characters is the three digit number portion of the county zone ID. This three digit number is the county zone ID number and will be used for your YAML county configuration option. For example, Outagamie County in Wisconsin has county code WIC087
. The county ID number for the county config option is 87
(omit any leading zeros, so 087 = 87).
Example configuration.yaml using the above sample instructions:
sensor:
platform: weatheralerts
state: WI
zone: 38
county: 87
If your zone or county ID number starts with one or more 0's you need to wrap quotes around it, or just skip the leading 0's (so 010
should be "010"
or 10
, and 003
should be "003"
or 3
)
Configuration variables:
key | description |
---|---|
platform (Required) | The platform name. |
state (Required) | Two letter code for your state ex.("CA" for California). |
zone (Required) | One, two, or three digit code of the zone you want to monitor ex. 38 |
county (Optional) | One, two, or three digit code of the zone you want to monitor ex. 87 |
scan_interval (Optional) | Number of seconds between updates. Default is 30 seconds if option is not specified. |
It is highly recommended to use BOTH zone and county IDs in the platform configuration to increase the reliability of alerts. If you only use the 'zone' config option, you may not get all of the active alerts for your location.
The main weatheralerts sensor will be given the name of your zone or county and can be changed via the Home Assistant Settings menu. Click the into the Settings menu in the web UI, click the Devices & Services option on the Settings menu, and then select Entities option from the top horizontal menu. Then, use the search to search box to search for your county name and you should be able to find the new sensor for the alerts.
This main sensor state will be the number of alerts that are currently active, or it will be set to unavailable
if weatheralerts is unable to update the sensor due to problems with the weather.gov API server. Due to the possiblity of the state being unavailable
, you need to be careful when using it as a trigger for automations. Additional conditions may need to be applied to automations to prevent unwanted re-triggering.
When there are alerts, the information about them are stored in a list in the attributes. The content of that list can be used in automations, template sensors, and Lovelace cards. The following attributes are available:
attribute | description |
---|---|
area | The text describing the affected area of the alert message. |
certainty | Certainty of the subject event of the alert message. (Observed, Likely, Possible, Unlikely, Unknown) |
description | The text describing the subject event of the alert message. |
ends | The expected end time of the subject event in the alert message. The time at which the hazard conditions of the subject event are no longer expected. |
event | The text denoting the type of the subject event in the alert message. |
instruction | The text describing the recommended action to be taken by recipients of the alert message. |
response | The code denoting the type of action recommended. (Shelter, Evacuate, Prepare, Execute, Avoid, Monitor, Assess, AllClear, None) |
sent | The origination time and date of the alert message. |
severity | Severity of the subject event of the alert message. (Extreme, Severe, Moderate, Minor, Unknown) |
title | A brief human-readable headline containing the alert type and valid time of the alert. |
urgency | Urgency of the subject event of the alert message. (Immediate, Expected, Future, Past, Unknown) |
NWSheadline | A brief human-readable headline containing the alert type and valid time of the alert.. |
hailSize | Potential hail size (inches) of storm. |
windGust | Potential wind gusts of storm. |
waterspoutDetection | Potential for waterspout formation in storm. |
effective | The effective date and time of the information in the alert message. |
expires | The expiry date and time of the information in the alert message. |
endsExpires | If ends time is not set, this is equal to expires time. Otherwise this is equal to ends time. This can be used to hide stale alerts if weather.gov API is experiencing an outage. |
onset | Expected time of the beginning of the subject event in the alert message. |
status | The code denoting the appropriate handling of the alert message. (Actual, Exercise, System, Test, Draft). |
messageType | The code denoting the nature of the alert message. (Alert, Update, Cancel, Ack, Error) |
category | The code denoting the category of the subject event in the alert message. (Geo, Met, Safety, Security, Rescue, Fire, Health, Env, Transport, Infra, CBRNE, Other) |
sender | Email address of the NWS webmaster. |
senderName | Name of the issuing NWS Office. |
id | A unique ID for the alert. |
zoneid | The zone ID (and county ID if configured) used to fetch your weather alerts. |