Mason10198 / SkywarnPlus

Empowering Asterisk / app_rpt Nodes with Local Alert Intelligence
GNU General Public License v3.0
45 stars 3 forks source link

with Multiples #54

Closed sjmahler closed 11 months ago

sjmahler commented 11 months ago

Hi Mason. Saw this problem in my previous version of SWP and just updated to SWP 0.4.2 .

We have an "Excessive Heat Warning", that is all that is reported or expected. But the UPDATE announcement -and- tail message say ... "[wood block] Excessive Heat Warning with multiples".

I report this because others may get very confused. You really did a nice job repackaging AutoSkyWarn. I will never have to play with the ASW code again! Thanks!! ...STeve

P.S. Running PI 3B+ with HamVOIP. county code = LAC055. CT and ID changes are turned off. No blocking. SkyDescribe is enabled, it reads index 1 but says no index 2. Alertscript is off. Pushover is off. Logging is off. Linux 4505 5.4.75-1-ARCH #1 SMP PREEMPT Mon Nov 9 16:58:39 UTC 2020 armv7l GNU/Linux.

Mason10198 commented 11 months ago

Hi Steve!

SWP determines "multiples" based on whether there is more than one "unique" instance of the same alert type.

In your case, the NWS is providing more than one "Excessive Heat Warning" for your area. These are "unique" because they have differing time/description data.

Here is a copy of the raw API data (this is what SWP reads) that I just pulled for your county code: Endpoint used: https://api.weather.gov/alerts/active?zone=LAC055

{
    "@context": [
        "https://geojson.org/geojson-ld/geojson-context.jsonld",
        {
            "@version": "1.1",
            "wx": "https://api.weather.gov/ontology#",
            "@vocab": "https://api.weather.gov/ontology#"
        }
    ],
    "type": "FeatureCollection",
    "features": [
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.1",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.1",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.1",
                "areaDesc": "Avoyelles; St. Landry; Lafayette; Upper St. Martin; Lower St. Martin; Northern Acadia; Upper Vermilion; Upper Iberia; Upper St. Mary; Southern Acadia; Lower Vermilion; Lower Iberia; Lower St. Mary; Tyler; Hardin; Northern Jasper; Northern Newton; Southern Jasper; Southern Newton",
                "geocode": {
                    "SAME": [
                        "022009",
                        "022097",
                        "022055",
                        "022099",
                        "022001",
                        "022045",
                        "022101",
                        "022113",
                        "048457",
                        "048199",
                        "048241",
                        "048351"
                    ],
                    "UGC": [
                        "LAZ029",
                        "LAZ033",
                        "LAZ044",
                        "LAZ045",
                        "LAZ055",
                        "LAZ143",
                        "LAZ152",
                        "LAZ153",
                        "LAZ154",
                        "LAZ243",
                        "LAZ252",
                        "LAZ253",
                        "LAZ254",
                        "TXZ180",
                        "TXZ201",
                        "TXZ259",
                        "TXZ260",
                        "TXZ261",
                        "TXZ262"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/LAZ029",
                    "https://api.weather.gov/zones/forecast/LAZ033",
                    "https://api.weather.gov/zones/forecast/LAZ044",
                    "https://api.weather.gov/zones/forecast/LAZ045",
                    "https://api.weather.gov/zones/forecast/LAZ055",
                    "https://api.weather.gov/zones/forecast/LAZ143",
                    "https://api.weather.gov/zones/forecast/LAZ152",
                    "https://api.weather.gov/zones/forecast/LAZ153",
                    "https://api.weather.gov/zones/forecast/LAZ154",
                    "https://api.weather.gov/zones/forecast/LAZ243",
                    "https://api.weather.gov/zones/forecast/LAZ252",
                    "https://api.weather.gov/zones/forecast/LAZ253",
                    "https://api.weather.gov/zones/forecast/LAZ254",
                    "https://api.weather.gov/zones/forecast/TXZ180",
                    "https://api.weather.gov/zones/forecast/TXZ201",
                    "https://api.weather.gov/zones/forecast/TXZ259",
                    "https://api.weather.gov/zones/forecast/TXZ260",
                    "https://api.weather.gov/zones/forecast/TXZ261",
                    "https://api.weather.gov/zones/forecast/TXZ262"
                ],
                "references": [],
                "sent": "2023-08-07T15:36:00-05:00",
                "effective": "2023-08-07T15:36:00-05:00",
                "onset": "2023-08-08T11:00:00-05:00",
                "expires": "2023-08-08T05:00:00-05:00",
                "ends": "2023-08-08T19:00:00-05:00",
                "status": "Actual",
                "messageType": "Alert",
                "category": "Met",
                "severity": "Severe",
                "certainty": "Likely",
                "urgency": "Expected",
                "event": "Excessive Heat Warning",
                "sender": "w-nws.webmaster@noaa.gov",
                "senderName": "NWS Lake Charles LA",
                "headline": "Excessive Heat Warning issued August 7 at 3:36PM CDT until August 8 at 7:00PM CDT by NWS Lake Charles LA",
                "description": "* WHAT...For the first Excessive Heat Warning, dangerously hot\nconditions with heat index values up to 114. For the second\nExcessive Heat Warning, dangerously hot conditions with heat\nindex values up to 114 expected.\n\n* WHERE...Portions of central, south central and southwest\nLouisiana and southeast Texas.\n\n* WHEN...For the first Excessive Heat Warning, until 7 PM CDT\nthis evening. For the second Excessive Heat Warning, from 11\nAM to 7 PM CDT Tuesday.\n\n* IMPACTS...Extreme heat and humidity will significantly\nincrease the potential for heat related illnesses,\nparticularly for those working or participating in outdoor\nactivities.",
                "instruction": "Drink plenty of fluids, stay in an air-conditioned room, stay out\nof the sun, and check up on relatives and neighbors. Young\nchildren and pets should never be left unattended in vehicles\nunder any circumstances.\n\nTake extra precautions if you work or spend time outside. When\npossible reschedule strenuous activities to early morning or\nevening. Know the signs and symptoms of heat exhaustion and heat\nstroke. Wear lightweight and loose fitting clothing when\npossible. To reduce risk during outdoor work, the Occupational\nSafety and Health Administration recommends scheduling frequent\nrest breaks in shaded or air conditioned environments. Anyone\novercome by heat should be moved to a cool and shaded location.\nHeat stroke is an emergency! Call 9 1 1.",
                "response": "Execute",
                "parameters": {
                    "AWIPSidentifier": [
                        "NPWLCH"
                    ],
                    "WMOidentifier": [
                        "WWUS74 KLCH 072036"
                    ],
                    "NWSheadline": [
                        "EXCESSIVE HEAT WARNING REMAINS IN EFFECT UNTIL 7 PM CDT THIS EVENING... ...EXCESSIVE HEAT WARNING IN EFFECT FROM 11 AM TO 7 PM CDT TUESDAY"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.NEW.KLCH.EH.W.0022.230808T1600Z-230809T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2023-08-09T00:00:00+00:00"
                    ]
                }
            }
        },
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.2",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.2",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.68bfbb1f5325c941545444b514ddb0af973cea69.001.2",
                "areaDesc": "Avoyelles; St. Landry; Lafayette; Upper St. Martin; Lower St. Martin; Northern Acadia; Upper Vermilion; Upper Iberia; Upper St. Mary; Southern Acadia; Lower Vermilion; Lower Iberia; Lower St. Mary; Tyler; Hardin; Northern Jasper; Northern Newton; Southern Jasper; Southern Newton",
                "geocode": {
                    "SAME": [
                        "022009",
                        "022097",
                        "022055",
                        "022099",
                        "022001",
                        "022045",
                        "022101",
                        "022113",
                        "048457",
                        "048199",
                        "048241",
                        "048351"
                    ],
                    "UGC": [
                        "LAZ029",
                        "LAZ033",
                        "LAZ044",
                        "LAZ045",
                        "LAZ055",
                        "LAZ143",
                        "LAZ152",
                        "LAZ153",
                        "LAZ154",
                        "LAZ243",
                        "LAZ252",
                        "LAZ253",
                        "LAZ254",
                        "TXZ180",
                        "TXZ201",
                        "TXZ259",
                        "TXZ260",
                        "TXZ261",
                        "TXZ262"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/LAZ029",
                    "https://api.weather.gov/zones/forecast/LAZ033",
                    "https://api.weather.gov/zones/forecast/LAZ044",
                    "https://api.weather.gov/zones/forecast/LAZ045",
                    "https://api.weather.gov/zones/forecast/LAZ055",
                    "https://api.weather.gov/zones/forecast/LAZ143",
                    "https://api.weather.gov/zones/forecast/LAZ152",
                    "https://api.weather.gov/zones/forecast/LAZ153",
                    "https://api.weather.gov/zones/forecast/LAZ154",
                    "https://api.weather.gov/zones/forecast/LAZ243",
                    "https://api.weather.gov/zones/forecast/LAZ252",
                    "https://api.weather.gov/zones/forecast/LAZ253",
                    "https://api.weather.gov/zones/forecast/LAZ254",
                    "https://api.weather.gov/zones/forecast/TXZ180",
                    "https://api.weather.gov/zones/forecast/TXZ201",
                    "https://api.weather.gov/zones/forecast/TXZ259",
                    "https://api.weather.gov/zones/forecast/TXZ260",
                    "https://api.weather.gov/zones/forecast/TXZ261",
                    "https://api.weather.gov/zones/forecast/TXZ262"
                ],
                "references": [
                    {
                        "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.be468257aef7f2ea0c467d27d8f1daefa87fffcf.001.1",
                        "identifier": "urn:oid:2.49.0.1.840.0.be468257aef7f2ea0c467d27d8f1daefa87fffcf.001.1",
                        "sender": "w-nws.webmaster@noaa.gov",
                        "sent": "2023-08-07T03:32:00-05:00"
                    }
                ],
                "sent": "2023-08-07T15:36:00-05:00",
                "effective": "2023-08-07T15:36:00-05:00",
                "onset": "2023-08-07T15:36:00-05:00",
                "expires": "2023-08-08T05:00:00-05:00",
                "ends": "2023-08-07T19:00:00-05:00",
                "status": "Actual",
                "messageType": "Update",
                "category": "Met",
                "severity": "Severe",
                "certainty": "Likely",
                "urgency": "Expected",
                "event": "Excessive Heat Warning",
                "sender": "w-nws.webmaster@noaa.gov",
                "senderName": "NWS Lake Charles LA",
                "headline": "Excessive Heat Warning issued August 7 at 3:36PM CDT until August 7 at 7:00PM CDT by NWS Lake Charles LA",
                "description": "* WHAT...For the first Excessive Heat Warning, dangerously hot\nconditions with heat index values up to 114. For the second\nExcessive Heat Warning, dangerously hot conditions with heat\nindex values up to 114 expected.\n\n* WHERE...Portions of central, south central and southwest\nLouisiana and southeast Texas.\n\n* WHEN...For the first Excessive Heat Warning, until 7 PM CDT\nthis evening. For the second Excessive Heat Warning, from 11\nAM to 7 PM CDT Tuesday.\n\n* IMPACTS...Extreme heat and humidity will significantly\nincrease the potential for heat related illnesses,\nparticularly for those working or participating in outdoor\nactivities.",
                "instruction": "Drink plenty of fluids, stay in an air-conditioned room, stay out\nof the sun, and check up on relatives and neighbors. Young\nchildren and pets should never be left unattended in vehicles\nunder any circumstances.\n\nTake extra precautions if you work or spend time outside. When\npossible reschedule strenuous activities to early morning or\nevening. Know the signs and symptoms of heat exhaustion and heat\nstroke. Wear lightweight and loose fitting clothing when\npossible. To reduce risk during outdoor work, the Occupational\nSafety and Health Administration recommends scheduling frequent\nrest breaks in shaded or air conditioned environments. Anyone\novercome by heat should be moved to a cool and shaded location.\nHeat stroke is an emergency! Call 9 1 1.",
                "response": "Execute",
                "parameters": {
                    "AWIPSidentifier": [
                        "NPWLCH"
                    ],
                    "WMOidentifier": [
                        "WWUS74 KLCH 072036"
                    ],
                    "NWSheadline": [
                        "EXCESSIVE HEAT WARNING REMAINS IN EFFECT UNTIL 7 PM CDT THIS EVENING... ...EXCESSIVE HEAT WARNING IN EFFECT FROM 11 AM TO 7 PM CDT TUESDAY"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.CON.KLCH.EH.W.0021.000000T0000Z-230808T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2023-08-08T00:00:00+00:00"
                    ],
                    "expiredReferences": [
                        "w-nws.webmaster@noaa.gov,urn:oid:2.49.0.1.840.0.e9c7dd4489fee12541217ba605f918538a7fc1f7.001.2,2023-08-06T19:18:00-05:00 w-nws.webmaster@noaa.gov,urn:oid:2.49.0.1.840.0.eb443c7601b4037fa388109d7c4df4441686d098.001.1,2023-08-06T15:00:00-05:00"
                    ]
                }
            }
        },
        {
            "id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.eb443c7601b4037fa388109d7c4df4441686d098.001.1",
            "type": "Feature",
            "geometry": null,
            "properties": {
                "@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.eb443c7601b4037fa388109d7c4df4441686d098.001.1",
                "@type": "wx:Alert",
                "id": "urn:oid:2.49.0.1.840.0.eb443c7601b4037fa388109d7c4df4441686d098.001.1",
                "areaDesc": "Vernon; Rapides; Avoyelles; Beauregard; Allen; Evangeline; St. Landry; Lafayette; Upper St. Martin; Lower St. Martin; West Cameron; East Cameron; Northern Calcasieu; Northern Jefferson Davis; Northern Acadia; Upper Vermilion; Upper Iberia; Upper St. Mary; Southern Calcasieu; Southern Jefferson Davis; Southern Acadia; Lower Vermilion; Lower Iberia; Lower St. Mary; Tyler; Hardin; Northern Jasper; Northern Newton; Southern Jasper; Southern Newton; Upper Jefferson; Northern Orange; Lower Jefferson; Southern Orange",
                "geocode": {
                    "SAME": [
                        "022115",
                        "022079",
                        "022009",
                        "022011",
                        "022003",
                        "022039",
                        "022097",
                        "022055",
                        "022099",
                        "022023",
                        "022019",
                        "022053",
                        "022001",
                        "022045",
                        "022101",
                        "022113",
                        "048457",
                        "048199",
                        "048241",
                        "048351",
                        "048245",
                        "048361"
                    ],
                    "UGC": [
                        "LAZ027",
                        "LAZ028",
                        "LAZ029",
                        "LAZ030",
                        "LAZ031",
                        "LAZ032",
                        "LAZ033",
                        "LAZ044",
                        "LAZ045",
                        "LAZ055",
                        "LAZ073",
                        "LAZ074",
                        "LAZ141",
                        "LAZ142",
                        "LAZ143",
                        "LAZ152",
                        "LAZ153",
                        "LAZ154",
                        "LAZ241",
                        "LAZ242",
                        "LAZ243",
                        "LAZ252",
                        "LAZ253",
                        "LAZ254",
                        "TXZ180",
                        "TXZ201",
                        "TXZ259",
                        "TXZ260",
                        "TXZ261",
                        "TXZ262",
                        "TXZ515",
                        "TXZ516",
                        "TXZ615",
                        "TXZ616"
                    ]
                },
                "affectedZones": [
                    "https://api.weather.gov/zones/forecast/LAZ027",
                    "https://api.weather.gov/zones/forecast/LAZ028",
                    "https://api.weather.gov/zones/forecast/LAZ029",
                    "https://api.weather.gov/zones/forecast/LAZ030",
                    "https://api.weather.gov/zones/forecast/LAZ031",
                    "https://api.weather.gov/zones/forecast/LAZ032",
                    "https://api.weather.gov/zones/forecast/LAZ033",
                    "https://api.weather.gov/zones/forecast/LAZ044",
                    "https://api.weather.gov/zones/forecast/LAZ045",
                    "https://api.weather.gov/zones/forecast/LAZ055",
                    "https://api.weather.gov/zones/forecast/LAZ073",
                    "https://api.weather.gov/zones/forecast/LAZ074",
                    "https://api.weather.gov/zones/forecast/LAZ141",
                    "https://api.weather.gov/zones/forecast/LAZ142",
                    "https://api.weather.gov/zones/forecast/LAZ143",
                    "https://api.weather.gov/zones/forecast/LAZ152",
                    "https://api.weather.gov/zones/forecast/LAZ153",
                    "https://api.weather.gov/zones/forecast/LAZ154",
                    "https://api.weather.gov/zones/forecast/LAZ241",
                    "https://api.weather.gov/zones/forecast/LAZ242",
                    "https://api.weather.gov/zones/forecast/LAZ243",
                    "https://api.weather.gov/zones/forecast/LAZ252",
                    "https://api.weather.gov/zones/forecast/LAZ253",
                    "https://api.weather.gov/zones/forecast/LAZ254",
                    "https://api.weather.gov/zones/forecast/TXZ180",
                    "https://api.weather.gov/zones/forecast/TXZ201",
                    "https://api.weather.gov/zones/forecast/TXZ259",
                    "https://api.weather.gov/zones/forecast/TXZ260",
                    "https://api.weather.gov/zones/forecast/TXZ261",
                    "https://api.weather.gov/zones/forecast/TXZ262",
                    "https://api.weather.gov/zones/forecast/TXZ515",
                    "https://api.weather.gov/zones/forecast/TXZ516",
                    "https://api.weather.gov/zones/forecast/TXZ615",
                    "https://api.weather.gov/zones/forecast/TXZ616"
                ],
                "references": [],
                "sent": "2023-08-06T15:00:00-05:00",
                "effective": "2023-08-06T15:00:00-05:00",
                "onset": "2023-08-07T11:00:00-05:00",
                "expires": "2023-08-06T19:15:00-05:00",
                "ends": "2023-08-07T19:00:00-05:00",
                "status": "Actual",
                "messageType": "Alert",
                "category": "Met",
                "severity": "Severe",
                "certainty": "Likely",
                "urgency": "Expected",
                "event": "Excessive Heat Warning",
                "sender": "w-nws.webmaster@noaa.gov",
                "senderName": "NWS Lake Charles LA",
                "headline": "Excessive Heat Warning issued August 6 at 3:00PM CDT until August 7 at 7:00PM CDT by NWS Lake Charles LA",
                "description": "* WHAT...Dangerously hot conditions with heat index values up to\n114 each day.\n\n* WHERE...Portions of central, south central, southwest and west\ncentral Louisiana and southeast Texas.\n\n* WHEN...For the first Excessive Heat Warning, until 7 PM CDT\nthis evening. For the second Excessive Heat Warning, from 11\nAM to 7 PM CDT Monday.\n\n* IMPACTS...Extreme heat and humidity will significantly increase\nthe potential for heat related illnesses, particularly for those\nworking or participating in outdoor activities.",
                "instruction": "Drink plenty of fluids, stay in an air-conditioned room, stay out\nof the sun, and check up on relatives and neighbors. Young\nchildren and pets should never be left unattended in vehicles\nunder any circumstances.\n\nTake extra precautions if you work or spend time outside. When\npossible reschedule strenuous activities to early morning or\nevening. Know the signs and symptoms of heat exhaustion and heat\nstroke. Wear lightweight and loose fitting clothing when\npossible. To reduce risk during outdoor work, the Occupational\nSafety and Health Administration recommends scheduling frequent\nrest breaks in shaded or air conditioned environments. Anyone\novercome by heat should be moved to a cool and shaded location.\nHeat stroke is an emergency! Call 9 1 1.",
                "response": "Execute",
                "parameters": {
                    "AWIPSidentifier": [
                        "NPWLCH"
                    ],
                    "WMOidentifier": [
                        "WWUS74 KLCH 062000"
                    ],
                    "NWSheadline": [
                        "EXCESSIVE HEAT WARNING REMAINS IN EFFECT UNTIL 7 PM CDT THIS EVENING... ...EXCESSIVE HEAT WARNING IN EFFECT FROM 11 AM TO 7 PM CDT MONDAY"
                    ],
                    "BLOCKCHANNEL": [
                        "EAS",
                        "NWEM",
                        "CMAS"
                    ],
                    "VTEC": [
                        "/O.NEW.KLCH.EH.W.0021.230807T1600Z-230808T0000Z/"
                    ],
                    "eventEndingTime": [
                        "2023-08-08T00:00:00+00:00"
                    ]
                }
            }
        }
    ],
    "title": "Current watches, warnings, and advisories for Lafayette Parish (LAC055) LA",
    "updated": "2023-08-07T20:37:14+00:00"
}

It looks like SWP is operating as intended. :)

sjmahler commented 11 months ago

Mason: Might I suggest that multiples should be counted for the counties that are selected for processing? What we see most often are Svr TS, Floods, Hurricanes, Tropical Storms. They are almost all multiple counties. ASW multiples were looking at things like two flood warnings in one country (yep, we have a lot of water down here).

This may be hard to do if the user has multi-county turned on, but easier for a single county. I think it is worth some mental consideration. ...STeve

Mason10198 commented 11 months ago

Steve, I might be misunderstanding what you're saying (and please let me know if that is the case), but this is already the functionality of SkywarnPlus. It only checks alerts for the county codes defined, so if you only have one county code defined then that is all SWP is worrying about.

SkywarnPlus pulls NWS API data for each county code you have defined in config.yaml from the URL https://api.weather.gov/alerts/active?zone=[COUNTY_CODE]. The API then returns a list of alerts that are posted for that county code, which SWP will process.

In your case (only one county code defined), SWP gets data from https://api.weather.gov/alerts/active?zone=LAC055 which returns all alerts posted for Lafayette (LAC055) Louisiana. SWP then processes the alerts and sees that the API returned more than one unique instance of "Excessive Heat Warning" for that particular county code, and therefore adds the "with multiples" tag.

The NWS has "multiple" of the same alert posted for your specific county, and SWP is properly tagging based on this.

sjmahler commented 11 months ago

Mason, After looking again at the data set I now see there are 2 IDs, 2 Headlines, etc. It contains the initial warning and an update to the warning. Without a flag that points from the update back to the original warning, it is difficult to count. Thanks for your consideration. ...STeve

Mason10198 commented 11 months ago

No worries, Steve. I'm always open to ideas for improvement. Unfortunately SWP is at the mercy of the NWS API and whatever data it serves. What you have brought up here (more alerts on the API than what actually exist due to "updates") is a known issue with the API and can be traced all the way back to the NWS API Github site as seen here: https://github.com/weather-gov/api/discussions/573#discussioncomment-3344896

SWP does the best it can by handling duplicate alerts and extensively processing/filtering them. However, if the API is not removing the "old" alert when the "update" is posted, then like you said, there is no way to detect whether it is a legitimate alert that should actually be there, or should be ignored.