$twcweather.alerts Observations



Thanks @st_kbron. As soon as a few others post, I will go thru the process of adding them all to the Wiki.


Uggg… This is so frustrating!


Still, not a single alert in my location…


@WCmore. I think you need to move lol. I’ve been getting a lot but nothing new that hasn’t already been reported.


Well, in some ways, I am happy to live in paradise…
It just makes programming for alerts much tougher, LOL


@WCmore, not a weather alert. Not sure if this helps any.

Alert.length changed from 0 to 1

[[adminDistrict:Tennessee, adminDistrictCode:TN, areaId:TNC093, areaName:Knox County, areaTypeCode:C, categories:[[category:Other, categoryCode:12]], certainty:Unknown, certaintyCode:5, countryCode:US, countryName:UNITED STATES OF AMERICA, detailKey:7a48738b-5487-30f5-8b8d-ee74ddc4f863, disclaimer:null, effectiveTimeLocal:null, effectiveTimeLocalTimeZone:null, eventDescription:Child Abduction Emergency, eventTrackingNumber:0000, expireTimeLocal:2019-09-06T21:59:00-04:00, expireTimeLocalTimeZone:EDT, expireTimeUTC:1567821540, flood:null, headlineText:Child Abduction Emergency until FRI 9:59 PM EDT, ianaTimeZone:America/New_York, identifier:6e250092e881cc3ff9a07be4ecc1bc00, issueTimeLocal:2019-09-06T20:08:00-04:00, issueTimeLocalTimeZone:EDT, latitude:00.00, longitude:00.00, messageType:New, messageTypeCode:1, officeAdminDistrict:Tennessee, officeAdminDistrictCode:TN, officeCode:KOHX,

officeCountryCode:US, officeName:Nashville, onsetTimeLocal:null, onsetTimeLocalTimeZone:null, phenomena:TCA, processTimeUTC:1567814929, productIdentifier:CAE, responseTypes:[[responseType:Avoid, responseTypeCode:5]], severity:Moderate, severityCode:3, significance:L, source:National Weather Service, urgency:Unknown, urgencyCode:5]]


I am impressed that it notifies us of child abductions!

Edit :
…although a bit confused as to why the “significance” is the same as “Air Quality Alerts”…?!?


The Wiki has been updated with the last three alerts.
Thanks everyone for your continued contributions.

New additions:

  • Child Abduction Emergency
  • Tropical Storm Watch
  • Tropical Weather Statement
  • responseTypes.responseType = Prepare


I’ve been monitoring these down here in Sydney (Australia) as we went through a few days of severe gale force winds, so here’s a few of my observations:

.issueTimeLocal and UTC seems to be the time the alert was posted.
.updateTimeLocal or UTC shows when the alert was last updated. If not updated since issue, it’ll will be the same as issueTime.(may be a regional variation)
.effectiveTimeLocal and UTC seems to be the time the event is expected to occur.
.onsetTimeLocal and UTC appears to be the same as effectiveTime.
.expireTimeLocal and UTC shows when the alert is to be regarded as expired (can ignore).

Here’s a place to get some more of the event codes: https://www.weather.gov/NWR/eventcodes

I use the issueTime in my piston to determine if an alert is new or updated recently and then alert. I also evaluate the effectiveTime to warn of imminent events (say occurring in the next hour) and the recommended responseType to suggest the action to take.

I have also set up a piston to log each new alert to a spreadsheet, so hopefully can contribute that set of data soon.


If you don’t mind, I would love to see this piston :slight_smile:


Here’s a simplified version that “should” still work, that demonstrates the principle. It polls hourly and builds the notification message only if the alert found is new of updated within the last hour, or if the even occurring is imminent (in the next hour). Outside of that range it assumes it has seen new/updates in the previous hour or the event occurence (effectiveTime) is still more than an hour ahead.

updated to reflect correct logic evaluation on alert times and time conversions.


Thanks for your contributions, @AvronW.
Your observations have been added to the Wiki

Also, thanks for sharing that link to weather.gov.
Some of that data matches $twcweather, but some definitely does not.

Use that data with caution


I see no reference to either of these dataPoints in any of the alerts…

Perhaps you meant .processTimeUTC…??


It seems to be inconsistently used, so perhaps only shows up if they’ve modified a previously issued alert.
I’ll share those that I do manage to log to the spreadsheet, as soon as I have a good collection.


Well, it takes quite a bit of work for me to add each one to the Wiki… so it may be better if you only share the unique alerts, to save me from getting grey hair too early, LOL


Hey WCMore, can you help me work out why dates are miss-evaluated when calling $twcweather.alerts dates that fall exactly at midnight?

for example:
$twcweather.alerts[0].onsetTimeLocal returns “onsetTimeLocal:2019-09-16T00:00:00+10:00”,

datetime($twcweather.alerts[0].onsetTimeLocal) returns “Sun, Sep 15 2019 @ 12:00:00 AM AEST
That’s one full day behind the time specified!

This makes evaluating those dates a little tricky.


I remember a similiar bug about 18 months ago… Long before TWC came around… If memory serves me right, I think it was because one part of the code utilized daylight saving time, and another part of the code did not… so depending on which part of the code was gathering (or translating) the data, midnight may be Saturday at 11, or Sunday at 12. And of course, with the date wrong, I can easily see how the final output appears to be 24 hours off.

I suspect this only occurs during Daylight saving time.
(maybe because part of Australia observes DST, and part does not?)

Side note:
I think this fiasco can be avoided if you do your math with the UTC time