[Essentials] Severe Weather and Natural Disaster Warning

Skill Name:
Calamity Warning & Preparedness

Types of Warning:

  • Tornado
  • Flood
  • Heavy rain
  • Hurricane, cyclone
  • Strong winds
  • Hail
  • Wildfire
  • Snowstorm
  • Drought
  • Heatwave
  • Tsunami
  • Volcano warning
  • Earthquake
  • etc.

What third party services, data sets or platforms will the Skill interact with?
Some API.

Are there similar Mycroft Skills already?
The closest is the Weather Skill which I am working on right now. This skill suggestion directly stems from my work on the Weather Skill. Given the calamities and natural disasters include more than severe weather conditions, Iā€™m thinking this deserves a separate skill of its own.

What will the user Speak to trigger the Skill?
The skill is mainly meant to be an announce kind of skill. Broadcast when there is an alert for the local area. However, it could for instance contain knowledge about the history of natural disasters, explanations of how they arise, and what to do before/when they hit.

What Skill Settings will this Skill need to store?
Device location

References:


Hey great idea, every moment counts in an emergency and I rarely listen to the radio or watch tv anymore so never get the typical warnings.

Has anyone seen a service that collates severe weather warnings?
I had a quick look, and wunderground seemed to be the best with both US and Europe covered, however theyā€™ve shutdown their public API. The other APIā€™s that support alerts seem to start at $250/month.

It might require accessing a range of sources depending on the location of the user eg:

2 Likes

Ya, it was a bummer they shut down their public API, I used to use it a lot.

Great idea for a skill though

1 Like

weatherbit.io provides an API which combines several local weather warning services (among them NOAA for USA and Meteoalarm for Europe).
Requires an API-key which is free for non-commercial use.
PyPi package for weatherbit-API: https://pypi.org/project/pyweatherbit/

Openweathermap has a weather warning service as wellā€¦

3 Likes

This API might work https://reliefweb.int/help/api.

ā€œReliefWeb is the leading humanitarian information source on global crises and disasters. It is a specialized digital service of the UN Office for the Coordination of Humanitarian Affairs (OCHA).ā€

Besides weather-related alerts and volcanoes, it also includes disease outbreaks.

1 Like

I had a look at Weatherbit however the severe weather alerts arenā€™t included in the non-commercial tier

The openweathermap alerts seem to be your own defined parameters rather than any official severe weather warning, eg if temp > x and wind_speed > y:

relief web could be a good option

1 Like

@gez-mycroft thanks for pointing out, i have overlooked the fact that weatherbit alerts are only available to paid membership starting at 160$/month.

@akuataja to my understanding Reliefweb provides a more historical view on (weather) disasters and only very general forecasts e.g. for a upcoming cyclone.

So far I dont see the availability of ā€œglobal solutionā€ with a one-size-fits-all API for all countries.

I suggest to concentrate on the services from NOAA/USA, Meteoalarm/Europe and BOM/Australia for now. For NOAA and Meteoalarm there are PyPi packages available. BOM provides RSS feeds for different regions/territories. It will be quite complicated to integrate all three into one skill as the query parameters and returned results are quite different. So it boils down to individual skills for the services/regions.

As a german/european citizen I offer to start with a skill for Meteoalarmā€¦

1 Like

I have a bash script for Canadian weather alerts that will interrupt mycroft and speak weather warning and display weather alerts on my version of Mycroft local/remote TFT display

it gets itā€™s info from environment Canada RSS feed

https://weather.gc.ca/warnings/index_e.html just edit the zone to match the RSS zone for your region

#!/bin/bash

ZONE="mb19_e.xml"    # enviroment Canada rss zone
#ZONE="nt16_e.xml"

prev="$(cat prev)"
OUTPUT="$(curl -s  https://weather.gc.ca/rss/battleboard/${ZONE} | sed -n 's:.*<title>\(.*\)</title>.*:\1:p' | sed  '1d' | sed  's/in effect//gI' | cut -d',' -f1)"
echo "${OUTPUT}"
NO_WHITESPACE="$(echo -e "${OUTPUT}" | tr -d '[:space:]')"

if [ $NO_WHITESPACE == 'Noalerts' ]
then
 if [ $prev == 'Noalerts'  ]
 then
     echo " "
 else
      echo 'cmd_9(clear)' > /dev/ttyS2  #send command to serial to display on local TFT screen
      mosquitto_pub -h 192.168.168.150 -t '/ai/clear' -m '1' #sends command to remote wifi connected TFT screen
 fi
   echo "${NO_WHITESPACE}" > prev
   echo  all is good
elif [ $NO_WHITESPACE == 'FrostWarning' ]   #silent Alarm just display warning on TFT Screen
 then
 echo 'cmd_5(Frost Warning)' > /dev/ttyS2
 mosquitto_pub -h 192.168.168.150 -t '/ai/clear' -m '1'
 mosquitto_pub -h 192.168.168.150 -t '/ai/station' -m 'Frost Warning'
 echo  "frost warning"
else                                       # full alarm   speech and display
/home/ai/mycroft-core/bin/mycroft-say-to stop
mpv Alarm.wav
echo 'cmd_5(Weather Alert)' > /dev/ttyS2
mosquitto_pub -h 192.168.168.150 -t '/ai/station' -m 'Weather Alert'
echo 'cmd_6($OUTPUT)' > /dev/ttyS2
mosquitto_pub -h 192.168.168.150 -t '/ai/artist' -m "${OUTPUT}"
/home/ai/mycroft-core/bin/mycroft-speak  weather alert     ${OUTPUT}
echo  ${OUTPUT}
echo "${NO_WHITESPACE}" > prev
fi

is just runs every 10 minutes to get alarm data

2 Likes

Check this out for NOAA weather alerts: https://github.com/domcross/noaa-alerts-skill.git - WARNING: work in progressā€¦

(Meteoalarmā€™s AtomPub API turned out to be quite unstable, e.g. the endpoint for Germany does not work at all, so I change plans and started implementing the NOAA skill firstā€¦)

2 Likes

Just found out that there is such thing as Common Alerting Protocol - at least NOAA and Meteoalert APIs return their alerts in this format, which makes parsing the messages much easierā€¦

2 Likes

I made my bash script into a skill for environment Canada

I made it work with both mycroft and my TFT remote mqtt displays for mycroft ( will work still if you do not have a screen) . for extreme weather such as tornado, hurricane wreckhouse winds, it will stop mycroft current operation beep a alarm and read out the warningā€¦ for milder severe conditions such as lighting and heavy rainfall it will play either a thunderstorm or rain noise in the background. in an attempt to be less intrusiveā€¦ for other milder severe weather it will have a simple bleep ( about a 1 second tone ) . to interact with it in mycroft just say ā€œweather Alertsā€, ā€œany weather alertsā€ and then it will read out the current weather alerts, and the current condition and near future forecast . since I do not know every weather condition. i asked evcan development team for transcript of a there possible condition they never got back to me. so if it beeps out warning on conditions that you wish not to beep out a loud warning just edit ALERT2 and add in another elif for that condition. it very easy to do. it just the warning fully capitalize with out white spaces.

currently it suppose to make a configuration page on mycroft.ai but it not for something reason, maybe I did some wrong with that. but i also can not communicate with mycroft servers either at the moment . that started about noon today for me - actually it went bonkers today . some python section got corrupt in mycroft after a OS software update and forced me to delete mycroft-core and install againā€¦ but it seamed to be something in .mycroft folder as on my first install the same problem still existed after the new install. then I deleted .mycroft , deleted the core and skills folders again and it installed properly after that. but it will not pair or communicate with mycroft servers. but it working with out the pairing at the moment for some reason never even asked to pair like it usually does either - weird anyways
here the error on that

 ~~: /v1/device/ (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7fee8046d048>, 'Connection to api.mycroft.ai timed out. (connect timeout=3.05)'))"))

~

2 Likes

environment Canada sent me a link to their warning criteria that includes their watch and warning ( which is unusual as it was Sunday) , so i updated the skill with all of them, so in its current form on low level events and air quality it will only display on the screen and accessible via mycroft ā€¦ on mid level events it has a bleep every 10 minutes . for thunderstorms and rainfall I gave them special sounds as they can develop fast and deadlyā€¦ Tsunami and tornado have full alarm (PLUS any event that pops up that environment Canada did not send me info on .)

2 Likes

Updated the NOAA alert skill - basic functionality is now working. You can set desired levels for urgency, severity and certainty. Filtering to alerts with sent-date or expiry-date >= the current day.

what is on my to-do list: scheduled retrieval of new/updated alerts and automatic announcement of severe immediate alerts that are nearby.

Any test results and suggestions/features requests are welcomeā€¦

2 Likes

Thatā€™s awesome, thanks for the excellent work as always Dominik!!

My NOAA alerts skill is now available for testing: NOAA Alerts skill

And for the european community members here is the beta-version of meteoalert-skill which uses meteoalarm.eu

NOTE: the API/ATOM-service of meteoalarm.eu is broken and fails for some countries, e.g. Germany: http://meteoalarm.eu/ATOM/DE.xml - you can try your country-code (instead of ā€œDEā€), if you donā€™t get a ā€œ404ā€ error the skill will work for your countryā€¦

The ā€œmeteoalertapiā€ library from pypi.org which I use is not as comprehensive as the noaa-sdk that i use for the noaa-skill. It looks like only the latest alert is returned in case there are multiple alerts and some attributes are already filtered (sent-date, status, messagetype).

seams like the german one breaks it down to provinces/states/counties/ but you can extract every thing from the rss feed to for that regionā€¦ similar to how i do my Evcan as it also breaks the country down in 100ā€™s of different regions too

but clicking around it would seam rss feed would be better as that cover most countries other then France and Belgiumā€¦ atom only seams to does about +50% of the countries only way I see getting every country to work is scraping the counties web page for weather warning and then break it down to regions looks like lynx could do it easy enough- all you need is country webpage and the region and using the image as the trigger as they use the same image no mater what the language is used ā€¦ I think I could write a bash script to process the alert - for the heck i give it try

On a first glance the RSS feeds from meteoalarm.eu seem to have far less information than the ATOM feeds (RSS lacks CAP meta-tagging, so you canā€™t filter by severity, etc.)

Turns out there is the World Meteorological Organization which has a ā€œlive map of severe weatherā€ and a listing of CAP feeds for many countries. I will have a deeper look into this in the next days, maybe a lot more services than NOAA and Meteoalarm can be included in a skillā€¦ :thinking:

1 Like

seams lynx worked easy enough

calling a the progam test then passing the weblink

#!/bin/bash
 lynx -dump $1  | sed -n '/^Weather warnings/,/^   Display/p' | sed '1d;$d'

example
./test http://meteoalarm.eu/en_UK/0/0/LT005-Panevėžio%20apskritis.html

gives you this as result :

[aw102.jpg]
valid from 16.07.2019 00:00 CET Until 16.07.2019 23:59 CET
Rain Awareness Level: Yellow
lietuviu:
dieną vietomis gausus lietus

english:
BY DAY LOCALLY HEAVY RAIN.

[aw32.jpg]
valid from 16.07.2019 00:00 CET Until 16.07.2019 23:59 CET
Thunderstorms Awareness Level: Yellow
lietuviu:
Dieną perkūnija

english:
At day thunderstorm

[aw12.jpg]
valid from 16.07.2019 00:00 CET Until 16.07.2019 23:59 CET
Wind Awareness Level: Yellow
lietuviu:
dieną vietomis Å”kvalas, 15-20 m/s

english:
BY DAY LOCALLY SQUALL.

or passing this to it http://meteoalarm.eu/en_UK/0/0/IT018-Sicilia.html gives you

[aw33.jpg]
valid from 16.07.2019 01:00 CET Until 17.07.2019 00:59 CET
Thunderstorms Awareness Level: Orange
english:
No Special Awareness Required BE PREPARED. Take precautions and keep up
to date with the latest weather forecast. Expect some disruption to
daily routines and BE PREPARED for disruption to outdoor activities.

italiano:
Nessun Avviso ESSERE PREPARATI. Prendere le dovute precauzioni e
tenersi aggiornati con le ultime previsioni del tempo. Aspettarsi
qualche interruzione delle normali attivitĆ  quotidiane ed essere pronti
per interruzione delle attivitĆ  allā€™aria aperta.

[aw103.jpg]
valid from 16.07.2019 01:00 CET Until 17.07.2019 00:59 CET
Rain Awareness Level: Orange
english:
No Special Awareness Required BE PREPARED. Take precautions and keep up
to date with the latest weather forecast. Expect some disruption to
daily routines and BE PREPARED for disruption to outdoor activities.

italiano:
Nessun Avviso ESSERE PREPARATI. Prendere le dovute precauzioni e
tenersi aggiornati con le ultime previsioni del tempo. Aspettarsi
qualche interruzione delle normali attivitĆ  quotidiane ed essere pronti
per interruzione delle attivitĆ  allā€™aria aperta.

[aw12.jpg]
valid from 16.07.2019 01:00 CET Until 16.07.2019 18:59 CET
Wind Awareness Level: Yellow
english:
No Special Awareness Required BE AWARE, keep up to date with the latest
weather forecast. Expect some minor disruption to outdoor activities

italiano:
Nessun Avviso STARE (RIMANERE) ATTENTI. Tenersi aggiornati con le
previsioni del tempo piĆ¹ recenti. Aspettarsi alcuni disagi minori per
le attivitĆ  allā€™aria aperta.

which you can process farther easy enough for severity ā€“ oh well just a thought

update; tried a few different countries one country seams to a slightly different format so this works for all that I tried

  lynx -dump $1  | sed -n '/Weather warnings/,/Display/p' | sed '1,/Caption:/!d'  | sed '1d;$d'

Update 2
and if you want to process in any European language use this

#!/bin/bash
lynx -dump $1 | sed -n ā€œ/$2/,/Display/pā€ | sed ā€œ1,/$3:/!dā€ | sed ā€˜1d;$dā€™

and the command format is
./test http://meteoalarm.eu/li_LT/0/0/IT017-Basilicata.html ā€˜Perspejimai: Basilicataā€™ Caption

the commandline argument --web address the --alert section title , what they call the legend on the countries page ( only necessary if very small county with no provinces/states or counties listed)

1 Like

there you go a simple bash script probably could do it in python i guess if I knew how :blush: ā€¦ but it should process any page or language for alarms from meteoalarm.eu

#!/bin/bash

########### get alert Data##############

lynx -dump $1  | sed -n "/$2/,/Display/p" | sed "1,/$3:/!d"  | sed '1d;$d'  > w.buf
# lynx -dump $1  | sed -n '/Weather warnings/,/Display/p' | sed '1,/Caption:/!d'  | sed '1d;$d' > w.buf
input="$(cat w.buf | grep .jpg )"
#echo $input

################## Split alerts ################
while IFS= read -r LINE
do

SPLIT="$(echo $LINE | tr -d '[]' | tr -d '[:space:]')"

cat w.buf | sed -n "/$SPLIT/, $ p" | head -3 | sed '1d' > tmp.w  

input2="$(cat tmp.w)"
if [ -z "$input2" ]
then
  echo "No Alerts Founds"
else
############## process alerts further  ################
############## or simply allow it to feed back into the skill######
  echo $input2 
fi
done  <<< "$input"

feel free to use it or adapt to python if you likeā€“

it outputs this

from ā€” http://meteoalarm.eu/en_UK/0/0/IT018-Sicilia.html current weather ( i did not extract the language just the alerts)

valid from 16.07.2019 09:00 CET Until 16.07.2019 20:59 CET Thunderstorms Awareness Level: Orange
valid from 16.07.2019 09:00 CET Until 16.07.2019 20:59 CET Rain Awareness Level: Orange
valid from 16.07.2019 09:00 CET Until 16.07.2019 19:59 CET Wind Awareness Level: Yellow

update :
oh well waiting for my tractor battery to charge ā€”
if you want language: just add to

########### get alert Data##############
declare -i cnt=0

############## process alerts further ################
if [ $cnt == 0 ]
then
((cnt++))
cat w.buf | sed -n ā€œ/$4/,/^ *$/pā€ | awk ā€˜!seen[$1,$2]++ā€™
fi

and stipulate the language ie from the above example

./test http://meteoalarm.eu/en_UK/0/0/IT018-Sicilia.html 'Weather warnings' Caption italiano: 

to print out italian weather warning - english: for english version

./test  http://meteoalarm.eu/en_UK/0/0/GR010-Ionion%20Islands.html 'Weather warnings' Caption english:

   english:
   SEVERE THUNDERSTORMS ACCOMPANIED BY HAIL IN PLACES AND GUSTY WINDS.

valid from 16.07.2019 13:00 CET Until 16.07.2019 23:59 CET Thunderstorms Awareness Level: Red

if you want to trim timestamp edit this
cat w.buf | sed -n ā€œ/$SPLIT/, $ pā€ | head -3 | sed ā€˜1dā€™ > tmp.w
to
cat w.buf | sed -n ā€œ/$SPLIT/, $ pā€ | head -3 | sed ā€˜1d;2dā€™ > tmp.w

1 Like