Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
/ nws_alerts_array Public archive

Alerts from the US National Weather Service

License

Notifications You must be signed in to change notification settings

Snuffy2/nws_alerts_array

Repository files navigation

nws_alerts_array

GitHub Release GitHub Activity License

hacs

Alerts from the US National Weather Service

Installation

Installation via HACS

Unless you have a good reason not to, you probably want to install this component via HACS(Home Assistant Community Store)

  1. Ensure that HACS is installed.
  2. Navigate to HACS -> Integrations
  3. Open the three-dot menu and select 'Custom Repositories'
  4. Put 'https://github.com/Snuffy2/nws_alerts_array' into the 'Repository' textbox.
  5. Select 'Integration' as the category
  6. Press 'Add'.
  7. Find the NWS Alerts Array integration in the HACS integration list and install it
  8. Add your configuration
  9. Restart Home Assistant.

Manual Installation

You probably do not want to do this! Use the HACS method above unless you have a very good reason why you are installing manually

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called nws_alerts_array.
  4. Download all the files from the custom_components/nws_alerts_array/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Add your configuration
  7. Restart Home Assistant

Configuration

Manually via an entry in your configuration.yaml file:

To create a sensor instance add the following configuration to your sensor definitions using the zone_id found above:

- platform: nws_alerts_array
  zone_id: 'PAC049'

or enter comma separated values for multiple zones:

- platform: nws_alerts_array
  zone_id: 'PAC049,WVC031'

After you restart Home Assistant then you should have a new sensor called "sensor.nws_alerts_array" in your system.

You can overide the sensor default name ("sensor.nws_alerts_array") to one of your choosing by setting the "name:" option:

- platform: nws_alerts_array
  zone_id: 'INZ009,INC033'
  name: My NWS Alerts Sensor

Using the configuration example above the sensor will then be called "sensor.my_nws_alerts_sensor"

Notes:

  • An updated version of the nws_alerts integration with the results in arrays for easier splitting of the alerts
  • This integration retrieves updated weather alerts every minute from the US NWS API.
  • The integration presents the number of currently active alerts as the state of the sensor and lists many alert details as a list in the attributes of the sensor.
  • The sensor that is created is used in my "NWS Alerts Custom" package - https://github.com/Snuffy2/nws_alerts_array/blob/main/packages/nws_alerts_custom_package.yaml
  • To enable detailed logging for this component, add the following to your configuration.yaml file
  logger:
    default: warn
    logs:
      custom_components.nws_alerts_array: debug 

Based on work from:

Contributions are welcome!