Severe Weather Alerts from the US National Weather Service

Note: if you are using the config via the UI you may get a duplicate sensor due to a better unique ID for the sensor.

I released another update.

This one has added an ā€œevent_statusā€ attribute along with a ā€œStatus:ā€ entry in the display description that was requested by @GlennHA.

Let me know if it works for you or if there are any other issues.

Also, the default value for the update interval was previously 1 minute. In the last prior update that value had gotten changed to 5 minutes. So I reverted that default update interval back to 1 minute so as to not affect anyoneā€™s current install. But you can still change it via the UI or yaml config options if desired.

1 Like

@finity
I keep loosing the NWS integration:

This error originated from a custom integration.
Logger: custom_components.nws_alerts
Source: helpers/update_coordinator.py:219
Integration: NWS Alerts (documentation, issues)
First occurred: August 6, 2021, 9:55:53 PM (3 occurrences)
Last logged: 10:06:53 PM

Error fetching NWS Alerts data: Cannot connect to host api.weather.gov:443 ssl:default [Try again]

It periodically comes back but then is lost again. In fact it just came back as I was writing this.
Based on the log, I donā€™t think it is an integration issue but the NWS side of the house.
I have the check at 5 mins with timeout at 10sec, should I up that?

Yeah, likely itā€™s the NWS.

try the default 120 seconds and see what happens.

TBH, Iā€™m not really sure what the timeout actually does for sure except throw an error?

maybe @firstof9 can chime in and clarify.

EDIT:

To verify itā€™s the API and not the integration you could install the previous version before the update coordinator changes (V1.9.1) and see if it still fails.

Or maybe it was failing before but it was just failing silently. :man_shrugging:

1 Like

I use it in card that auto-hide if there is no alert. When the integration goes away it pops up as a blank card, thatā€™s what keys me in that the integration doesnā€™t report any info. I look at dev tools and it is unavailable. I updated the delay to 120 and see. It was fairly random the last few days.

So, is it recommended to move to yaml from the ui integration?

Going back to 1.9.1 gives my this error:

Logger: homeassistant.config_entries
Source: config_entries.py:501
First occurred: 3:31:44 PM (1 occurrences)
Last logged: 3:31:44 PM

Migration handler not found for entry NWS Alerts for nws_alerts

Not really. You can do it either way.

I tried it and got the same error.

What I had to do was to remove the NWS Alerts integration configuration from the configuration->integrations page. Then uninstall the NWS Alerts integration from HACS.

Restart HA.

Then re-add the integration via HACS (selecting v1.9.1). Then add the integration config back in either via the integrations UI or via yaml.

I guess I should clarify thisā€¦

I have had the API go unavailable in the past (more than you would think) but the only thing that happened was that it would throw an API access error in the logs.

so it wasnā€™t actually ā€œfailing silentlyā€ since there were log entries but to the user it was silent unless you looked in the log. But the integration never showed as ā€œunavailableā€. It just returned 0 alerts.

@firstof9, if the timeout value is reached and the integration goes ā€œunavailableā€ is there any action needed from the user to get it working again or should the integration become available again on its own once the API finally responds?

Once the API starts responding again the everything becomes available again.

EDIT: To be clear the timeout is for that specific API update request, so if the server isnā€™t responding after seconds the connection is assumed dead, if you set it to something high like 300 seconds, this should be fine for slower internet connections.

1 Like

Ok, thanks. I figured so but just wanted to be sure.

1 Like

You lost me at ā€œcreate two sensors.ā€ I am very new to this. Where do I learn how to create new sensors?
This looks like a great automation and I canā€™t wait to try it. Thanks.

You usually will only ever create one sensor in the integration.

Iā€™m not sure you saw ā€œcreate two sensorsā€?

the instructions to get it set up are at the integration Github repository.

Finityā€™s NWS alerts is working really well for me when NWS has issued alerts.

Now Iā€™m wondering if it is possible to get earlier notifications about the possibility of severe weather using the NWS storm prediction center (NWS SPC) information.

One of the iOS weather apps I have installed, MyRadar, generates a ntotification ā€œRisk of severe weather in your area within the next 24 hoursā€. Iā€™m assuming, but could be wrong, that this alert is based on SPC data and when my location is within one of the outlines. I usually get these when the convective outlook shows a risk for my area.

Anyone looked into this at all?

1 Like

No.

But i will have to now! :laughing:

5 Likes

OK, here is what Iā€™ve been able to throw together so far:

first you need to install the ā€œfeedparserā€ custom integration (installed via HACS).

restart HA.

Then create a feedparser sensor entity via configuration.yaml:

sensor:
  - platform: feedparser
    name: NWS SPC Severe Weather Info
    feed_url: 'https://www.spc.noaa.gov/products/spcwwrss.xml'
    scan_interval:
      hours: 1
    inclusions:
      - title
      - link
      - summary
    exclusions:

Then add another template sensor entity (I used the legacy syntax here).

You will replace the name of your state (or whatever other location you want to get info for) in the ā€œlocationā€ and ā€œlocation_capsā€ fields. I needed to do this because I found that both all caps and capitalized location names were used so they are both needed to make sure you get all associated entries.

I used Pennsylvania here as an example since they have current watches in effect:

sensor:
  - platform: template
    sensors:
      watches_warnings:
        friendly_name: "SPC Watches & Warnings"
        value_template: >
          {%- set ns = namespace(events = '') -%}
          {%- set max = states('sensor.nws_spc_severe_weather_info') | int -%}
          {%- set location_caps = 'PENNSYLVANIA' -%}
          {%- set location = 'Pennsylvania' -%}
          {%- for event in range(max) -%}
            {%- if (location_caps in state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary) or (location in state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary) -%}
              {% set d = '#### ' if ns.events | length > 0 else '' %}
              {% set ns.events = ns.events ~ d ~ (state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary.split('<pre>')[1].split('</pre>')[0]) %}
            {%- endif -%}
          {%- endfor -%}
          {% if ns.events.split('####') == [''] %}
            0
          {% else %}
            {{ns.events.split('####') | count}}
          {% endif %}
        attribute_templates:
          events: >
            {%- set ns = namespace(events = '') -%}
            {%- set max = states('sensor.nws_spc_severe_weather_info') | int -%}
            {%- set location_caps = 'PENNSYLVANIA' -%}
            {%- set location = 'Pennsylvania' -%}
            {%- for event in range(max) -%}
              {%- if (location_caps in state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary) or (location in state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary) -%}
                {% set d = '#### ' if ns.events | length > 0 else '' %}
                {% set ns.events = ns.events ~ d ~ (state_attr('sensor.nws_spc_severe_weather_info', 'entries')[event].summary.split('<pre>')[1].split('</pre>')[0]) %}
              {%- endif -%}
            {%- endfor -%}
            {{ns.events}}

from the above template sensor you will get a count of how many watches/warnings are active and the attributes will list them all separated by ā€œ####ā€.

you can then use that info to list them in a card or use them in other automations by the following attributes templates (using an example forecast that contains two different watches for the area someone chose):

{{ state_attr('sensor.watches_warnings', 'events').split('####')[0] }}

or

{{ state_attr('sensor.watches_warnings', 'events').split('####')[1] }}

Try it out and let me know if it works for you.

1 Like

I am trying this out in my Home Assistant as well since I use the Severe Weather Alerts integration. I have the integration change lights colors in my house when a tornado warning is issued in the county I live in.
I am confused though on how to do the very last part with the ā€œstate_attributeā€ lines portion. I donā€™t know how to format that part in the file editor. :confused:

Sorry, that last bit wasnā€™t as clear as it could have been.

I just meant to give examples of how each watch could be accessed individually for whatever purpose the user saw fit.

This new feature is as useful as the Alerts integration because i envision that itā€™s only more informational (longer term watches) than actionable (imminent warnings).

what specifically did you have in mind as a use for the information so I can help you try to work something out if needed?

to start off with I shouldnā€™t have put the ā€œ###########ā€ bit in that last code block. I think it might have became confusing since I also used ā€œ####ā€ in the sensor to separate the different watches in order to split them later.

this would be better (using an example forecast that contains two different watches for the area someone chose):

{{ state_attr('sensor.watches_warnings', 'events').split('####')[0] }}

or

{{ state_attr('sensor.watches_warnings', 'events').split('####')[1] }}

Iā€™ll edit the above post.

Too bad they donā€™t have a proper API setup for this feed :frowning:

2 Likes

I wish I would have stumbled upon this thread before I put all the work I did into creating my own from scratch! Lots of great stuff here. But since I put all that work into mine, I figured I may as well share what I have. Similar to what others that have posted on here. I do most things through NodeRed and Google Home, and have also incorporated the HA companion app for mobile notifications. Since I keep my phone on mute 99% of the time, I also added a notification for Tasker to look for to trigger the volume mode to sound on.

NodeRed Flow

[{"id":"38fcddfdbba401d5","type":"tab","label":"Severe Weather","disabled":false,"info":"","env":[]},{"id":"d410b28b487eeae6","type":"api-current-state","z":"38fcddfdbba401d5","name":"Get Kitchen Volume Level","server":"efbeb294.51685","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.kitchen_display","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":390,"y":780,"wires":[["40743d66726cf908","639deba4bc641566"]]},{"id":"40743d66726cf908","type":"change","z":"38fcddfdbba401d5","name":"Get Current Kitchen Volume","rules":[{"t":"set","p":"kitchen_volume_level","pt":"flow","to":"data.attributes.volume_level","tot":"msg"},{"t":"set","p":"data.attributes.volume_level","pt":"msg","to":"kitchen_volume","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":780,"wires":[["f82b3cbd63a4ed59"]]},{"id":"f82b3cbd63a4ed59","type":"api-call-service","z":"38fcddfdbba401d5","name":"Set Kitchen Vol to 1","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.kitchen_display"],"data":"{\"volume_level\":\"1\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":780,"wires":[["685c69da7061d1b5"]]},{"id":"d0115876ed38204a","type":"change","z":"38fcddfdbba401d5","name":"Recall Temp","rules":[{"t":"set","p":"kitchen_volume_level","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":860,"wires":[["d59b250633685708","709441e31c178320"]]},{"id":"d59b250633685708","type":"api-call-service","z":"38fcddfdbba401d5","name":"Set Kitchen Volume Back","server":"efbeb294.51685","version":5,"debugenabled":true,"domain":"media_player","service":"volume_set","areaId":[],"deviceId":[],"entityId":["media_player.kitchen_display"],"data":"{\"volume_level\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":550,"y":860,"wires":[[]]},{"id":"99ec2be704734b48","type":"link in","z":"38fcddfdbba401d5","name":"Set Both Vols","links":[],"x":215,"y":780,"wires":[["d410b28b487eeae6"]]},{"id":"ea6c8318f1bb932d","type":"link in","z":"38fcddfdbba401d5","name":"Recall Both Vols","links":[],"x":215,"y":860,"wires":[["d0115876ed38204a"]]},{"id":"709441e31c178320","type":"debug","z":"38fcddfdbba401d5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":900,"wires":[]},{"id":"639deba4bc641566","type":"debug","z":"38fcddfdbba401d5","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":470,"y":740,"wires":[]},{"id":"246864e82a7593c8","type":"comment","z":"38fcddfdbba401d5","name":"No Attribute When Idle","info":"When the speaker is idle, there is no volume_level attribute available. Device needs to wake up before a volume level can be recorded.","x":200,"y":1500,"wires":[]},{"id":"685c69da7061d1b5","type":"link out","z":"38fcddfdbba401d5","name":"","mode":"return","links":[],"x":1065,"y":780,"wires":[]},{"id":"7081522fc05ddfb2","type":"comment","z":"38fcddfdbba401d5","name":"Google Home Volume","info":"These sequences record the current volume of the Google Home devices, change them to 10/10, then return the volume level to the previous level using the recorded value.","x":240,"y":700,"wires":[]},{"id":"f2706b35.4906e","type":"ha-get-entities","z":"38fcddfdbba401d5","name":"Retrieve Weather Alert","server":"497693ef.d5e6bc","rules":[{"property":"entity_id","logic":"is","value":"sensor.nws_alerts","valueType":"str"},{"property":"state","logic":"is_not","value":"0","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":320,"y":2040,"wires":[["ff9a7aa4.34c04"]]},{"id":"da43a5e8.36b758","type":"api-call-service","z":"38fcddfdbba401d5","name":"Send Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service":"mobile_app_yourdevicehere","entityId":"","data":"{\"title\":\"Severe Weather Event\",\"message\":\"{{payload}}\"}","dataType":"json","mustacheAltTags":false,"output_location":"","output_location_type":"none","service_domain":"notify","mergecontext":"","x":1680,"y":1887,"wires":[[]]},{"id":"80424c86.40dbe8","type":"server-state-changed","z":"38fcddfdbba401d5","name":"Is there a severe weather event?","server":"497693ef.d5e6bc","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.nws_alerts","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"0","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":260,"y":1968,"wires":[["f2706b35.4906e"],[]]},{"id":"b2a217d7.20bd7","type":"template","z":"38fcddfdbba401d5","name":"Format Weather Alert Description ","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The National Weather Service has issued a ({{payload.0.attributes.title}}) for your area. {{payload.0.attributes.spoken_desc}}","output":"str","x":1090,"y":1887,"wires":[["88a10452.43207"]]},{"id":"88a10452.43207","type":"rbe","z":"38fcddfdbba401d5","name":"Does value match previous value?","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1410,"y":1887,"wires":[["da43a5e8.36b758"]]},{"id":"e913d18a.d31ed8","type":"switch","z":"38fcddfdbba401d5","name":"Type of alert","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"","vt":"str"},{"t":"cont","v":"Watch","vt":"str"},{"t":"cont","v":"Warning","vt":"str"},{"t":"cont","v":"Tornado Warning","vt":"str"},{"t":"cont","v":"Advisory","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":540,"y":1987,"wires":[["c930075.26fa078","a237bab7.efb9f"],["c930075.26fa078"],["693351d.de90c3"],["bdc154a2.f604b"],[]],"outputLabels":["Export all alerts","Export only \"Watch\"","Export only \"Warning\"","Export only \"Tornado Warning\"","Export only \"Advisory\""]},{"id":"8839a3cb.b313f8","type":"template","z":"38fcddfdbba401d5","name":"Format Weather Alert Description ","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The National Weather Service has issued a ({{payload.0.attributes.title}}) for your area. {{payload.0.attributes.spoken_desc}}","output":"str","x":1090,"y":2007,"wires":[["dd62355b.93c268"]]},{"id":"dd62355b.93c268","type":"rbe","z":"38fcddfdbba401d5","name":"Does value match previous value?","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1410,"y":2007,"wires":[["9fa1242a.538a3","b3933094.a5fde8"]]},{"id":"3a54bcd4.937aa4","type":"template","z":"38fcddfdbba401d5","name":"Format Weather Alert Description ","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The National Weather Service has issued a ({{payload.0.attributes.title}}) for your area. {{payload.0.attributes.spoken_desc}}","output":"str","x":1090,"y":2067,"wires":[["419ac4dc.743ed4"]]},{"id":"419ac4dc.743ed4","type":"rbe","z":"38fcddfdbba401d5","name":"Does value match previous value?","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1410,"y":2067,"wires":[["790322e4.9f383c"]]},{"id":"9fa1242a.538a3","type":"cast-to-client","z":"38fcddfdbba401d5","name":"Cast alert to speaker","url":"","contentType":"","message":"","language":"en","ip":"Your IP Here","port":"","volume":"40","x":1699,"y":2007,"wires":[[]]},{"id":"b3933094.a5fde8","type":"api-call-service","z":"38fcddfdbba401d5","name":"Send Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service":"mobile_app_yourdevicehere","entityId":"","data":"{\"title\":\"Severe Weather Event\",\"message\":\"{{payload}}\"}","dataType":"json","mustacheAltTags":false,"output_location":"","output_location_type":"none","service_domain":"notify","mergecontext":"","x":1690,"y":2055,"wires":[[]]},{"id":"790322e4.9f383c","type":"api-call-service","z":"38fcddfdbba401d5","name":"Send Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service":"mobile_app_yourdevicehere","entityId":"","data":"{\"title\":\"Severe Weather Event\",\"message\":\"{{payload}}\"}","dataType":"json","mustacheAltTags":false,"output_location":"","output_location_type":"none","service_domain":"notify","mergecontext":"","x":1690,"y":2107,"wires":[[]]},{"id":"4375289e.b147b","type":"template","z":"38fcddfdbba401d5","name":"Format Full Alert","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The National Weather Service has issued a ({{payload.0.attributes.title}}) for your area. {{payload.0.attributes.display_desc}}","output":"str","x":1042,"y":1947,"wires":[["6f1e33df.08619c"]]},{"id":"2533a297.75979e","type":"e-mail","z":"38fcddfdbba401d5","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"Your Email Address Here","dname":"Send emails","x":1660,"y":1947,"wires":[]},{"id":"6f1e33df.08619c","type":"rbe","z":"38fcddfdbba401d5","name":"Does value match previous value?","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1410,"y":1947,"wires":[["2533a297.75979e"]]},{"id":"ff9a7aa4.34c04","type":"template","z":"38fcddfdbba401d5","name":"Store type of alert","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload.0.attributes.title}}","output":"str","x":420,"y":2100,"wires":[["e913d18a.d31ed8"]]},{"id":"a237bab7.efb9f","type":"ha-get-entities","z":"38fcddfdbba401d5","name":"Retrieve Weather Alert","server":"497693ef.d5e6bc","rules":[{"property":"entity_id","logic":"is","value":"sensor.nws_alerts","valueType":"str"},{"property":"state","logic":"is_not","value":"0","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":800,"y":1887,"wires":[["b2a217d7.20bd7"]]},{"id":"c930075.26fa078","type":"ha-get-entities","z":"38fcddfdbba401d5","name":"Retrieve Weather Alert","server":"497693ef.d5e6bc","rules":[{"property":"entity_id","logic":"is","value":"sensor.nws_alerts","valueType":"str"},{"property":"state","logic":"is_not","value":"0","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":800,"y":1947,"wires":[["4375289e.b147b"]]},{"id":"693351d.de90c3","type":"ha-get-entities","z":"38fcddfdbba401d5","name":"Retrieve Weather Alert","server":"497693ef.d5e6bc","rules":[{"property":"entity_id","logic":"is","value":"sensor.nws_alerts","valueType":"str"},{"property":"state","logic":"is_not","value":"0","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":800,"y":2007,"wires":[["8839a3cb.b313f8"]]},{"id":"bdc154a2.f604b","type":"ha-get-entities","z":"38fcddfdbba401d5","name":"Retrieve Weather Alert","server":"497693ef.d5e6bc","rules":[{"property":"entity_id","logic":"is","value":"sensor.nws_alerts","valueType":"str"},{"property":"state","logic":"is_not","value":"0","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":800,"y":2067,"wires":[["3a54bcd4.937aa4"]]},{"id":"d8441dfd.276d38","type":"cast-to-client","z":"38fcddfdbba401d5","name":"Cast alert to speaker","url":"","contentType":"","message":"","language":"en","ip":"Your IP Here","port":"","volume":"40","x":1700,"y":2156,"wires":[[]]},{"id":"bbb02c1f845771ae","type":"function","z":"38fcddfdbba401d5","name":"","func":"var nwsTitle = global.get(\"nwsTitle\")\nvar nwsDesc = global.get(\"nwsDesc\")\n\nvar desc = msg.title\nmsg.payload = { data: { \"message\": \"The National Weather Service in Milwaukee, Sullivan, has issued a \" + nwsTitle + \"for Okauchee Lake. Details are as follows: \" + nwsDesc} };\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1500,"y":440,"wires":[["f9716b88178bddec"]]},{"id":"f9716b88178bddec","type":"api-call-service","z":"38fcddfdbba401d5","name":"Google TTS","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"tts","service":"cloud_say","areaId":[],"deviceId":[],"entityId":["media_player.kitchen_display","media_player.rv_bedroom_speaker"],"data":"{\"message\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1670,"y":440,"wires":[["0b6557ff481b90fd"]]},{"id":"c3f592aba7e7e68a","type":"api-current-state","z":"38fcddfdbba401d5","name":"nws title","server":"efbeb294.51685","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.nws_alerts_title","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"nwsTitle","propertyType":"global","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":700,"y":120,"wires":[[]]},{"id":"4d96a3f4552e41d2","type":"api-current-state","z":"38fcddfdbba401d5","name":"nws desc","server":"efbeb294.51685","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.nws_alerts_desc","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"nwsDesc","propertyType":"global","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":700,"y":180,"wires":[[]]},{"id":"3f74e7e35cd56e73","type":"server-state-changed","z":"38fcddfdbba401d5","name":"NWS Alerts >0","server":"efbeb294.51685","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.nws_alerts","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"10","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":220,"wires":[["03fae32616d66de8"]]},{"id":"8f290a4e16d3d128","type":"api-current-state","z":"38fcddfdbba401d5","name":"Someone Home?","server":"efbeb294.51685","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":730,"y":420,"wires":[["9bb2383b2a3a0c25"],[]]},{"id":"135a9ea48e129ad8","type":"api-current-state","z":"38fcddfdbba401d5","name":"Someone Home?","server":"efbeb294.51685","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.home","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":730,"y":540,"wires":[["56a56eaded11fec4"],[]]},{"id":"2c54541fd915774f","type":"api-current-state","z":"38fcddfdbba401d5","name":"1+ Alerts","server":"efbeb294.51685","version":3,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.nws_alerts_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":520,"wires":[["135a9ea48e129ad8","ce3f087c07bfb965"],[]]},{"id":"0b6557ff481b90fd","type":"delay","z":"38fcddfdbba401d5","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"hours","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1880,"y":500,"wires":[["30c6deaa8bd898a8"]]},{"id":"ce3f087c07bfb965","type":"link out","z":"38fcddfdbba401d5","name":"","mode":"link","links":["f9a5fa7996b92e74"],"x":655,"y":480,"wires":[]},{"id":"f9a5fa7996b92e74","type":"link in","z":"38fcddfdbba401d5","name":"","links":["ce3f087c07bfb965"],"x":425,"y":120,"wires":[["c3f592aba7e7e68a","4d96a3f4552e41d2","e5a8ac004999e2dd","83b7d123401f78a0"]]},{"id":"9bb2383b2a3a0c25","type":"switch","z":"38fcddfdbba401d5","name":"Severity","property":"nwsSeverity","propertyType":"global","rules":[{"t":"cont","v":"Extreme","vt":"str"},{"t":"cont","v":"Severe","vt":"str"},{"t":"eq","v":"Moderate","vt":"str"},{"t":"eq","v":"Minor","vt":"str"},{"t":"eq","v":"Low","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":920,"y":420,"wires":[["941ac290f60f9161","f879b5be024f2fd7","fdb7ed1c53aaca7b"],["fdb7ed1c53aaca7b","941ac290f60f9161","f879b5be024f2fd7"],["5b46caabec8b7b5e"],["5b46caabec8b7b5e"],["5b46caabec8b7b5e"]]},{"id":"30c6deaa8bd898a8","type":"link out","z":"38fcddfdbba401d5","name":"","mode":"link","links":["d0be10c7d4a06742"],"x":1985,"y":500,"wires":[]},{"id":"d0be10c7d4a06742","type":"link in","z":"38fcddfdbba401d5","name":"","links":["30c6deaa8bd898a8"],"x":425,"y":520,"wires":[["2c54541fd915774f"]]},{"id":"e5a8ac004999e2dd","type":"api-current-state","z":"38fcddfdbba401d5","name":"nws severity","server":"efbeb294.51685","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.nws_alerts","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":710,"y":240,"wires":[["f5a956a9844ffac3"]]},{"id":"f5a956a9844ffac3","type":"change","z":"38fcddfdbba401d5","name":"nwsSeverity","rules":[{"t":"move","p":"data.attributes.event_severity","pt":"msg","to":"nwsSeverity","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":240,"wires":[[]]},{"id":"83b7d123401f78a0","type":"api-current-state","z":"38fcddfdbba401d5","name":"nws spoken desc","server":"efbeb294.51685","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.nws_alerts","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":730,"y":300,"wires":[["74911f4e4768ed9f"]]},{"id":"74911f4e4768ed9f","type":"change","z":"38fcddfdbba401d5","name":"nwsSpokenDesc","rules":[{"t":"move","p":"data.attributes.spoken_desc","pt":"msg","to":"nwsSpokenDesc","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":300,"wires":[[]]},{"id":"63afd365edeb6507","type":"api-call-service","z":"38fcddfdbba401d5","name":"","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":["157c8fbc7fda49008ddfce0816ebcba7","d732e023b4675552893801d7f742cd5d"],"entityId":[],"data":"{\"media_content_id\":\"/local/sound/NWS Alert Beginning.mp3\",\"media_content_type\":\"music\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1650,"y":500,"wires":[[]]},{"id":"fdb7ed1c53aaca7b","type":"delay","z":"38fcddfdbba401d5","name":"","pauseType":"delay","timeout":"24","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1340,"y":440,"wires":[["bbb02c1f845771ae"]]},{"id":"941ac290f60f9161","type":"link out","z":"38fcddfdbba401d5","name":"","mode":"link","links":["efd738ceef937123"],"x":1105,"y":400,"wires":[]},{"id":"f879b5be024f2fd7","type":"link call","z":"38fcddfdbba401d5","name":"","links":["ec370e666205933c"],"timeout":"1","x":1280,"y":500,"wires":[["614249307e24b92a"]]},{"id":"614249307e24b92a","type":"delay","z":"38fcddfdbba401d5","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1440,"y":500,"wires":[["63afd365edeb6507"]]},{"id":"5b46caabec8b7b5e","type":"time-range-switch","z":"38fcddfdbba401d5","name":"","lat":"","lon":"","startTime":"22:00","endTime":"10:00","startOffset":0,"endOffset":0,"x":1090,"y":440,"wires":[[],["f879b5be024f2fd7","fdb7ed1c53aaca7b"]]},{"id":"810d38e434315965","type":"delay","z":"38fcddfdbba401d5","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":540,"y":420,"wires":[["8f290a4e16d3d128"]]},{"id":"03fae32616d66de8","type":"switch","z":"38fcddfdbba401d5","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":220,"wires":[["810d38e434315965","c3f592aba7e7e68a","4d96a3f4552e41d2","e5a8ac004999e2dd","83b7d123401f78a0"]]},{"id":"efd738ceef937123","type":"link in","z":"38fcddfdbba401d5","name":"Phone Notification","links":["941ac290f60f9161"],"x":1415,"y":800,"wires":[["0d0c42f57570afe9","612ad1f0cb242354"]]},{"id":"0d0c42f57570afe9","type":"function","z":"38fcddfdbba401d5","name":"MSG","func":"var nwsTitle=global.get('nwsTitle');\nvar nwsDesc=global.get('nwsDesc');\nvar nwsSpokenDesc=global.get('nwsSpokenDesc');\nvar nwsSeverity=global.get('nwsSeverity');\n\nmsg.payload = {\n    data:{\n        \"title\": nwsSeverity + \" Weather Alert - \" + nwsTitle,\n        \"message\": nwsSpokenDesc + \"<br><br>\" + nwsDesc,\n        \"data\": {\n            \"tag\": \"weatherAlert\",\n            \"notification_icon\": \"mdi:alert\",\n            \"clickAction\": \"/lovelace/test-ground\"\n        }\n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1550,"y":840,"wires":[["843522601dea0ab2","a26cce9e9a688ed4"]]},{"id":"843522601dea0ab2","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Ryan","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_ryan_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":820,"wires":[[]]},{"id":"a26cce9e9a688ed4","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Nicole","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_nicole_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":880,"wires":[[]]},{"id":"612ad1f0cb242354","type":"function","z":"38fcddfdbba401d5","name":"Tasker MSG","func":"msg.payload = {\n    data:{\n        \"title\": \"WEATHER ALERT\",\n        \"message\": \"\"\n        }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1570,"y":760,"wires":[["97996912e5a3e4d8"]]},{"id":"97996912e5a3e4d8","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Ryan","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_ryan_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":760,"wires":[[]]},{"id":"17cc9d1b371833d5","type":"comment","z":"38fcddfdbba401d5","name":"HA & Tasker Notification","info":"","x":1550,"y":700,"wires":[]},{"id":"11ef4fc650e13a5b","type":"function","z":"38fcddfdbba401d5","name":"","func":"var nwsTitle = global.get(\"nwsTitle\")\nvar nwsDesc = global.get(\"nwsDesc\")\nvar desc = msg.title\n\nmsg.payload = { data: { \"message\": \"This is a reminder that there is currently a \" + nwsTitle + \" for your area.\"} };\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1580,"y":560,"wires":[["16c40ff4c673cc52"]]},{"id":"16c40ff4c673cc52","type":"api-call-service","z":"38fcddfdbba401d5","name":"Google TTS","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"tts","service":"cloud_say","areaId":[],"deviceId":[],"entityId":["media_player.kitchen_display","media_player.rv_bedroom_speaker"],"data":"{\"message\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":560,"wires":[["0b6557ff481b90fd"]]},{"id":"56a56eaded11fec4","type":"switch","z":"38fcddfdbba401d5","name":"Severity","property":"nwsSeverity","propertyType":"global","rules":[{"t":"cont","v":"Extreme","vt":"str"},{"t":"cont","v":"Severe","vt":"str"},{"t":"eq","v":"Moderate","vt":"str"},{"t":"eq","v":"Minor","vt":"str"},{"t":"eq","v":"Low","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":920,"y":560,"wires":[["1cfa9eb433e598b6","1bf4daf68d916ab6"],["1cfa9eb433e598b6","1bf4daf68d916ab6"],["2a23a2a9227289a8"],["2a23a2a9227289a8"],["2a23a2a9227289a8"]]},{"id":"2a23a2a9227289a8","type":"time-range-switch","z":"38fcddfdbba401d5","name":"","lat":"","lon":"","startTime":"22:00","endTime":"10:00","startOffset":0,"endOffset":0,"x":1090,"y":580,"wires":[[],["1bf4daf68d916ab6"]]},{"id":"1cfa9eb433e598b6","type":"link out","z":"38fcddfdbba401d5","name":"","mode":"link","links":["b14db23dd0b36943"],"x":1105,"y":540,"wires":[]},{"id":"1bf4daf68d916ab6","type":"link call","z":"38fcddfdbba401d5","name":"","links":["ec370e666205933c"],"timeout":"1","x":1280,"y":560,"wires":[["744f476dcb83f67e"]]},{"id":"744f476dcb83f67e","type":"delay","z":"38fcddfdbba401d5","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1440,"y":560,"wires":[["11ef4fc650e13a5b"]]},{"id":"b14db23dd0b36943","type":"link in","z":"38fcddfdbba401d5","name":"Phone Notification Reminder","links":["1cfa9eb433e598b6"],"x":1415,"y":1000,"wires":[["9c96eac1a7b5603c","ad8ff6e00e9c01ae"]]},{"id":"9c96eac1a7b5603c","type":"function","z":"38fcddfdbba401d5","name":"MSG","func":"var nwsTitle=global.get('nwsTitle');\nvar nwsDesc=global.get('nwsDesc');\nvar nwsSpokenDesc=global.get('nwsSpokenDesc');\nvar nwsSeverity=global.get('nwsSeverity');\n\nmsg.payload = {\n    data:{\n        \"title\": nwsSeverity + \" Weather Reminder\",\n        \"message\": nwsTitle,\n        \"data\": {\n            \"tag\": \"weatherAlert\",\n            \"notification_icon\": \"mdi:alert\",\n            \"clickAction\": \"/lovelace/test-ground\"\n        }\n    }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1550,"y":1040,"wires":[["a95609cb3f54d946","25a277bb3ec28097"]]},{"id":"a95609cb3f54d946","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Ryan","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_ryan_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":1020,"wires":[[]]},{"id":"25a277bb3ec28097","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Nicole","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_nicole_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":1080,"wires":[[]]},{"id":"ad8ff6e00e9c01ae","type":"function","z":"38fcddfdbba401d5","name":"Tasker MSG","func":"msg.payload = {\n    data:{\n        \"title\": \"WEATHER ALERT\",\n        \"message\": \"\"\n        }\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1570,"y":960,"wires":[["9afcdb9a7f1ce932"]]},{"id":"9afcdb9a7f1ce932","type":"api-call-service","z":"38fcddfdbba401d5","name":"Notify Ryan","server":"efbeb294.51685","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_ryan_s_phone","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":960,"wires":[[]]},{"id":"efbeb294.51685","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"497693ef.d5e6bc","type":"server","name":"Home Assistant"}]
1 Like

Any chance to share your mp3 you are using?