Severe Weather Alerts from the US National Weather Service

Answering my own question, or at least one option. I’m going to create a template sensor for the information I want.

  value_template: >
 {% if states.sensor.nws_alert_event.attributes.features[0] is defined %}
Headline   
{{states.sensor.nws_alert_event.attributes.features[0].properties.headline }}

Details
{{states.sensor.nws_alert_event.attributes.features[0].properties.description }}

Instructions
{{states.sensor.nws_alert_event.attributes.features[0].properties.instruction }}
    {% else %}
      none
    {% endif %}

this was the output

Headline    
Rip Current Statement issued September 30 at 12:20PM EDT until September 30 at 8:00PM EDT by NWS Wakefield VA

Details
* LOCATION...Along the Ocean side in Virginia Beach.

* TIMING...Until 8 PM EDT this evening.

* SURF OR RIP CURRENT RISK...There is a high risk of rip
currents. Three to 4 ft breakers are expected along the surf.

Instructions
A Beach Hazards Statement is issued when threats such as rip
currents...longshore currents...sneaker waves and other hazards
create life-threatening conditions in the surf zone. Caution
should be used when in or near the water.

There is a high risk of rip currents.

Rip currents are powerful channels of water flowing quickly away
from shore...which occur most often at low spots or breaks in the
sandbar and in the vicinity of structures such as jetties and
piers. Heed the advice of lifeguards...beach patrol flags and
signs.

If you become caught in a rip current...relax and float. Don't
swim against the current. If able, swim in a direction following
the shoreline. If unable to escape, face the shore and call or
wave for help.
1 Like

So it looks like you’ve worked out how you want it to look and are happy with the results.

Is that correct?

I thought so. It works in the template test area, but not as a sensor. Any idea? I’m getting unknown for the value of my two sensor.

      nws_alert_1:
        value_template: >
         {% if states.sensor.nws_alert_event.attributes.features[0] is defined %}
         Headline 1
         {{states.sensor.nws_alert_event.attributes.features[0].properties.headline }}
         
         Details
         {{states.sensor.nws_alert_event.attributes.features[0].properties.description }}
         
         Instructions
         {{states.sensor.nws_alert_event.attributes.features[0].properties.instruction }}
         {% else %}
          none
         {% endif %}
        entity_id: sensor.time

      nws_alert_2:
        value_template: >
         {% if states.sensor.nws_alert_event.attributes.features[1] is defined %}
         Headline 2
         {{states.sensor.nws_alert_event.attributes.features[1].properties.headline }}
         
         Details
         {{states.sensor.nws_alert_event.attributes.features[1].properties.description }}
         
         Instructions
         {{states.sensor.nws_alert_event.attributes.features[1].properties.instruction }}
         {% else %}
          none
         {% endif %}
        entity_id: sensor.time

The current value of the sensor is

{
  "features": [
    {
      "id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282438",
      "type": "Feature",
      "geometry": null,
      "properties": {
        "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282438",
        "@type": "wx:Alert",
        "id": "NWS-IDP-PROD-3844197-3282438",
        "areaDesc": "Maryland Beaches; Virginia Beach; Accomack; Northampton; Eastern Currituck",
        "geocode": {
          "UGC": [
            "MDZ025",
            "VAZ098",
            "VAZ099",
            "VAZ100",
            "NCZ102"
          ],
          "SAME": [
            "024047",
            "051810",
            "051001",
            "051131",
            "037053"
          ]
        },
        "affectedZones": [
          "https://api.weather.gov/zones/forecast/MDZ025",
          "https://api.weather.gov/zones/forecast/VAZ098",
          "https://api.weather.gov/zones/forecast/VAZ099",
          "https://api.weather.gov/zones/forecast/VAZ100",
          "https://api.weather.gov/zones/forecast/NCZ102"
        ],
        "references": [
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282092",
            "identifier": "NWS-IDP-PROD-3843746-3282092",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282093",
            "identifier": "NWS-IDP-PROD-3843746-3282093",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282094",
            "identifier": "NWS-IDP-PROD-3843746-3282094",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282080",
            "identifier": "NWS-IDP-PROD-3843740-3282080",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282081",
            "identifier": "NWS-IDP-PROD-3843740-3282081",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282082",
            "identifier": "NWS-IDP-PROD-3843740-3282082",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282083",
            "identifier": "NWS-IDP-PROD-3843740-3282083",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281815",
            "identifier": "NWS-IDP-PROD-3843305-3281815",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281814",
            "identifier": "NWS-IDP-PROD-3843305-3281814",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281816",
            "identifier": "NWS-IDP-PROD-3843305-3281816",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281012",
            "identifier": "NWS-IDP-PROD-3842142-3281012",
            "sender": "[email protected]",
            "sent": "2019-09-29T15:19:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281011",
            "identifier": "NWS-IDP-PROD-3842142-3281011",
            "sender": "[email protected]",
            "sent": "2019-09-29T15:19:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282089",
            "identifier": "NWS-IDP-PROD-3843745-3282089",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282090",
            "identifier": "NWS-IDP-PROD-3843745-3282090",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282091",
            "identifier": "NWS-IDP-PROD-3843745-3282091",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281817",
            "identifier": "NWS-IDP-PROD-3843306-3281817",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281819",
            "identifier": "NWS-IDP-PROD-3843306-3281819",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281818",
            "identifier": "NWS-IDP-PROD-3843306-3281818",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281812",
            "identifier": "NWS-IDP-PROD-3843304-3281812",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281813",
            "identifier": "NWS-IDP-PROD-3843304-3281813",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282087",
            "identifier": "NWS-IDP-PROD-3843744-3282087",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282088",
            "identifier": "NWS-IDP-PROD-3843744-3282088",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          }
        ],
        "sent": "2019-09-30T17:49:00-04:00",
        "effective": "2019-09-30T17:49:00-04:00",
        "onset": "2019-09-30T17:49:00-04:00",
        "expires": "2019-10-01T02:00:00-04:00",
        "ends": "2019-10-01T20:00:00-04:00",
        "status": "Actual",
        "messageType": "Update",
        "category": "Met",
        "severity": "Moderate",
        "certainty": "Likely",
        "urgency": "Expected",
        "event": "Rip Current Statement",
        "sender": "[email protected]",
        "senderName": "NWS Wakefield VA",
        "headline": "Rip Current Statement issued September 30 at 5:49PM EDT until October 1 at 8:00PM EDT by NWS Wakefield VA",
        "description": "* LOCATION...Ocean side beaches of Maryland, Virginia, and\nCurrituck County North Carolina.\n\n* TIMING...Through Tuesday evening.\n\n* SURF OR RIP CURRENT RISK...There is a high risk of rip currents.\n3 to 4 ft breakers are expected along the surf.",
        "instruction": "A Beach Hazards Statement is issued when threats such as rip\ncurrents...longshore currents...sneaker waves and other hazards\ncreate life-threatening conditions in the surf zone. Caution\nshould be used when in or near the water.\n\nThere is a high risk of rip currents.\n\nRip currents are powerful channels of water flowing quickly away\nfrom shore...which occur most often at low spots or breaks in the\nsandbar and in the vicinity of structures such as jetties and\npiers. Heed the advice of lifeguards...beach patrol flags and\nsigns.\n\nIf you become caught in a rip current...relax and float. Don't\nswim against the current. If able, swim in a direction following\nthe shoreline. If unable to escape, face the shore and call or\nwave for help.",
        "response": "Avoid",
        "parameters": {
          "NWSheadline": [
            "BEACH HAZARDS STATEMENT NOW IN EFFECT THROUGH TUESDAY EVENING... ...HIGH RIP CURRENT RISK NOW IN EFFECT THROUGH TUESDAY EVENING"
          ],
          "VTEC": [
            "/O.EXT.KAKQ.RP.S.0013.000000T0000Z-191002T0000Z/"
          ],
          "PIL": [
            "AKQCFWAKQ"
          ],
          "BLOCKCHANNEL": [
            "CMAS",
            "EAS",
            "NWEM"
          ],
          "eventEndingTime": [
            "2019-10-01T20:00:00-04:00"
          ]
        }
      }
    },
    {
      "id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282437",
      "type": "Feature",
      "geometry": null,
      "properties": {
        "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3844197-3282437",
        "@type": "wx:Alert",
        "id": "NWS-IDP-PROD-3844197-3282437",
        "areaDesc": "Maryland Beaches; Virginia Beach; Accomack; Northampton; Eastern Currituck",
        "geocode": {
          "UGC": [
            "MDZ025",
            "VAZ098",
            "VAZ099",
            "VAZ100",
            "NCZ102"
          ],
          "SAME": [
            "024047",
            "051810",
            "051001",
            "051131",
            "037053"
          ]
        },
        "affectedZones": [
          "https://api.weather.gov/zones/forecast/MDZ025",
          "https://api.weather.gov/zones/forecast/VAZ098",
          "https://api.weather.gov/zones/forecast/VAZ099",
          "https://api.weather.gov/zones/forecast/VAZ100",
          "https://api.weather.gov/zones/forecast/NCZ102"
        ],
        "references": [
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282092",
            "identifier": "NWS-IDP-PROD-3843746-3282092",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282093",
            "identifier": "NWS-IDP-PROD-3843746-3282093",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843746-3282094",
            "identifier": "NWS-IDP-PROD-3843746-3282094",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282080",
            "identifier": "NWS-IDP-PROD-3843740-3282080",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282081",
            "identifier": "NWS-IDP-PROD-3843740-3282081",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282082",
            "identifier": "NWS-IDP-PROD-3843740-3282082",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843740-3282083",
            "identifier": "NWS-IDP-PROD-3843740-3282083",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281815",
            "identifier": "NWS-IDP-PROD-3843305-3281815",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281814",
            "identifier": "NWS-IDP-PROD-3843305-3281814",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843305-3281816",
            "identifier": "NWS-IDP-PROD-3843305-3281816",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281012",
            "identifier": "NWS-IDP-PROD-3842142-3281012",
            "sender": "[email protected]",
            "sent": "2019-09-29T15:19:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3842142-3281011",
            "identifier": "NWS-IDP-PROD-3842142-3281011",
            "sender": "[email protected]",
            "sent": "2019-09-29T15:19:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282089",
            "identifier": "NWS-IDP-PROD-3843745-3282089",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282090",
            "identifier": "NWS-IDP-PROD-3843745-3282090",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843745-3282091",
            "identifier": "NWS-IDP-PROD-3843745-3282091",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281817",
            "identifier": "NWS-IDP-PROD-3843306-3281817",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281819",
            "identifier": "NWS-IDP-PROD-3843306-3281819",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843306-3281818",
            "identifier": "NWS-IDP-PROD-3843306-3281818",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281812",
            "identifier": "NWS-IDP-PROD-3843304-3281812",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843304-3281813",
            "identifier": "NWS-IDP-PROD-3843304-3281813",
            "sender": "[email protected]",
            "sent": "2019-09-30T05:18:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282087",
            "identifier": "NWS-IDP-PROD-3843744-3282087",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          },
          {
            "@id": "https://api.weather.gov/alerts/NWS-IDP-PROD-3843744-3282088",
            "identifier": "NWS-IDP-PROD-3843744-3282088",
            "sender": "[email protected]",
            "sent": "2019-09-30T12:20:00-04:00"
          }
        ],
        "sent": "2019-09-30T17:49:00-04:00",
        "effective": "2019-09-30T17:49:00-04:00",
        "onset": "2019-09-30T17:49:00-04:00",
        "expires": "2019-10-01T02:00:00-04:00",
        "ends": "2019-10-01T20:00:00-04:00",
        "status": "Actual",
        "messageType": "Update",
        "category": "Met",
        "severity": "Moderate",
        "certainty": "Likely",
        "urgency": "Expected",
        "event": "Beach Hazards Statement",
        "sender": "[email protected]",
        "senderName": "NWS Wakefield VA",
        "headline": "Beach Hazards Statement issued September 30 at 5:49PM EDT until October 1 at 8:00PM EDT by NWS Wakefield VA",
        "description": "* LOCATION...Ocean side beaches of Maryland, Virginia, and\nCurrituck County North Carolina.\n\n* TIMING...Through Tuesday evening.\n\n* SURF OR RIP CURRENT RISK...There is a high risk of rip currents.\n3 to 4 ft breakers are expected along the surf.",
        "instruction": "A Beach Hazards Statement is issued when threats such as rip\ncurrents...longshore currents...sneaker waves and other hazards\ncreate life-threatening conditions in the surf zone. Caution\nshould be used when in or near the water.\n\nThere is a high risk of rip currents.\n\nRip currents are powerful channels of water flowing quickly away\nfrom shore...which occur most often at low spots or breaks in the\nsandbar and in the vicinity of structures such as jetties and\npiers. Heed the advice of lifeguards...beach patrol flags and\nsigns.\n\nIf you become caught in a rip current...relax and float. Don't\nswim against the current. If able, swim in a direction following\nthe shoreline. If unable to escape, face the shore and call or\nwave for help.",
        "response": "Avoid",
        "parameters": {
          "NWSheadline": [
            "BEACH HAZARDS STATEMENT NOW IN EFFECT THROUGH TUESDAY EVENING... ...HIGH RIP CURRENT RISK NOW IN EFFECT THROUGH TUESDAY EVENING"
          ],
          "VTEC": [
            "/O.EXT.KAKQ.BH.S.0013.000000T0000Z-191002T0000Z/"
          ],
          "PIL": [
            "AKQCFWAKQ"
          ],
          "BLOCKCHANNEL": [
            "CMAS",
            "EAS",
            "NWEM"
          ],
          "eventEndingTime": [
            "2019-10-01T20:00:00-04:00"
          ]
        }
      }
    }
  ],
  "friendly_name": "NWS Alert Event"
}

I didn’t think about it before but states of any entity are limited to 255 characters. So you are probably coming up against the hard limit on that.

the attributes of entities aren’t subject to that limitation which is why you can use an attribute in, for example, the persistent notification.

That was (still is the issue), I even broke this up into 3 sensors and one (states.sensor.nws_alert_event.attributes.features[0].properties.instruction) is still longer than 255 characters. I could not figure out how to display the attributes of the main sensor (sensor.nws_alert_event) without breaking it out. I guess I dont fully understand how the main sensor can have attributes longer than 255, but that’s ok. I guess what I’d like to know is how could I display just those attributes in Lovelace without requiring a template sensor. Any Help is appreciated

I’m not sure why it’s that way but there is no limit on attribute length that I know of.

in order to get the attributes displayed have you thought about using an entity attributes card?

the only other thing is that the persistent notification in my package above does kind of the same thing only it doesn’t put it into a card. I assume you are looking for something more permanent tho?

I could not figure out how to get the entity attributes card to work for this kind of sensor.

I tried this

type: custom:entity-attributes-card
title: Attributes Card
heading_name: List
heading_state: States
filter:
  include:
    - key: sensor.nws_alert_event_features.properties.headline

and this

type: custom:entity-attributes-card
title: Attributes Card
heading_name: List
heading_state: States
filter:
  include:
    - key: sensor.nws_alert_event_features[0].properties.headline

and this

type: custom:entity-attributes-card
title: Attributes Card
heading_name: List
heading_state: States
filter:
  include:
    - key: sensor.nws_alert_event.attributes.features[0].properties.headline

nothing from any of them.

1 Like

I think I found your solution…

try the built-in markdown card. I’ve used it a couple of times when it was a custom component but completely forgot about it until looking at my old saved configs.

  - type: markdown
    content: >
      {% if states.sensor.nws_alert_event.attributes.features[0] is defined %}
        Headline   
        
        {{states.sensor.nws_alert_event.attributes.features[0].properties.headline }}

        Details
        
        {{states.sensor.nws_alert_event.attributes.features[0].properties.description }}

        Instructions

        {{states.sensor.nws_alert_event.attributes.features[0].properties.instruction }}
      {% else %}
        none
      {% endif %}

ex

you can add titles to it too. I just mimicked the code from your template with data from my test entity.

1 Like

Genius, and it works great!! Never messed with this card, but I already have thoughts on other areas where I can use this. Thanks!

Is the custom component still working under HA 103? I followed all of the instructions in @finity’s repo and added the custom component from here. I’ve added the empty __init__.py file into the custom component folder (nws_alerts). After reboot, I added the sensor information to my sensor config:

  - platform: nws_alerts
    zone_id: 'INZ009, INC033'

When I test the config, I get this error:

Platform error sensor.nws_alerts - No module named 'custom_components.nws_alerts.sensor'

Does anyone have the custom component working on 103? It looks like it hasn’t been updated in the last 8 months.

mine is still working fine.

What does your directory path look like and what files do you have there?

How did you put the files into the directory? did you copy the files from zip, copy from the repo or copy the raw code from the repo?

did you restart HA after copying the files over?

I got it to pass after taking a fresh look. A few notes for future users:

  1. Make sure you change the name of the python file you download from the custom component from nws_alerts.py to sensor.py if you’re using .88 or higher, as directed in the repo’s readme. If you’ve become accustomed to copying repos and adding them directly into your custom components file, it will fail without adjusting the file name.

  2. @finity’s work on this is fantastic. Just a small update to the readme. The line numbers in readme are off by 8 from v 0.0.2 of eracknaphobia’s repo. Line 21 is actually 29, 149 is actually 157, 160 is 168 and 162 is 170. Mind the single quotes–if you copy/paste, you’ll need to adjust the quotes in @finity’s readme from smart quotes to straight quotes.

thanks for pointing out those issues.

I’ve updated my gist to reflect your suggestions.

Glad you got it working.

1 Like

I have been using this component for some time, but tonight, it went crazy. The NWS posted a winter weather advisory and Alexa announced it twice as I expected. But, she then proceeded to keep announcing it every 5 minutes or so. I cannot find where the issue is as I have not changed any code. I ended up commenting out the entire section until I can find a fix. I have the scan interval set to 60.

Any ideas?

Sometimes the NOAA web connection is kind of crappy so it will keep seeing the alert and then it won’t see the alert, then it sees the alert again when the website re-connects. You will probably see those errors in your logs.

Mine has been doing the same thing all day. Except I don’t use alexa for minor warnings (like the 2-4 inches we’re supposed to get here tonight) so just having my pushbullet going crazy isn’t nearly as annoying as a constant barrage of Alexa announcement would be.

So because of that I really haven’t spent much time trying to work out how to deal with a bad connection to NOAA yet.

Mine’s been doing that all day also. I’m down here in Central Texas (Austin area) and we’ve got a winter weather alert going on all day. NWS keeps sending it out every 10-15 minutes. It’s not us… it’s them.

edit: Ha! Just got another one as I type this.

I’ve seen the same thing today. A few unavailable and a few unknown messages came through today along with repeats of the same warning even though it hadn’t been updated.
For clarity the messages that came through literally said unknown and unavailable.

OMG I am seeing this today! We have a freeze warning issued and I am getting sms messages based on my alerting rules non-stop, about every 15 minutes. I am also seeing the standard more than 10 seconds to update in my logs.

I’m getting the same again too.

Maybe I’ll try to see if there’s a way to prevent it if I get some free time today.

The problem I think is going to be how to differentiate between a repeat of the same warning and a brand new warning. The need to react to a new warning is especially important for, say, multiple tornado warnings as we get at times in the spring.

I’ll have to see if the message contains a unique id that I can use.

I think the "messageType" might be the flag you’re looking for.

ie:

"messageType": "Update"

or

"id": "NWS-IDP-PROD-4202809-3552431"