I offer this piston up for review/critique/duplication/edit/use to anyone wishing to help with TWC weather alert notifications. This piston compares new alerts to our current known wiki database. New alerts can be sent as singles like [Special Weather Statement] or as multiples [Special Weather Statement], [Tropical Storm Watch], [Tornado Watch], so I needed to parse them. This piston will hopefully cut down on the number of known/null alerts and notify us of new alerts that need to be added to the wiki. Please feel free to make comments or suggestions.
$twcweather.alerts Observations
I like what you are doing here, @Pantheon…
A couple of questions though:
(1) Why are you querying “$twcweather.alerts.eventDescription
” at least four times back-to-back?!?
(I recommend only one query per run, and then referencing the variable
that you just set for the remainder of the piston)
(2) Why are you setting the same data to three different variables
? (lines 30, 34 & 35)
(3) This one is petty, but it looks like you are stripping down {weatherAlertCurrent} so it no longer contains the current alert. If it were me, I would leave that data intact to display the entire alert, but use a new variable
{alertParse} to specifically track the new data…
Again, this last one is entirely cosmetic, but just be aware that currently, {weatherAlertCurrent} will not contain all of the current weather alerts.
I did not intend to keep all of the weatherAlertCurrent if it contained multiple alerts because some of them may be alerts we already have. Nonetheless, your idea looks better.
Better?
EDIT : The following piston is the most current version with the suggested changes. Test it if you like. Please let me know if it needs tweaking. I will let it run a few days and see if it works with real data.
While it is still fresh in my mind…
All 4 of the latest posts have been added to the Wiki now.
New Additions (and contributors):
- Flood Warning (@Pantheon)
On one of them, I was only able to add partial information:
- Wind Chill Advisory was TRUNCATED (@SergL)
… and two of them, I believe was already listed:
- Winter Weather Advisory was already on the Wiki (@dejavux2)
- Flash Flood Watch was already on the Wiki (@Pantheon)
Thanks again for everyone’s ongoing contributions!!
Speaking of partial information… @Pantheon, can you please remove:
Flood Watch & High Wind Watch
from your {Alert_Data}…??
My logic is those two do not have all the data recorded on the Wiki.
Also, please do not add the new one (Wind Chill Advisory) to that variable
yet, since that one was also TRUNCATED.
Looking at your last piston now…
That’s my bad, didn’t get to it in time so had to pull it out of the logs.
Keeping an eye out on this new piston though!
It happens to us all…
One method to avoid that is to send it via SMS. Most phones can handle very long texts, and they do not auto-delete.
I am still not getting any weather alerts, so I am unable to test your latest piston, @Pantheon, but at first glance, I cannot see any obvious issues.
Perhaps you can update the image above with the new {Alert_Data} and test it for a few days??
One thing that I would probably add for testing is the block on lines 49-60. I would make the ELSE block write to the log. This way, when you do not get a SMS, the log will show why.
(keep it short & sweet though, because it will be writing nearly every 15 mins)
Pro Tip:
If lines 55 & 56 go to the same phone, you can reduce your SMS by combining those two lines.
(meaning less likely to go over your daily SMS limit)
@WCmore think we got a new one! Not sure what it meant locally since it was an average day.
[[adminDistrict:Florida, adminDistrictCode:FL, areaId:FLZ046, areaName:Seminole County, areaTypeCode:Z, categories:[[category:Met, categoryCode:2]], certainty:Likely, certaintyCode:2, countryCode:US, countryName:UNITED STATES OF AMERICA, detailKey:59c84822-209b-3703-9cb3-4be5f3aeeafa, disclaimer:null, effectiveTimeLocal:2020-02-29T12:00:00-05:00, effectiveTimeLocalTimeZone:EST, eventDescription:Red Flag Warning, eventTrackingNumber:0001, expireTimeLocal:2020-02-29T19:00:00-05:00, expireTimeLocalTimeZone:EST, expireTimeUTC:1583020800, flood:null, headlineText:Red Flag Warning from SAT 12:00 PM EST until SAT 7:00 PM EST, ianaTimeZone:America/New_York, identifier:9061bbdd7688412173508c36bf3061bf, issueTimeLocal:2020-02-29T04:25:00-05:00, issueTimeLocalTimeZone:EST, latitude:, longitude:, messageType:New, messageTypeCode:1, officeAdminDistrict:Florida, officeAdminDistrictCode:FL, officeCode:KMLB, officeCountryCode:US, officeName:Melbourne, onsetTimeLocal:2020-02-29T12:00:00-05:00, onsetTimeLocalTimeZone:EST, phenomena:FW, processTimeUTC:1582968363, productIdentifier:RFW, responseTypes:[[responseType:Prepare, responseTypeCode:3]], severity:Severe, severityCode:2, significance:W, source:National Weather Service, urgency:Expected, urgencyCode:2]]
Actually, I would like to get usage data now. So please feel free to run it and see what we get. I am in a relatively weather-quite part of the country so we do not get alerts that often.
Thanks for the new information!! I had to look this one up…
Red Flag Warning
Definition:
Informs land management agencies of the imminent or actual occurrence of Red Flag conditions
. A Red Flag Warning will be issued when there is high confidence that Red Flag criteria will be met within the next 24 to 48 hours, or when those criteria are already being met or exceeded. A warning may be issued for all, or portions of a fire weather zone or region. Zones impacted by the event will be listed within the Red Flag Warning product.
Criteria:
A combination of weather and fuels conditions
(as determined by fire management) for any 3 hours or more in a 12 hour period. These criteria for the forecast area of the Denver/Boulder NWS office are defined as the following:
- Frequent gusts of 25 mph or greater – AND relative humidity of 15% or less
- Dry thunderstorms (15% coverage or more, constituting an LAL 6.)
OTHER FACTORS:
In addition to the basic criteria above, a combination of other elements may result in Red Flag Conditions
:
- Haines Index of 5 or 6, indicating a moderate or high potential for large, plume dominated fire growth.
- Wind shifts associated with frontal passages.
- First significant lightning event (wet or dry) after an extended hot and dry period.
- Poor relative humidity recovery overnight (RH remains at 40% or lower.)
- Any combination of weather and fuel moisture
conditions
which, in the judgment of the forecaster, would cause extensive wildfire occurrences.
[adminDistrict:Tennessee, adminDistrictCode:TN, areaId:TNC093, areaName:Knox County, areaTypeCode:C, categories:[[category:Met, categoryCode:2]], certainty:Observed, certaintyCode:1, countryCode:US, countryName:UNITED STATES OF AMERICA, detailKey:ec35619b-dfba-3ace-aa74-8be473079c5e, disclaimer:null, effectiveTimeLocal:2020-03-03T04:35:00-05:00, effectiveTimeLocalTimeZone:EST, eventDescription:Tornado Warning, eventTrackingNumber:0006, expireTimeLocal:2020-03-03T05:00:00-05:00, expireTimeLocalTimeZone:EST, expireTimeUTC:1583229600, flood:null, headlineText:Tornado Warning from TUE 4:35 AM EST until TUE 5:00 AM EST, ianaTimeZone:America/New_York, identifier:2c30520dc5cf0df2f30646437567f301, issueTimeLocal:2020-03-03T04:35:00-05:00, issueTimeLocalTimeZone:EST, latitude:00.00, longitude:00.00, messageType:New, messageTypeCode:1, officeAdminDistrict:Tennessee, officeAdminDistrictCode:TN, officeCode:KMRX, officeCountryCode:US, officeName:Knoxville/Tri-Cities, onsetTimeLocal:2020-03-03T04:35:00-05:00, onsetTimeLocalTimeZone:EST, phenomena:TO, processTimeUTC:1583228147, productIdentifier:TOR, responseTypes:[[responseType:Shelter, responseTypeCode:1]], severity:Extreme, severityCode:1, significance:W, source:National Weather Service, urgency:Immediate, urgencyCode:1]]
I have modified my piston to alert me of any tornado alert using all of my Alexa devices. How often can I (should I) query TWC for those alerts?
I really wish we could use bad weather alerts as a trigger
…
… but since we cannot yet, I would recommend pinging for weather alerts no more than 4 times an hour. My logic is, SmartThings has to pay for each & every one of our queries. If we use (abuse) it too much, then ST will likely start charging us for that data…