How to Set Up NWS Alerts in Home Assistant (v6+ Guide)

;toc

Video

EMBED

Post

Severe weather can strike at any time, and having your smart home warn you the moment an alert is issued can make all the difference. With the updated NWS Alerts integration for Home Assistant, you can get real-time notifications, trigger automations, and display alerts directly on your dashboards.

In this guide, I’ll walk you through installing the integration, creating sensors, setting up notifications, and building dashboards. All of the YAML and templates are here for you to copy and paste directly.


What is NWS Alerts?

NWS Alerts is a custom integration for Home Assistant that connects directly to the National Weather Service. It was created and is actively maintained by developer finity69x2. The integration pulls in real-time weather alerts for your area, such as tornado warnings, severe thunderstorms, and winter storm advisories.

For example, you could flash your lights red during a tornado warning, send a push notification to your phone, or have your smart speakers announce an alert. The integration automatically updates when new alerts are issued or when they expire.


Step 1: Installation & Setup

You’ll need the HACS store (Home Assistant Community Store). If you don’t have HACS installed yet, check out my HACS setup guide.

  1. Open HACS and search for NWS Alerts.
  2. Install the integration. If you don’t see it, you may need to add the GitHub repository.
  3. Restart Home Assistant.
  4. Go to Settings → Devices & Services → Add Integration.
  5. Search for NWS Alerts and enter your county and zone codes (look these up on the NWS site).

👉 Tip for Testing: You don’t need to wait for an alert in your area. Visit api.weather.gov/alerts/active, copy a UGC code from a current alert, then edit the NWS Alerts integration in Home Assistant to use that code. You’ll see active alerts instantly for testing.


Step 2: Create a Template Sensor via the UI

Instead of editing YAML, you can set up a helper directly in the UI:

  1. Go to Settings → Devices & Services → Helpers.
  2. Click + Create Helper.
  3. Choose Template → Binary Sensor.
  4. Name it NWS Alert Active.
  5. Add this template:
{{ states('sensor.nws_alerts')|int > 0 }}
  1. Save it. You’ll now have binary_sensor.nws_alert_active showing on when alerts are active.

Step 3: Automations & Notifications

Mobile App Notifications

This automation sends a push notification whenever a new alert is issued.

alias: Test NWS Notification
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.nws_alerts_active
    from: "off"
    to: "on"
conditions: []
actions:
  - action: notify.YOUR_NOTIFY_DEVICE
    metadata: {}
    data:
      title: New NWS Alert
      message: |-
        {% set alerts = state_attr('sensor.nws_alerts_alerts','Alerts') %}
        {{ alerts[0].Headline }}
mode: single

Severity-Based Actions

This automation adapts based on the severity of the alert.

alias: NWS Alerts - Severity Based Actions
description: ""
triggers:
  - entity_id: sensor.nws_alerts_alerts
    above: 0
    trigger: numeric_state
conditions: []
actions:
  - variables:
      first_alert: >
        {% set alerts = state_attr('sensor.nws_alerts_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') }}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ alert_severity == 'Minor' }}"
        sequence:
          - action: notify.ryan_notify_standard
            data: {}
        alias: If alert severity is Minor
      - conditions:
          - condition: template
            value_template: "{{ alert_severity == 'Moderate' }}"
        sequence:
          - data:
              message: "NWS Alert (Moderate): {{ alert_headline }}"
            action: notify.ryan_notify_standard
        alias: If alert severity is Moderate
      - conditions:
          - condition: template
            value_template: "{{ alert_severity == 'Severe' }}"
        sequence:
          - action: notify.mobile_app_s24ultra
            data:
              message: "NWS Alert (Severe): {{ alert_headline }}"
          - if:
              - condition: time
                after: "08:00:00"
                before: "20:00:00"
                weekday:
                  - sun
                  - mon
                  - tue
                  - wed
                  - thu
                  - fri
                  - sat
            then:
              - data:
                  message: Severe weather alert issued. {{ alert_headline }}
                  entity_id: media_player.kitchen_display
                action: tts.cloud_say
              - data:
                  message: Severe weather alert issued. {{ alert_headline }}
                  entity_id: media_player.office_display
                action: tts.cloud_say
              - data:
                  message: Severe weather alert issued. {{ alert_headline }}
                  entity_id: media_player.nesthubb60a
                action: tts.cloud_say
        alias: If alert severity is Severe
      - conditions:
          - condition: template
            value_template: "{{ alert_severity == 'Extreme' }}"
        sequence:
          - data:
              message: "🚨 NWS Extreme Alert: {{ alert_headline }}"
            action: notify.ryan_notify_standard
          - data:
              brightness: 255
            action: light.turn_on
            target:
              entity_id:
                - light.basement_stairs
                - light.basement_main_lights
                - light.bedroom_overhead
          - data:
              entity_id: media_player.nesthubb60a
              message: >-
                Extreme weather alert! Seek shelter immediately. {{
                alert_headline }}
            action: tts.cloud_say
          - data:
              entity_id: media_player.kitchen_display
              message: >-
                Extreme weather alert! Seek shelter immediately. {{
                alert_headline }}
            action: tts.cloud_say
    default:
      - data:
          message: NWS Alert received but severity unknown. Check app.
        action: notify.ryan_notify_standard
mode: single

Severity Breakdown:

SeverityAction
MinorMobile notification only
ModerateMobile notification with alert headline
SevereMobile notification + TTS announcement (daytime only, 8am–8pm)
ExtremeMobile notification + TTS on multiple speakers + turn on basement & bedroom lights

Step 4: Dashboard Elements

Finally, let’s add alerts to your dashboard.

Markdown Card

content: >
  {% if is_state('binary_sensor.nws_alerts_active','on') %}
  {% set alerts = state_attr('sensor.nws_alerts_alerts','Alerts') %}
  **{{ alerts[0].Headline }}**  
  Severity: {{ alerts[0].Severity }}  
  Expires: {{ alerts[0].Expires }}  
  {% else %}
  No active alerts.
  {% endif %}

Entity Filter Card

Configure it to only display when alerts are active. Use sensor.nws_alerts_alerts or your binary sensor.


Wrap-Up

With just a few steps, you can:

  1. Install NWS Alerts via HACS.
  2. Configure with your zone codes.
  3. Add a template sensor.
  4. Set up notifications and severity-based actions.
  5. Build a dashboard card.

Your smart home will now warn you about severe weather automatically — whether it’s a push to your phone, an announcement on your smart speakers, or flashing your lights during an extreme event.


Extra: Magic Mind Partner

I’ve been using Magic Mind while traveling — they’re easy to pack, more convenient than coffee, and help me stay focused. They’ve been a partner with the channel for a few months and have committed their support for the next few months.

👉 Try it yourself: magicmind.com/SMART50

You’ll get 50% off your first subscription or 20% off a one-time purchase.

Leave a Reply

Your email address will not be published. Required fields are marked *