0.2.5 • Published 2 years ago

jsame v0.2.5

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

jsame

jsame is a JS library to decode EAS/SAME (Emergency Alert System/Specific Area Message Encoding) alert messages. These messages are primarily used by the National Weather Service for weather-related warnings. jsame will decode a demodulated message, filter by SAME (US/CA) and/or event code, provide readable object back.

PLESE DONT TRUST THIS CODE WITH YOUR LIFE... COMMON SENSE

Requirements

Installation

$ npm install @maxwelldps/jsame

Usage

jsame can decode EAS messages diectly from multitmon, or in SAME format ZCZC-ORG-EEE-PSSCCC-PSSCCC+TTTT-JJJHHMM-LLLLLLLL-

jsame.decode(Message, List of EEE to exclude, List of FIPS to watch )

Example to watch for Lancatser County NE, and not exclude events.

jsame.decode("ZCZC-WXR-RWT-031109+0030-0771800-KOAX/NWS", [], ["031109"])

Exlude Required Weekly tests

jsame.decode("ZCZC-WXR-RWT-031109+0030-0771800-KOAX/NWS", ["RWT"])

Exlude Required Weekly tests, and Match state of NE

jsame.decode("ZCZC-WXR-RWT-031109+0030-0771800-KOAX/NWS", ["RWT"], ["031109"])

Example input

ZCZC-WXR-RWT-055027-055039-055047-055117-055131-055137-055139-055015-055071+0030-0771800-KMKX/NWS-

EAS: ZCZC-WXR-RWT-055027-055039-055047-055117-055131-055137-055139-055015-055071+0030-0771800-KMKX/NWS -

var jsame = require("./jsame.js"); 

Message = "ZCZC-WXR-RWT-055027-055039-055047-055117-055131-055137-055139-055015-055071+0030-0771800-KMKX/NWS-";

decodedMeassage = jsame.decode(Message);
console.log(decodedMeassage["MESSAGE"]);

Event Codes

This list includes current and proposed event codes.

CodeDescriptionCodeDescription
ADRAdministrative MessageAVAAvalanche Watch
AVWAvalanche WarningBHWBiological Hazard Warning
BWWBoil Water WarningBZWBlizzard Warning
CAEChild Abduction EmergencyCDWCivil Danger Warning
CEMCivil Emergency MessageCFACoastal Flood Watch
CFWCoastal Flood WarningCHWChemical Hazard Warning
CWWContaminated Water WarningDBADam Watch
DBWDam Break WarningDEWContagious Disease Warning
DMODemo WarningDSWDust Storm Warning
EANEmergency Action NotificationEATEmergengy Action Termination
EQWEarthquake WarningEVAEvacuation Watch
EVIEvacuation ImmediateEWWExtreme Wind Warning
FCWFood Contamination WarningFFAFlash Flood Watch
FFSFlash Flood StatementFFWFlash Flood Warning
FLAFlood WatchFLSFlood Statement
FLWFlood WarningFRWFire Warning
FSWFlash Freeze WarningFZWFreeze Warning
HLSHurricane Local StatementHMWHazardous Materials Warning
HUAHurricane WatchHUWHurricane Warning
HWAHigh Wind WatchHWWHigh Wind Warning
IBWIceberg WarningIFWIndustrial Fire Warning
LAELocal Area EmergencyLEWLaw Enforcement Warning
LSWLand Slide WarningNATNational Audible Test
NICNational Information CenterNMNNetwork Message Notification
NPTNational Periodic TestNSTNational Silent Test
NUWNuclear Plant WarningPOSPower Outage Statement
RHWRadiological Hazard WarningRMTRequired Monthly Test
RWTRequired Weekly TestSMWSpecial Marine Warning
SPSSpecial Weather StatementSPWShelter in Place Warning
SSAStorm Surge WatchSSWStorm Surge Warning
SVASevere Thunderstorm WatchSVRSevere Thunderstorm Warning
SVSSevere Weather StatementTOATornado Watch
TOE911 Outage EmergencyTORTornado Warning
TRATropical Storm WatchTRWTropical Storm Warning
TSATsunami WatchTSWTsunami Warning
VOWVolcano WarningWFAWild Fire Watch
WFWWild Fire WarningWSAWinter Storm Watch
WSWWinter Storm WarningBLUBlue Alert
SQWSnow Squall Warning

An alert must match one of each specified alert type in order to be processed. If an alert type is omitted, any alert will match that type. In most cases, using only SAME codes to filter alerts will be the best option.

Output

Output is an object with the following

VariableDescriptionExample
MESSAGEReadable message(See sample text output below)
ORGOrganization codeWXR
EEEEvent codeRWT
PSSCCCGeographical area (SAME) codes020103-020209-020091-020121-029047-029165-029095-029037
TTTTPurge time code0030
JJJHHMMDate code1051700
LLLLLLLLOriginator codeKEAX/NWS
COUNTRYCountry codeUS
LLLL-ORGOriginating station - Org codeKEAX-WXR
organizationOrganization nameNational Weather Service
locationOriginator locationPleasant Hill, Missouri
eventEvent typeRequired Weekly Test
typeEvent type indicatorT
startStart time12:00 PM
endEnd time12:30 PM
lengthLength of event30 minutes
secondsEvent length in seconds1800
dateLocal dateTuesday, March 17th 2020, 1:00:00 pm

Sample output 1

"EAS: ZCZC-WXR-EWW-055027-055039-055047-055117-055131-055137-055139-055015-055071+0030-0771800-KOAX/NWS-" (same_decode(TEST_STRING2, "RWT", "DMO", "RMT", "055000"));

{ 
  "MESSAGE": "The National Weather Service in Omaha, NE has issued a Extreme Wind Warning valid until 1:30 PM for the following counties in Wisconsin: Calumet, Dodge, Fond du Lac, Green Lake, Manitowoc, Sheboygan, Washington, Waushara, Winnebago. (KOAX/NWS)",
  "ORG": "WXR",
  "EEE": "EWW",
  "PSSCCC_LIST":
   [ "055015",
     "055027",
     "055039",
     "055047",
     "055071",
     "055117",
     "055131",
     "055137",
     "055139" ],
  "TTTT": "0030",
  "JJJHHMM": "0771800",
  "STATION": "KOAX",
  "LLLLLLLL": "KOAX/NWS",
  "COUNTRY": "US",
  "LLLL-ORG": "KOAX-WXR",
  "organization": "National Weather Service",
  "location": "Omaha, NE ",
  "event": "Extreme Wind Warning",
  "type": "W",
  "start": "1:00 PM",
  "end": "1:30 PM",
  "length": 30,
  "seconds": 1800,
  "date": "Tuesday, March 17th 2020, 1:00:00 pm" 
}

Sample output 2

"ZCZC-CIV-LAE-000000+0030-0771800-KXYZ/FM-" (same_decode(TEST_STRING2, "RWT", "DMO", "RMT"));

{ 
  "MESSAGE": "The Civil Authorities in undefined have issued a Local Area Emergency valid until 1:30 PM for the following counties in Nebraska: ALL. (KXYZ/NWS)",
  "ORG": "CIV",
  "EEE": "LAE",
  "PSSCCC_LIST": [ "031000" ],
  "TTTT": "0030",
  "JJJHHMM": "0771800",
  "STATION": "KXYZ",
  "LLLLLLLL": "KXYZ/NWS",
  "COUNTRY": "US",
  "LLLL-ORG": "KXYZ-CIV",
  "organization": "Civil Authorities",
  "location": "undefined ",
  "event": "Local Area Emergency",
  "type": "E",
  "start": "1:00 PM",
  "end": "1:30 PM",
  "length": 30,
  "seconds": 1800,
  "date": "Tuesday, March 17th 2020, 1:00:00 pm"
}

Sample Text Output

The National Weather Service in Pleasant Hill, Missouri has issued a Required Weekly Test valid until 12:30 PM for the following counties in Kansas: Leavenworth, Wyandotte, Johnson, Miami, and for the following counties in Missouri: Clay, Platte, Jackson, Cass. (KEAX/NWS)

This experimental pagermon site is updated using jsame, pagermon, multimon-ng and a rtl-sdr dongle.

Known Issues

Credits

Thanks to dsame Copyright (c) 2016 Joseph W. Metcalf from which the code was adapted


0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago