Severe Weather Warnings

Posted on
Sat Apr 12, 2014 11:21 am
zabazoom offline
Posts: 56
Joined: Nov 09, 2013

Severe Weather Warnings

Hi,
Has anyone come up with a good way to monitor Weather warnings down to general location. I have Weathersnoop (tied to a local waetherunderground station), NOAA, And NOAA+, but none of these will allow me to monitor local severe conditions. Any Ideas?
Ja

Posted on
Sat Apr 12, 2014 8:07 pm
zabazoom offline
Posts: 56
Joined: Nov 09, 2013

Re: Severe Weather Warnings

Hi,
So after a day of digging into something I didn't know. It looks like there is a way. Looks like NOAA and FEMA, Use Common Alerting Protocol (CAP) is an XML-based data format for exchanging public warnings and emergencies between alerting technologies. NOAA puts out NWS Public Alerts in XML/CAP and ATOM Formats http://alerts.weather.gov/ that has the Storm alerts and looks like Geo fencing of the Areas effected. Since I'm not a programmer is there a way to parse the data into something that can be used as Indigo plugin, I guess what I'm really asking is there any Python Masters that want a challenge? :D
Ja

Posted on
Sat Apr 12, 2014 9:23 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

This would be a nice plugin, but in the interim, the NOAA Weather Plus and Weather Underground plugins both provide weather advisory information that should be easy to manipulate with triggers & variables.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Sat Apr 12, 2014 11:02 pm
zabazoom offline
Posts: 56
Joined: Nov 09, 2013

Re: Severe Weather Warnings

Bollar wrote:
This would be a nice plugin, but in the interim, the NOAA Weather Plus and Weather Underground plugins both provide weather advisory information that should be easy to manipulate with triggers & variables.


The problem for me is that while NOAA+ has a weather advisory it's located so far from me as to be useless, it covers to large of a area. I have set up a couple of push emails and since we are expecting more storms I should in the next couple of days be able to see if the msgs they send are use full, I do wonder about time lag from them.

Posted on
Sun Apr 13, 2014 5:51 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Severe Weather Warnings

Bollar wrote:
This would be a nice plugin, but in the interim, the NOAA Weather Plus and Weather Underground plugins both provide weather advisory information that should be easy to manipulate with triggers & variables.

The problem with the Weather Underground plugin for severe weather is that if there's more than one alert, the device state will be populated with the "last" alert. In other words, if there are three alerts, the state will hold the third.

I still need to figure out the best way to attack multiple alerts.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Apr 13, 2014 1:03 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

Well, here's a brute force attempt to get the data. We don't have access to the FEMA version of the data and the NWS version lags by 2-3 minutes. You could schedule this to run every 30-60 seconds. The most granular level you can get is by county -- there's possibility that you could do some coding against the polygon data, but not every alert has the data. To use this script, you'd have to add the variables to Indigo, change the county code and replace the variable ids with those assigned by indigo.

There are other fields I could capture, but this was just to prove it could be done.
Code: Select all
import urllib2
from xml.dom.minidom import parseString


# download the file
theUrl = 'http://alerts.weather.gov/cap/wwaatmget.php?x=TXC439&y=1'
# theUrl = 'http://alerts.weather.gov/cap/wwaatmget.php?x=ARC093&y=1'


f = urllib2.urlopen(theUrl)

theXml = f.read()

theDocTree = parseString(theXml)

# HEADER
noaaAlertID0 = theDocTree.getElementsByTagName("id")[0].firstChild.data
noaaAlertGenerator0 = theDocTree.getElementsByTagName("generator")[0].firstChild.data
noaaAlertUpdated0 = theDocTree.getElementsByTagName("updated")[0].firstChild.data
noaaAlertAuthor0 = theDocTree.getElementsByTagName("name")[0].firstChild.data
noaaAlertTitle0 = theDocTree.getElementsByTagName("title")[0].firstChild.data

# ALERT 1
try:
   noaaAlertID1 = theDocTree.getElementsByTagName("id")[1].firstChild.data
   noaaAlertUpdated1 = theDocTree.getElementsByTagName("updated")[1].firstChild.data
   noaaAlertPublished1 = theDocTree.getElementsByTagName("published")[0].firstChild.data
   noaaAlertAuthor1 = theDocTree.getElementsByTagName("name")[1].firstChild.data
   noaaAlertTitle1 = theDocTree.getElementsByTagName("title")[1].firstChild.data
   noaaAlertSummary1 = theDocTree.getElementsByTagName("summary")[0].firstChild.data
   noaaAlertCapEvent1 = theDocTree.getElementsByTagName("cap:event")[0].firstChild.data
   noaaAlertCapEffective1 = theDocTree.getElementsByTagName("cap:effective")[0].firstChild.data
   noaaAlertCapExpires1 = theDocTree.getElementsByTagName("cap:expires")[0].firstChild.data
   noaaAlertCapStatus1 = theDocTree.getElementsByTagName("cap:status")[0].firstChild.data
   noaaAlertCapMsgType1 = theDocTree.getElementsByTagName("cap:msgType")[0].firstChild.data
   noaaAlertCapCategory1 = theDocTree.getElementsByTagName("cap:category")[0].firstChild.data
   noaaAlertCapUrgency1 = theDocTree.getElementsByTagName("cap:urgency")[0].firstChild.data
   noaaAlertCapSeverity1 = theDocTree.getElementsByTagName("cap:severity")[0].firstChild.data
   noaaAlertCapCertainly1 = theDocTree.getElementsByTagName("cap:certainty")[0].firstChild.data
   noaaAlertCapAreaDesc1 = theDocTree.getElementsByTagName("cap:areaDesc")[0].firstChild.data
   noaaAlertPolygon1Temp = theDocTree.getElementsByTagName("cap:polygon")[0].firstChild.data
   noaaAlertPolygon1 = '[(' + noaaAlertPolygon1Temp.replace(' ', '),(') + ')]'

except IndexError, e:
   noaaAlertID1 = ""
   noaaAlertUpdated1 = ""
   noaaAlertPublished1 = ""
   noaaAlertAuthor1 = ""
   noaaAlertTitle1 = ""
   noaaAlertSummary1 = ""
   noaaAlertCapEvent1 = ""
   noaaAlertCapEffective1 = ""
   noaaAlertCapExpires1 = ""
   noaaAlertCapStatus1 = ""
   noaaAlertCapMsgType1 = ""
   noaaAlertCapCategory1 = ""
   noaaAlertCapUrgency1 = ""
   noaaAlertCapSeverity1 = ""
   noaaAlertCapCertainly1 = ""
   noaaAlertCapAreaDesc1 = ""
   noaaAlertPolygon1 = ""

except AttributeError, e: # Needed because cap:polygon is sometimes missing
   noaaAlertPolygon1 = ""


# ALERT 2
try:
   noaaAlertID2 = theDocTree.getElementsByTagName("id")[2].firstChild.data
   noaaAlertUpdated2 = theDocTree.getElementsByTagName("updated")[2].firstChild.data
   noaaAlertPublished2 = theDocTree.getElementsByTagName("published")[1].firstChild.data
   noaaAlertAuthor2 = theDocTree.getElementsByTagName("name")[2].firstChild.data
   noaaAlertTitle2 = theDocTree.getElementsByTagName("title")[2].firstChild.data
   noaaAlertSummary2 = theDocTree.getElementsByTagName("summary")[1].firstChild.data
   noaaAlertCapEvent2 = theDocTree.getElementsByTagName("cap:event")[1].firstChild.data
   noaaAlertCapEffective2 = theDocTree.getElementsByTagName("cap:effective")[1].firstChild.data
   noaaAlertCapExpires2 = theDocTree.getElementsByTagName("cap:expires")[1].firstChild.data
   noaaAlertCapStatus2 = theDocTree.getElementsByTagName("cap:status")[1].firstChild.data
   noaaAlertCapMsgType2 = theDocTree.getElementsByTagName("cap:msgType")[1].firstChild.data
   noaaAlertCapCategory2 = theDocTree.getElementsByTagName("cap:category")[1].firstChild.data
   noaaAlertCapUrgency2 = theDocTree.getElementsByTagName("cap:urgency")[1].firstChild.data
   noaaAlertCapSeverity2 = theDocTree.getElementsByTagName("cap:severity")[1].firstChild.data
   noaaAlertCapCertainly2 = theDocTree.getElementsByTagName("cap:certainty")[1].firstChild.data
   noaaAlertCapAreaDesc2 = theDocTree.getElementsByTagName("cap:areaDesc")[1].firstChild.data
   noaaAlertPolygon2Temp = theDocTree.getElementsByTagName("cap:polygon")[1].firstChild.data
   noaaAlertPolygon2 = '[(' + noaaAlertPolygon2Temp.replace(' ', '),(') + ')]'

except IndexError, e:
   noaaAlertID2 = ""
   noaaAlertUpdated2 = ""
   noaaAlertPublished2 = ""
   noaaAlertAuthor2 = ""
   noaaAlertTitle2 = ""
   noaaAlertSummary2 = ""
   noaaAlertCapEvent2 = ""
   noaaAlertCapEffective2 = ""
   noaaAlertCapExpires2 = ""
   noaaAlertCapStatus2 = ""
   noaaAlertCapMsgType2 = ""
   noaaAlertCapCategory2 = ""
   noaaAlertCapUrgency2 = ""
   noaaAlertCapSeverity2 = ""
   noaaAlertCapCertainly2 = ""
   noaaAlertCapAreaDesc2 = ""
   noaaAlertPolygon2 = ""

except AttributeError, e: # Needed because cap:polygon is sometimes missing
   noaaAlertPolygon2 = ""

# ALERT 3
try:
   noaaAlertID3 = theDocTree.getElementsByTagName("id")[3].firstChild.data
   noaaAlertUpdated3 = theDocTree.getElementsByTagName("updated")[3].firstChild.data
   noaaAlertPublished3 = theDocTree.getElementsByTagName("published")[2].firstChild.data
   noaaAlertAuthor3 = theDocTree.getElementsByTagName("name")[3].firstChild.data
   noaaAlertTitle3 = theDocTree.getElementsByTagName("title")[3].firstChild.data
   noaaAlertSummary3 = theDocTree.getElementsByTagName("summary")[2].firstChild.data
   noaaAlertCapEvent3 = theDocTree.getElementsByTagName("cap:event")[2].firstChild.data
   noaaAlertCapEffective3 = theDocTree.getElementsByTagName("cap:effective")[2].firstChild.data
   noaaAlertCapExpires3 = theDocTree.getElementsByTagName("cap:expires")[2].firstChild.data
   noaaAlertCapStatus3 = theDocTree.getElementsByTagName("cap:status")[2].firstChild.data
   noaaAlertCapMsgType3 = theDocTree.getElementsByTagName("cap:msgType")[2].firstChild.data
   noaaAlertCapCategory3 = theDocTree.getElementsByTagName("cap:category")[2].firstChild.data
   noaaAlertCapUrgency3 = theDocTree.getElementsByTagName("cap:urgency")[2].firstChild.data
   noaaAlertCapSeverity3 = theDocTree.getElementsByTagName("cap:severity")[2].firstChild.data
   noaaAlertCapCertainly3 = theDocTree.getElementsByTagName("cap:certainty")[2].firstChild.data
   noaaAlertCapAreaDesc3 = theDocTree.getElementsByTagName("cap:areaDesc")[2].firstChild.data
   noaaAlertPolygon3Temp = theDocTree.getElementsByTagName("cap:polygon")[2].firstChild.data
   noaaAlertPolygon3 = '[(' + noaaAlertPolygon3Temp.replace(' ', '),(') + ')]'

except IndexError, e:
   noaaAlertID3 = ""
   noaaAlertUpdated3 = ""
   noaaAlertPublished3 = ""
   noaaAlertAuthor3 = ""
   noaaAlertTitle3 = ""
   noaaAlertSummary3 = ""
   noaaAlertCapEvent3 = ""
   noaaAlertCapEffective3 = ""
   noaaAlertCapExpires3 = ""
   noaaAlertCapStatus3 = ""
   noaaAlertCapMsgType3 = ""
   noaaAlertCapCategory3 = ""
   noaaAlertCapUrgency3 = ""
   noaaAlertCapSeverity3 = ""
   noaaAlertCapCertainly3 = ""
   noaaAlertCapAreaDesc3 = ""
   noaaAlertPolygon3 = ""

except AttributeError, e: # Needed because cap:polygon is sometimes missing
   noaaAlertPolygon3 = ""

# ALERT 4
try:
   noaaAlertID4 = theDocTree.getElementsByTagName("id")[4].firstChild.data
   noaaAlertUpdated4 = theDocTree.getElementsByTagName("updated")[4].firstChild.data
   noaaAlertPublished4 = theDocTree.getElementsByTagName("published")[3].firstChild.data
   noaaAlertAuthor4 = theDocTree.getElementsByTagName("name")[4].firstChild.data
   noaaAlertTitle4 = theDocTree.getElementsByTagName("title")[4].firstChild.data
   noaaAlertSummary4 = theDocTree.getElementsByTagName("summary")[3].firstChild.data
   noaaAlertCapEvent4 = theDocTree.getElementsByTagName("cap:event")[3].firstChild.data
   noaaAlertCapEffective4 = theDocTree.getElementsByTagName("cap:effective")[3].firstChild.data
   noaaAlertCapExpires4 = theDocTree.getElementsByTagName("cap:expires")[3].firstChild.data
   noaaAlertCapStatus4 = theDocTree.getElementsByTagName("cap:status")[3].firstChild.data
   noaaAlertCapMsgType4 = theDocTree.getElementsByTagName("cap:msgType")[3].firstChild.data
   noaaAlertCapCategory4 = theDocTree.getElementsByTagName("cap:category")[3].firstChild.data
   noaaAlertCapUrgency4 = theDocTree.getElementsByTagName("cap:urgency")[3].firstChild.data
   noaaAlertCapSeverity4 = theDocTree.getElementsByTagName("cap:severity")[3].firstChild.data
   noaaAlertCapCertainly4 = theDocTree.getElementsByTagName("cap:certainty")[3].firstChild.data
   noaaAlertCapAreaDesc4 = theDocTree.getElementsByTagName("cap:areaDesc")[3].firstChild.data
   noaaAlertPolygon4Temp = theDocTree.getElementsByTagName("cap:polygon")[3].firstChild.data
   noaaAlertPolygon4 = '[(' + noaaAlertPolygon4Temp.replace(' ', '),(') + ')]'

except IndexError, e:
   noaaAlertID4 = ""
   noaaAlertUpdated4 = ""
   noaaAlertPublished4 = ""
   noaaAlertAuthor4 = ""
   noaaAlertTitle4 = ""
   noaaAlertSummary4 = ""
   noaaAlertCapEvent4 = ""
   noaaAlertCapEffective4 = ""
   noaaAlertCapExpires4 = ""
   noaaAlertCapStatus4 = ""
   noaaAlertCapMsgType4 = ""
   noaaAlertCapCategory4 = ""
   noaaAlertCapUrgency4 = ""
   noaaAlertCapSeverity4 = ""
   noaaAlertCapCertainly4 = ""
   noaaAlertCapAreaDesc4 = ""
   noaaAlertPolygon4 = ""

except AttributeError, e: # Needed because cap:polygon is sometimes missing
   noaaAlertPolygon4 = ""

# WRITE HEADER TO INDIGO
indigo.variable.updateValue(251912902, value=str(noaaAlertID0)) # "noaaAlert0ID"
indigo.variable.updateValue(488888730, value=str(noaaAlertGenerator0)) # "noaaAlert0Generator"
indigo.variable.updateValue(1041636278, value=str(noaaAlertUpdated0)) # "noaaAlert0Updated"
indigo.variable.updateValue(851481444, value=str(noaaAlertAuthor0)) # "noaaAlert0Author"
indigo.variable.updateValue(414199120, value=str(noaaAlertTitle0)) # "noaaAlert0Title"

# WRITE ALERT 1 TO INDIGO
indigo.variable.updateValue(970579805, value=str(noaaAlertID1)) # "noaaAlertID1"
indigo.variable.updateValue(451934914, value=str(noaaAlertUpdated1)) # "noaaAlertUpdated1"
indigo.variable.updateValue(45734687, value=str(noaaAlertPublished1)) # "noaaAlertPublished1"
indigo.variable.updateValue(530210630, value=str(noaaAlertAuthor1)) # "noaaAlertAuthor1"
indigo.variable.updateValue(1508190911, value=str(noaaAlertTitle1)) # "noaaAlertTitle1"
indigo.variable.updateValue(27131104, value=str(noaaAlertSummary1)) # "noaaAlertSummary1"
indigo.variable.updateValue(507770105, value=str(noaaAlertCapEvent1)) # "noaaAlertCapEvent1"
indigo.variable.updateValue(1350045247, value=str(noaaAlertCapEffective1)) # "noaaAlertCapEffective1"
indigo.variable.updateValue(1045605899, value=str(noaaAlertCapExpires1)) # "noaaAlertCapExpires1"
indigo.variable.updateValue(1694945345, value=str(noaaAlertCapStatus1)) # "noaaAlertCapStatus1" Actual, Excercise, System, Test, Draft
indigo.variable.updateValue(361396269, value=str(noaaAlertCapMsgType1)) # "noaaAlertCapMsgType1" Alert, Update, Cancel, Ack, Error
indigo.variable.updateValue(636093119, value=str(noaaAlertCapCategory1)) # "noaaAlertCapCategory1" Geo, Met, Safety, Security, Rescue, Fire, Health, Env, Transport, Infra, CBRNE, Other
indigo.variable.updateValue(101309718, value=str(noaaAlertCapUrgency1)) # "noaaAlertCapUrgency1" Immediate, Expected, Future, Past Unknown
indigo.variable.updateValue(431261270, value=str(noaaAlertCapSeverity1)) # "noaaAlertCapSeverity1" Extreme, Severe, Moderate, Minor, Unknown
indigo.variable.updateValue(6635718, value=str(noaaAlertCapCertainly1)) # "noaaAlertCapCertainty1" Observed, Likely, Possible, Unlikely, Unknown
indigo.variable.updateValue(1574026820, value=str(noaaAlertCapAreaDesc1)) # "noaaAlertCapAreaDesc1"
indigo.variable.updateValue(1823083030, value=str(noaaAlertPolygon1)) # "noaaAlertPolygon1"

# WRITE ALERT 2 TO INDIGO
indigo.variable.updateValue(1818783764, value=str(noaaAlertID2)) # "noaaAlertID2"
indigo.variable.updateValue(1676631089, value=str(noaaAlertUpdated2)) # "noaaAlertUpdated2"
indigo.variable.updateValue(318906496, value=str(noaaAlertPublished2)) # "noaaAlertPublished2"
indigo.variable.updateValue(367560147, value=str(noaaAlertAuthor2)) # "noaaAlertAuthor2"
indigo.variable.updateValue(1084941128, value=str(noaaAlertTitle2)) # "noaaAlertTitle2"
indigo.variable.updateValue(958812312, value=str(noaaAlertSummary2)) # "noaaAlertSummary2"
indigo.variable.updateValue(1429059287, value=str(noaaAlertCapEvent2)) # "noaaAlertCapEvent2"
indigo.variable.updateValue(146835994, value=str(noaaAlertCapEffective2)) # "noaaAlertCapEffective2"
indigo.variable.updateValue(657166470, value=str(noaaAlertCapExpires2)) # "noaaAlertCapExpires2"
indigo.variable.updateValue(34992235, value=str(noaaAlertCapStatus2)) # "noaaAlertCapStatus2" Actual, Excercise, System, Test, Draft
indigo.variable.updateValue(520328817, value=str(noaaAlertCapMsgType2)) # "noaaAlertCapMsgType2" Alert, Update, Cancel, Ack, Error
indigo.variable.updateValue(1721937615, value=str(noaaAlertCapCategory2)) # "noaaAlertCapCategory2" Geo, Met, Safety, Security, Rescue, Fire, Health, Env, Transport, Infra, CBRNE, Other
indigo.variable.updateValue(1674307807, value=str(noaaAlertCapUrgency2)) # "noaaAlertCapUrgency2" Immediate, Expected, Future, Past Unknown
indigo.variable.updateValue(1381376882, value=str(noaaAlertCapSeverity2)) # "noaaAlertCapSeverity2" Extreme, Severe, Moderate, Minor, Unknown
indigo.variable.updateValue(78500200, value=str(noaaAlertCapCertainly2)) # "noaaAlertCapCertainty2" Observed, Likely, Possible, Unlikely, Unknown
indigo.variable.updateValue(653615352, value=str(noaaAlertCapAreaDesc2)) # "noaaAlertCapAreaDesc2"
indigo.variable.updateValue(856990534, value=str(noaaAlertPolygon2)) # "noaaAlertPolygon2"

# WRITE ALERT 3 TO INDIGO
indigo.variable.updateValue(250611685, value=str(noaaAlertID3)) # "noaaAlertID3"
indigo.variable.updateValue(660531607, value=str(noaaAlertUpdated3)) # "noaaAlertUpdated3"
indigo.variable.updateValue(1866465128, value=str(noaaAlertPublished3)) # "noaaAlertPublished3"
indigo.variable.updateValue(1601846800, value=str(noaaAlertAuthor3)) # "noaaAlertAuthor3"
indigo.variable.updateValue(1576616853, value=str(noaaAlertTitle3)) # "noaaAlertTitle3"
indigo.variable.updateValue(51231625, value=str(noaaAlertSummary3)) # "noaaAlertSummary3"
indigo.variable.updateValue(1019018204, value=str(noaaAlertCapEvent3)) # "noaaAlertCapEvent3"
indigo.variable.updateValue(1318897258, value=str(noaaAlertCapEffective3)) # "noaaAlertCapEffective3"
indigo.variable.updateValue(1593320108, value=str(noaaAlertCapExpires3)) # "noaaAlertCapExpires3"
indigo.variable.updateValue(1380632583, value=str(noaaAlertCapStatus3)) # "noaaAlertCapStatus3" Actual, Excercise, System, Test, Draft
indigo.variable.updateValue(1709855541, value=str(noaaAlertCapMsgType3)) # "noaaAlertCapMsgType3" Alert, Update, Cancel, Ack, Error
indigo.variable.updateValue(473568572, value=str(noaaAlertCapCategory3)) # "noaaAlertCapCategory3" Geo, Met, Safety, Security, Rescue, Fire, Health, Env, Transport, Infra, CBRNE, Other
indigo.variable.updateValue(372339663, value=str(noaaAlertCapUrgency3)) # "noaaAlertCapUrgency3" Immediate, Expected, Future, Past Unknown
indigo.variable.updateValue(1676970597, value=str(noaaAlertCapSeverity3)) # "noaaAlertCapSeverity3" Extreme, Severe, Moderate, Minor, Unknown
indigo.variable.updateValue(1139743337, value=str(noaaAlertCapCertainly3)) # "noaaAlertCapCertainty3" Observed, Likely, Possible, Unlikely, Unknown
indigo.variable.updateValue(487568757, value=str(noaaAlertCapAreaDesc3)) # "noaaAlertCapAreaDesc1"
indigo.variable.updateValue(667083469, value=str(noaaAlertPolygon3)) # "noaaAlertPolygon3"

# WRITE ALERT 4 TO INDIGO
indigo.variable.updateValue(1399660509, value=str(noaaAlertID4)) # "noaaAlertID4"
indigo.variable.updateValue(1661417371, value=str(noaaAlertUpdated4)) # "noaaAlertUpdated4"
indigo.variable.updateValue(450104477, value=str(noaaAlertPublished4)) # "noaaAlertPublished4"
indigo.variable.updateValue(1237945019, value=str(noaaAlertAuthor4)) # "noaaAlertAuthor4"
indigo.variable.updateValue(547657858, value=str(noaaAlertTitle4)) # "noaaAlertTitle4"
indigo.variable.updateValue(326675971, value=str(noaaAlertSummary4)) # "noaaAlertSummary4"
indigo.variable.updateValue(1499896221, value=str(noaaAlertCapEvent4)) # "noaaAlertCapEvent4"
indigo.variable.updateValue(56670747, value=str(noaaAlertCapEffective4)) # "noaaAlertCapEffective4"
indigo.variable.updateValue(232105237, value=str(noaaAlertCapExpires4)) # "noaaAlertCapExpires4"
indigo.variable.updateValue(1249037109, value=str(noaaAlertCapStatus4)) # "noaaAlertCapStatus4" Actual, Excercise, System, Test, Draft
indigo.variable.updateValue(1610819848, value=str(noaaAlertCapMsgType4)) # "noaaAlertCapMsgType4" Alert, Update, Cancel, Ack, Error
indigo.variable.updateValue(1954312401, value=str(noaaAlertCapCategory4)) # "noaaAlertCapCategory4" Geo, Met, Safety, Security, Rescue, Fire, Health, Env, Transport, Infra, CBRNE, Other
indigo.variable.updateValue(1035974472, value=str(noaaAlertCapUrgency4)) # "noaaAlertCapUrgency4" Immediate, Expected, Future, Past Unknown
indigo.variable.updateValue(1701840599, value=str(noaaAlertCapSeverity4)) # "noaaAlertCapSeverity4" Extreme, Severe, Moderate, Minor, Unknown
indigo.variable.updateValue(393185168, value=str(noaaAlertCapCertainly4)) # "noaaAlertCapCertainty4" Observed, Likely, Possible, Unlikely, Unknown
indigo.variable.updateValue(341984009, value=str(noaaAlertCapAreaDesc4)) # "noaaAlertCapAreaDesc4"
indigo.variable.updateValue(804386241, value=str(noaaAlertPolygon4)) # "noaaAlertPolygon4"

indigo.server.log("Last NOAA Alert Update: " + str(noaaAlertUpdated0))


And here's the code pulled from NWS:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href='http://alerts.weather.gov/cap/capatom.xsl' type='text/xsl'?>
<!--
This atom/xml feed is an index to active advisories, watches and warnings
issued by the National Weather Service.  This index file is not the complete
Common Alerting Protocol (CAP) alert message.  To obtain the complete CAP
alert, please follow the links for each entry in this index.  Also note the
CAP message uses a style sheet to convey the information in a human readable
format.  Please view the source of the CAP message to see the complete data
set.  Not all information in the CAP message is contained in this index of
active alerts.
-->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:cap="urn:oasis:names:tc:emergency:cap:1.1" xmlns:ha="http://www.alerting.net/namespace/index_1.0">
   <!-- TZN = <CDT> -->
   <!-- TZO = <-5> -->
   <!-- http-date = Sun, 13 Apr 2014 04:50:00 GMT -->
   <id>http://alerts.weather.gov/cap/wwaatmget.php?x=TXC439&amp;y=0</id>
   <generator>NWS CAP Server</generator>
   <updated>2014-04-13T11:50:00-05:00</updated>
   <author>
      <name>w-nws.webmaster@noaa.gov</name>
   </author>
   <title>Current Watches, Warnings and Advisories for Tarrant (TXC439) Texas Issued by the National Weather Service</title>
   <link href="http://alerts.weather.gov/cap/wwaatmget.php?x=TXC439&amp;y=0" />
   <entry>
      <id>http://alerts.weather.gov/cap/wwacapget.php?x=TX12514E2C1DC8.WindAdvisory.12514E390290TX.FWDNPWFWD.cd331d01680eb21ed8f27e386c74bb2e</id>
      <updated>2014-04-13T11:50:00-05:00</updated>
      <published>2014-04-13T11:50:00-05:00</published>
      <author>
         <name>w-nws.webmaster@noaa.gov</name>
      </author>
      <title>Wind Advisory issued April 13 at 11:50AM CDT until April 13 at 8:00PM CDT by NWS</title>
      <link href="http://alerts.weather.gov/cap/wwacapget.php?x=TX12514E2C1DC8.WindAdvisory.12514E390290TX.FWDNPWFWD.cd331d01680eb21ed8f27e386c74bb2e" />
      <summary>...A WIND ADVISORY REMAINS IN EFFECT FOR THE WESTERN TWO THIRDS OF NORTH TEXAS THROUGH 8 PM... .DEEP SURFACE LOW PRESSURE CENTERED IN OKLAHOMA WILL RESULT IN A STRONG AND GUSTY SOUTH WIND ALONG AND WEST OF A SHERMAN... CORSICANA...TO HEARNE LINE. WIND SPEEDS WILL RANGE FROM 20 TO 30 MPH WITH SOME GUSTS IN EXCESS OF 35 MPH. WIND SPEEDS WILL</summary>
      <cap:event>Wind Advisory</cap:event>
      <cap:effective>2014-04-13T11:50:00-05:00</cap:effective>
      <cap:expires>2014-04-13T20:00:00-05:00</cap:expires>
      <cap:status>Actual</cap:status>
      <cap:msgType>Alert</cap:msgType>
      <cap:category>Met</cap:category>
      <cap:urgency>Expected</cap:urgency>
      <cap:severity>Minor</cap:severity>
      <cap:certainty>Likely</cap:certainty>
      <cap:areaDesc>Bell; Bosque; Collin; Comanche; Cooke; Coryell; Dallas; Denton; Eastland; Ellis; Erath; Falls; Grayson; Hamilton; Hill; Hood; Jack; Johnson; Lampasas; Limestone; McLennan; Milam; Mills; Montague; Navarro; Palo Pinto; Parker; Robertson; Rockwall; Somervell; Stephens; Tarrant; Wise; Young</cap:areaDesc>
      <cap:polygon />
      <cap:geocode>
         <valueName>FIPS6</valueName>
         <value>048027 048035 048085 048093 048097 048099 048113 048121 048133 048139 048143 048145 048181 048193 048217 048221 048237 048251 048281 048293 048309 048331 048333 048337 048349 048363 048367 048395 048397 048425 048429 048439 048497 048503</value>
         <valueName>UGC</valueName>
         <value>TXZ091 TXZ092 TXZ093 TXZ100 TXZ101 TXZ102 TXZ103 TXZ104 TXZ115 TXZ116 TXZ117 TXZ118 TXZ119 TXZ120 TXZ129 TXZ130 TXZ131 TXZ132 TXZ133 TXZ134 TXZ141 TXZ142 TXZ143 TXZ144 TXZ145 TXZ146 TXZ156 TXZ157 TXZ158 TXZ159 TXZ160 TXZ161 TXZ174 TXZ175</value>
      </cap:geocode>
      <cap:parameter>
         <valueName>VTEC</valueName>
         <value>/O.CON.KFWD.WI.Y.0011.000000T0000Z-140414T0100Z/</value>
      </cap:parameter>
   </entry>
</feed>
Last edited by Bollar on Sun Apr 13, 2014 10:21 pm, edited 2 times in total.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Sun Apr 13, 2014 5:34 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

So, continuing on my research, I now have four alerts tracked, and I have two triggers. One will iMessage me if there is a Severe or Extreme alert.

Code: Select all
   "Any" "of the following rules are true"
      "If variable" noaaAlert1CapSeverity "is equal to" "value" "Severe"
      "If variable" noaaAlert2CapSeverity "is equal to" "value" "Severe"
      "If variable" noaaAlert1CapSeverity "is equal to" "value" "Extreme"
      "If variable" noaaAlert2CapSeverity "is equal to" "value" "Extreme"
      "If variable" noaaAlert3CapSeverity "is equal to" "value" "Severe"
      "If variable" noaaAlert3CapSeverity "is equal to" "value" "Extreme"
      "If variable" noaaAlert4CapSeverity "is equal to" "value" "Severe"
      "If variable" noaaAlert4CapSeverity "is equal to" "value" "Extreme"


The other will turn all lights in the house on when there's an Extreme alert. I will probably have it chirp the alarm system once I figure out how to do that.

I have updated the code above to my current version.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Sun Apr 13, 2014 6:25 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

Just had the first change. WUnderground sent me a push notification ~15 seconds before Indigo. The script runs every 30 seconds. I guess I could increase the frequency, but I don't want to be abusive.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Mon Apr 14, 2014 5:27 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

I have been watching the storms pass through Mississippi. It looks like the NOAA Alert arrives faster than my other push notifications most of the time. In some cases 10 minutes earlier -- which seems important for tornado warnings. I also wrote a script that looks at the polygon data and determines if the lat/lon you specify is in the polygon, which is especially important for special weather statements (where tornado touchdowns are typically reported). Here are the current versions of both:

viewtopic.php?p=78935#p78935

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Mon Apr 14, 2014 11:43 pm
zabazoom offline
Posts: 56
Joined: Nov 09, 2013

Re: Severe Weather Warnings

very cool I'll be looking at this in depth later today
Thanks

Posted on
Tue Apr 15, 2014 7:00 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

This is the kind of thing that would be well suited for a plug-in. With the standardized data formats, I can see how a talented coder could store the alerts in SQL and manage the numerous variables and possible combinations from there. Each alert has a unique identifier, so that would help control dupes.

- I also noticed that the alerts appear to be presented sequentially - newest first. I think it's unlikely you would miss a "Special Weather Statement" alert, given the script is tracking four alerts.

- I had several instances where all four alerts were in use simultaneously, but number four was always older and was a watch / advisory. I'm sure it's possible to have more than four, so I would probably extend the script to five or more alerts at some point.

- It would be interesting to have direct access to the FEMA data. IPAWS uses the same format, so it may just be a matter of pointing to a new url. Unfortunately, the system seems designed to prevent the public from getting access.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Tue Apr 15, 2014 7:40 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

Here's a screenshot of the first two sets of variables. Note that this alert doesn't have a polygon, so the polygon test script hasn't executed. The Alert0 group are headers that should appear even if there are no active alerts.

Image

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Tue Apr 22, 2014 11:32 am
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

We had another set of storms come through and this script sent notifications faster than any my iPhone apps.

I did notice that WU is using a different alert system -- they are also reporting thunderstorms forecast near an airport as a severe thunderstorm warning. In this case, the NWS had only issued a watch, so WU was incorrect.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Thu May 08, 2014 2:28 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: Severe Weather Warnings

Another set of storms passing through today. Indigo is reporting the updates 1:30 - 3 minutes ahead of my next closest app. It's also successfully filtering out the polygon-enhanced warnings that don't impact us.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Fri May 09, 2014 10:19 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Severe Weather Warnings

Nice! Though much about making it a plugin? ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 22 guests