Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NWS Weather Alert Driver
#1
Ok, I'm starting into this, as I'm not happy with my weather parsing macro, and I'm less daunted about working with the CAP format, thanks to some help from jrlewis and fonc's xml parsing code.

However, I will take some input on what you'd expect from fields for this. Here is what I can see so far, parsing directly from the CAP fields:

Event: String, enumerated. This is the actual alert ("Severe Thunderstorm Warning")
EffectiveTime: Time, Time alert is effective
ExpireTime: Time, Time alert expires
Urgency: String
Severity: String
Certainty: String
Instruction: String
Description: String
Title: String
InPolygon: String, enumerated. Either True, False, or Not Available. This takes the lat/lon polygon info, if available, and compares it to the CQC lat/lon you entered when you installed. If you just picked a "close" city for your lat/lon, then this won't be much use. But if you put in your actual lat/lon, this could be handy. You'll also have the option, on driver install, of inputting a different lat/lon. Just leave it blank to use the cqc-install values.
SpecialAlert: Boolean. This is true if the NWS Event matches an event in the user-selected list of events. During driver install, you will select which events you want this field to turn true for. This allows you to tailor which NWS alerts you trigger events for. This field will also turn true if the weather alert severity is Extreme and urgency is Immediate. This field will stay true as long as any alert matches those conditions.
AlertValid: Boolean. This is meant to tell you if the alert fields are in use. This is because there might be more alert fields than actual alerts (since you choose the number of alert fields on install). This boolean will allow you to adjust the number of widgets displayed on the interface based on whether fields _____X are in use or not.
NumAlerts: Card. Number of alerts for your area, even if this exceeds the number you select for display during driver install.


Things to note:

To get your county code, go to http://www.weather.gov/alerts-beta/ and click on the county list for your state. Find your 6 character code and enter it during the install.

User Events
If a weather event comes up that matches one of the events you selected on install, OR the alert severity is Extreme and urgency is Immediate, then a User Defined Event will be generated that you can use to trigger actions.

The first list of events you select on install are for use in case of extreme danger/immediate action type of weather events. They will send the following event type and data:

EventType: WeatherAlert
EventData: <The actual weather event that triggered this> (for instance "Tornado Warning")

The event will be sent out every time a matching alert is received. Note that if two of the same weather event occur, only one user event will be sent out.

The second list of events you select on install are for use just as notification. These can be used when you want to know that something is happening, but it's not a life or death issue, or maybe you don't care to be woken up by it. Either way, it's just another event that you can trigger off of.

EventType: WeatherNotification
EventData: <The actual weather event that triggered this> (for instance "Severe Thunderstorm Warning")


Good luck, and AGAIN...do not rely on this thing alone if you are in a bad weather part of the country (aka Texas). I don't get paid enough to have you stake your life on this driver working.

[EDIT: I (Dean) updated the driver here for two reasons. One is to make it handle URL redirection by the NWS web server, and the other is for changes introduced in 4.2.907 to catch a previously uncaught error in CML code, which affected the CML library that this driver and others of Robs used. It should be backwards compatible as well.]


Attached Files
.cqcdrvpack   NWSWeatherAlert_Dev_1_0.CQCDrvPack (Size: 15.02 KB / Downloads: 18)
Reply
#2
Looks good and I cannot wait!

Could you add "user defined alerts" or somthing like that that only displays alerts that we set at the driver's installation? I don't neccessarily want to react to every alert. If this isn't done in the driver, then it will require either a macro or a bunch of if/else statements on my end.

So a method to say I want the userdefined field to show the RSS feed when it is a tornado watch/warning, severe thunderstorm watch/warning, etc. Meanwhile the Event field will still pass every alert in case you need to act on those as well.

It would be really nice to simply have all the alerts listed in the driver setup, and you simply check which alerts you want to have in the userdefined field.
Brian - a long time user that rarely messes with the system now
Other systems used:
SageTV w/ cablecard tuner & multiple extenders for viewing
BlueIris and IP cameras for CCTV
Incredible PBX for home phone
Reply
#3
sic0048 Wrote:Looks good and I cannot wait!
It would be really nice to simply have all the alerts listed in the driver setup, and you simply check which alerts you want to have in the userdefined field.

That would be nice. However, this is the complete list of possible events...
+--------------------------------------------+
| Tsunami Warning |
| Tornado Warning |
| Extreme Wind Warning |
| Severe Thunderstorm Warning |
| Flash Flood Warning |
| Shelter In Place Warning |
| Evacuation Immediate |
| Civil Danger Warning |
| Nuclear Power Plant Warning |
| Radiological Hazard Warning |
| Hazardous Materials Warning |
| Fire Warning |
| Civil Emergency Message |
| Law Enforcement Warning |
| Hurricane Force Wind Warning |
| Hurricane Wind Warning |
| Hurricane Warning |
| Typhoon Warning |
| Special Marine Warning |
| Blizzard Warning |
| Ice Storm Warning |
| Tropical Storm Wind Warning |
| Heavy Snow Warning |
| Winter Storm Warning |
| High Wind Warning |
| Tropical Storm Warning |
| Storm Warning |
| Tsunami Watch |
| Avalanche Warning |
| Earthquake Warning |
| Volcano Warning |
| Coastal Flood Warning |
| Lakeshore Flood Warning |
| Flood Warning |
| High Surf Warning |
| Sleet Warning |
| Lake Effect Snow Warning |
| Excessive Heat Warning |
| Dust Storm Warning |
| Tornado Watch |
| Severe Thunderstorm Watch |
| Flash Flood Watch |
| Severe Weather Statement |
| Flash Flood Statement |
| Gale Warning |
| Flood Statement |
| Tsunami Advisory |
| Wind Chill Warning |
| Extreme Cold Warning |
| Hard Freeze Warning |
| Freeze Warning |
| Red Flag Warning |
| Hurricane Watch |
| Typhoon Watch |
| Hurricane Statement |
| Typhoon Statement |
| Snow and Blowing Snow Advisory |
| Freezing Rain Advisory |
| Freezing Drizzle Advisory |
| Sleet Advisory |
| Winter Weather Advisory |
| Lake Effect Snow and Blowing Snow Advisory |
| Lake Effect Snow Advisory |
| Wind Chill Advisory |
| Heat Advisory |
| Hydrologic Advisory |
| Lakeshore Flood Advisory |
| Coastal Flood Advisory |
| Flood Advisory |
| High Surf Advisory |
| Blowing Snow Advisory |
| Snow Advisory |
| Heavy Freezing Spray Warning |
| Dense Smoke Advisory |
| Small Craft Advisory |
| Brisk Wind Advisory |
| Hazardous Seas Warning |
| Dense Fog Advisory |
| Lake Wind Advisory |
| Wind Advisory |
| Blowing Dust Advisory |
| Frost Advisory |
| Ashfall Advisory |
| Freezing Fog Advisory |
| Freezing Spray Advisory |
| Air Stagnation Advisory |
| Low Water Advisory |
| Local Area Emergency |
| Avalanche Watch |
| Blizzard Watch |
| Tropical Storm Wind Watch |
| Tropical Storm Watch |
| Hurricane Wind Watch |
| Winter Storm Watch |
| Coastal Flood Watch |
| Lakeshore Flood Watch |
| Flood Watch |
| High Wind Watch |
| Excessive Heat Watch |
| Extreme Cold Watch |
| Wind Chill Watch |
| Lake Effect Snow Watch |
| Freeze Watch |
| Fire Weather Watch |
| Extreme Fire Danger |
| Child Abduction Emergency |
| 911 Telephone Outage |
| Coastal Flood Statement |
| Lakeshore Flood Statement |
| Special Weather Statement |
| Marine Weather Statement |
| Air Quality Alert |
| Hard Freeze Watch |
| Hurricane Force Wind Watch |
| Storm Watch |
| Gale Watch |
| Hazardous Seas Watch |
| Heavy Freezing Spray Watch |
| Ashfall Warning |
+--------------------------------------------+

Soo...I don't think a check box will do it, especially since it's 1 check box per manifest page....

I see what you're saying, and I agree it's a good idea. I don't want to be woken up for severe thunderstorms, but I do for a Volcano Warning!
Reply
#4
beelzerob Wrote:Ok, I'm starting into this, as I'm not happy with my weather parsing macro, and I'm less daunted about working with the CAP format, thanks to some help from jrlewis and fonc's xml parsing code.

However, I will take some input on what you'd expect from fields for this. Here is what I can see so far, parsing directly from the CAP fields:

Event: String, enumerated. This is the actual alert ("Severe Thunderstorm Warning")
EffectiveTime: Time, Time alert is effective
ExpireTime: Time, Time alert expires
Urgency: String
Severity: String
Certainty: String
Instruction: String
Description: String
InAlertArea: String, enumerated. Either True, False, or Not Available. This takes the lat/lon polygon info, if available, and compares it to the CQC lat/lon you entered when you installed. If you just picked a "close" city for your lat/lon, then this won't be much use. But if you put in your actual lat/lon, this could be handy.

I'm also thinking that if for some reason I don't get the feed from NWS, I'll throw the driver offline. I want it to be evident that the feed isn't working, so you'll know to get your alert info some other way.

Any thoughts?

This would be really nice to have.

Not sure I know enough yet to give any great ideas, except that as already mentioned, there are only a few warnings that probably need to be escalated to announcements vs. just showing on the IV and if there were a way to have the driver indicate which category a warning were in, that would be useful.
Reply
#5
Well, I can't think of anything automatic for you to key off of. Unfortunately I can't find the range of values for Severity and Urgency, or you could just use those...but I think Severe Thunderstorms are also "Severe" and "Immediate".

I really don't want to write yet another driver that has to rely on some user input file...I so tire of those. And there's also the lurking danger that someone spells Tornada wrong, and so you'll never get that alert.

Of course, I also put the disclaimer on this driver that it's "For entertainment purposes only...". Do NOT stake the safety of your family on the reliability of this driver.
Reply
#6
Actually, you might be able to just key off the Severity field. I saved some feeds from last night in Ohio where they had some Tornado warnings, and the Severity was "Extreme", not Severe. So I'm guessing the "it can kill you right now" kind of weather earns the Extreme tag.
Reply
#7
beelzerob Wrote:Actually, you might be able to just key off the Severity field. I saved some feeds from last night in Ohio where they had some Tornado warnings, and the Severity was "Extreme", not Severe. So I'm guessing the "it can kill you right now" kind of weather earns the Extreme tag.

Sounds good - I'll be excited to try it out.
Reply
#8
There is a multi-list prompt so you could display them all and the user selects which ones they want active. You could also allow them to remove/delete items without having to remove and reload a driver. That would require some fancy use of the WaitConfig, but it is doable.

One thing that will be interesting is this is a feed and not a single discreet event or series of events. So you may have multiple warnings coming in parallel that apply to completely separate areas. Should be interesting.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply
#9
jrlewis Wrote:There is a multi-list prompt so you could display them all and the user selects which ones they want active.

Oh...didn't know that. Is that the MLPrompt? I don't know enough to understand how that works based on the DTD, so does someone have a real-world example of it I can look at?
Reply
#10
Just grep the existing manifests. Some of the existing drivers will use it. Doesn't the astrology driver use it to select which signs you want?
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  RainMachine Sprinkler Irrigation Controller Driver kblagron 41 1,107 03-25-2020, 07:41 AM
Last Post: kfly
  Tesla Driver Driver kfly 8 369 02-24-2020, 08:04 AM
Last Post: kfly
  Ambient Weather simplextech 2 263 01-10-2020, 05:37 PM
Last Post: simplextech
  LIFX Driver bobskie708 15 5,538 01-05-2020, 11:00 AM
Last Post: simplextech
  Weather Drivers simplextech 10 809 01-05-2020, 10:51 AM
Last Post: simplextech
  Universal Devices ISY Insteon Driver wuench 369 172,415 12-28-2019, 05:15 PM
Last Post: simplextech
  JVC D-ILA Driver jokermac 32 2,839 12-18-2019, 12:30 PM
Last Post: jokermac
  RunTimer2 driver rbroders 18 7,209 10-17-2019, 04:38 PM
Last Post: rbroders
  Writing Driver - Varying commands based on checksum gReatAutomation 3 659 07-22-2019, 01:08 PM
Last Post: Dean Roddey
  Samsung HLxxA750 DLP Beta Driver jrunde 37 20,853 07-19-2019, 01:24 PM
Last Post: gReatAutomation

Forum Jump:


Users browsing this thread: 1 Guest(s)