Severe Weather Information skill

Severe Weather Information

Checks your national weather service and notifies you when there are alerts for your region

The severe weather information skill can connect to dozens of weather alerting services, among them many from following lists:
severe weather information center
alerting world weather
meteoalarm

After installation go to home.mycroft.ai and select your preferred weather service from the list on the skills configuration page.
You can also set a “watchdog” that automatically checks for new alerts and notifies you…

How to install Severe Weather Information skill

  • Install Severe Weather Information skill by …

    • msm install https://github.com/domcross/severe-weather-information-skill
    • There are some dependencies in requirements.txt which should be automatically installed by msm
  • Severe Weather Information skill connects to public weather information services …

    • A number of services is included and can be selected in the skill configuration (home.mycroft.ai)
    • You can use custom services as long as they provide a ATOMpub or RSS feed with entries in CAP-xml format.

How to test Severe Weather Information skill

  • Configure the Skill Settings in home.mycroft.ai
  • Speak Are there weather alerts
  • Mycroft should reply with “There are the following alerts …” (continuing with alert information) or with “Currently there are no alerts for your region”

Where feedback on Severe Weather Information skill should be directed at

  • as comment here in this topic
  • Issues on GitHub
  • Mycroft Chat.
5 Likes

On a Mark I, core release 19.08.2B:
Installation failed via copy-and-pasted installation line: “msm install GitHub - domcross/severe-weather-information-skill: Checks your national weather service and notifies you when there are alerts for your region

Tail end excerpt of the stdout where the errors began:

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Error: Timeout was reached
Reading package lists… Done
Reading package lists…
Building dependency tree…
Reading state information…
The following extra packages will be installed:
libgeos-3.4.2 libgeos-c1
Suggested packages:
libgdal-doc
The following NEW packages will be installed:
libgeos-3.4.2 libgeos-c1 libgeos-dev
0 upgraded, 3 newly installed, 0 to remove and 65 not upgraded.
Need to get 815 kB of archives.
After this operation, 2,099 kB of additional disk space will be used.
Get:1 Index of /raspbian jessie/main libgeos-3.4.2 armhf 3.4.2-6 [469 kB]
Get:2 Index of /raspbian jessie/main libgeos-c1 armhf 3.4.2-6 [164 kB]
Get:3 Index of /raspbian jessie/main libgeos-dev armhf 3.4.2-6 [182 kB]
Fetched 815 kB in 1s (615 kB/s)
dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault)
dpkg: error processing archive /var/cache/apt/archives/libgeos-3.4.2_3.4.2-6_armhf.deb (–unpack):
subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault)
dpkg: error processing archive /var/cache/apt/archives/libgeos-c1_3.4.2-6_armhf.deb (–unpack):
subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault)
dpkg: error processing archive /var/cache/apt/archives/libgeos-dev_3.4.2-6_armhf.deb (–unpack):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libgeos-3.4.2_3.4.2-6_armhf.deb
/var/cache/apt/archives/libgeos-c1_3.4.2-6_armhf.deb
/var/cache/apt/archives/libgeos-dev_3.4.2-6_armhf.deb
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)
INFO - Successfully ran requirements.sh for severe-weather-information-skill
INFO - Installing system requirements…
INFO - Installing requirements.txt for severe-weather-information-skill
INFO - Problem performing action. Restoring skill to previous state…
ERROR - Failed to install skill severe-weather-information-skill
Traceback (most recent call last):
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/msm/mycroft_skills_manager.py”, line 372, in install
skill.install(constraints)
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/msm/skill_entry.py”, line 82, in wrapper
func(self, *args, **kwargs)
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/msm/skill_entry.py”, line 473, in install
self.run_pip(constraints)
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/msm/skill_entry.py”, line 313, in run_pip
pip_code, proc.stdout.read().decode(), stderr
msm.exceptions.PipRequirementsException:
Pip returned code 1:
Requirement already satisfied: feedparser in /opt/venvs/mycroft-core/lib/python3.4/site-packages (5.2.1)
Requirement already satisfied: xmltodict in /opt/venvs/mycroft-core/lib/python3.4/site-packages (0.11.0)
Requirement already satisfied: requests in /opt/venvs/mycroft-core/lib/python3.4/site-packages (2.20.0)
Collecting Shapely
Downloading https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz (225kB)
Complete output from command python setup.py egg_info:
Failed CDLL(libgeos_c.so.1)
Failed CDLL(libgeos_c.so)
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-tq7z_0xt/Shapely/setup.py”, line 80, in
from shapely._buildcfg import geos_version_string, geos_version,
File “/tmp/pip-install-tq7z_0xt/Shapely/shapely/_buildcfg.py”, line 167, in
fallbacks=[‘libgeos_c.so.1’, ‘libgeos_c.so’])
File “/tmp/pip-install-tq7z_0xt/Shapely/shapely/_buildcfg.py”, line 161, in load_dll
libname, fallbacks or ))
OSError: Could not find library geos_c or load any of its variants [‘libgeos_c.so.1’, ‘libgeos_c.so’]

----------------------------------------

/opt/venvs/mycroft-core/lib/python3.4/site-packages/cryptography/hazmat/bindings/openssl/binding.py:163: CryptographyDeprecationWarning: OpenSSL version 1.0.1 is no longer supported by the OpenSSL project, please upgrade. A future version of cryptography will drop support for it.
utils.CryptographyDeprecationWarning
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won’t be maintained after March 2019 (cf PEP 429).
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-tq7z_0xt/Shapely/
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

Thanks for trying my skill and reporting this.
In the stdout you have provided I see some reoccuring error messages:

  1. Error: Timeout was reached
  2. dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault)

Maybe there was a network error while you tried to install?
Did you try to install some other apt-packages before and that failed somehow and now your apt-database is somehow broken?
How old is the SD-card in your Mark-1 - maybe that card is too old (assuming a 24/7 usage of the Mark-1 one year is old) and is simply dying - which results in erratic behaviour when trying to write data to the card…?

The error messages at the end are kind of exspected errors as the libgeos-packages were not succesfully installed before but are required by the pip-install of the Shapely pypi-package.

I tried again, this time logging in with pi (and not su-ing to mycroft this time) and running the command with the “mycroft-” prefix. I got esstenially the same errors.

It is possible that some other apt stuff has mucked things up, perhaps through the requirements.sh of another skill, but I don’t recall doing anything like that on purpose.

Do you think a “factory reset” as described in https://mycroft.ai/wp-content/uploads/2017/06/Mark_1_User_Guide.pdf would suffice to cleanup/repair the apt stuff (if it is indeed a problem)? I don’t know if that does any kind of OS image work, or just purges skills and configuration files.

Hi @jrwarwick
sorry, I somehow missed your reply… as far as I know the RESET function from the Mark-I menu does only wipe your settings. After that you will have to go through the wifi setup and register the device again at home.mycroft.ai

Honestly, I don’t think this will help with your problem as either your apt database is corrupted or your SD-card is dying. Is flashing the Mark-I image to a new SD card a feasible option for you?

Yes, I think I can handle a fresh flashing on a fresh card. It will take me a little while to do this though. I’ll report back with results. Thanks, Dominik.

Good news: a completely fresh install on fresh SD card, updated, then installed Severe Weather Information Skill as the second skill installed; completely successful, as you predicted. MSM seemed very happy. Then I configured the skill on home.mycroft.ai, and that seemed to work fine. I decided to move some of the threshold settings down a bit since the area I live in actually has very little severe weather.


After saving configuration, I attempted to speak the test phrase “Are there weather alerts”, but alas, this failed. “An error occurred while processing a request in Severe Weather Information”. I can attach a larger excerpt of the log, but it looks like this is the problem:

21:34:07.185 | ERROR | 857 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:798 | An error occurred while processing a request in Severe Weather Information Traceback (most recent call last): File "/opt/venvs/mycroft-core/lib/python3.7/site- packages/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper handler(message) File "/opt/mycroft/skills/severe-weather-information-skill.domcross/__init__.py", line 106, in handle_information_weather_severe self._check_for_alerts() File "/opt/mycroft/skills/severe-weather-information-skill.domcross/__init__.py", line 102, in _check_for_alerts self.alerts = self.get_filtered_alerts(feed.entries, max_entries=5) File "/opt/mycroft/skills/severe-weather-information-skill.domcross/__init__.py", line 306, in get_filtered_alerts if not self.in_geo_location(info, longitude=lon, latitude=lat): File "/opt/mycroft/skills/severe-weather-information-skill.domcross/__init__.py", line 345, in in_geo_location for lola in area["polygon"].split(" "): AttributeError: 'NoneType' object has no attribute 'split'

More good news: when I changed the location filter option to Area Description and gave my county name, the trigger phrase worked! So 97% successful test, now. Just a small problem with getting lat/long from the Mycroft Device.
Beyond that, I cannot say when or if I would actually experience severe weather to test the active/automatic notification of the condition.

You might be interested in the new geolocation API that we’ve added to the backend.

It’s not documented yet, but we’ve started experimenting with it in Skills eg this branch of the Date-Time Skill

1 Like

That is exciting news, Gez. I have long anticipated the day when I would be able to wake up groggy and mumble: “Hey Mycroft, where are we?” and he unconfuses me. The ever-alert adventure buddy.

1 Like

@jrwarwick thanks for providing me your location data (through PM)

Unfortunately NWS/NOAA does provide longitude/latitude polygon data for some, but not all areas. For the area you are living the polygon data is missing - which caused the exception you have reported. I have pushed a fix for that error.

In order to get weather warnings for your area you may want to look up your county/zone code at https://alerts.weather.gov, then in the skills settings change location-filter to “geo-code” and enter your county/zone code to “location description”

@Dominik your suggestion seems to work just fine. Using City, State styled “Area Description” seemed to work, too, interestingly.

I just noticed the faceplate display complete with general sky condition graphic: very nice touch!

One small suggestion: add a little more utterance analysis for this case of habitual speech pattern: I tried asking “are there any weather alerts in my location?” and “are there any weather alerts in my area?” to which Mycroft replied that he didn’t know about that location. Maybe include a few more common location phrases like “around here”, “the area”, “near by”, too and just interpret them to mean “use the skill configured default location”.

@jrwarwick Thanks for testing and your suggestions how to improve the phrases - this is very helpful for me as non-native English speaker. I will update the intent-files soon…

FYI, Now that I’ve had an explicit geocode in there for a while, and seen a couple of reboots, I am still seeing this in the background activity periodcially:

18:53:34.219 | INFO | 5180 | SevereWeatherInformation | auto_alert_handler
18:53:34.220 | INFO | 5180 | SevereWeatherInformation | url: Current watches, warnings, and advisories for United States land zones
18:53:34.220 | INFO | 5180 | SevereWeatherInformation | header: {‘Accept’: ‘application/atom+xml’}
18:53:37.600 | INFO | 5180 | SevereWeatherInformation | add alert NOAA-NWS-ALERTS-AK125F35957A44.WinterStormWarning.125F35A26BF0AK.AJKWSWAJK.dba7f84da7cd60e04206f0d04df0f80e
18:53:38.618 | INFO | 5180 | SevereWeatherInformation | add alert NOAA-NWS-ALERTS-AK125F35957A44.WinterStormWarning.125F35A2E120AK.AJKWSWAJK.d59c95a675c716a3d5bb1b229b0b2bf9
18:53:40.198 | INFO | 5180 | SevereWeatherInformation | add alert NOAA-NWS-ALERTS-AK125F35955CF8.HighWindWarning.125F3595E8D0AK.AJKNPWAJK.b2aafd2368054c9cb67aad86d8badf3d
18:53:40.756 | INFO | 5180 | SevereWeatherInformation | add alert NOAA-NWS-ALERTS-AK125F35955CF8.HighWindWarning.125F3595E8D0AK.AJKNPWAJK.5dd2ccccc5ac6b32cf028f8a4c85096a
18:53:41.321 | INFO | 5180 | SevereWeatherInformation | add alert NOAA-NWS-ALERTS-AK125F35955CF8.HighWindWarning.125F35A1F6C0AK.AJKNPWAJK.479dc599182b265e70fe8f1de1fffffa
18:53:41.329 | ERROR | 5180 | mycroft.skills.event_scheduler:on_error:314 | An error occured executing the scheduled event KeyError(‘messageType’)
Traceback (most recent call last):
File “/opt/venvs/mycroft-core/lib/python3.7/site-packages/mycroft/skills/mycroft_skill/event_container.py”, line 100, in wrapper
handler()
File “/opt/mycroft/skills/severe-weather-information-skill.domcross/init.py”, line 159, in auto_alert_handler
msgType = alert[‘messageType’]
KeyError: ‘messageType’

Did you enable “Automatic alert” in the skill settings?

Yes, with 15 minute interval:

Also, perhaps unrelated, I just noticed mismatch of scheduled event names: “SevereWeatherInformation” vs “SevereWeather”
line 88:
self.schedule_repeating_event(handler=self.auto_alert_handler, when=datetime.now(), frequency=self.update_interval, name='SevereWeather')

line 92:
self.cancel_scheduled_event('SevereWeatherInformation')

1 Like

Good observation, looks like you found a little bug. Will take care of it soon and report back here when it is fixed.

Another minor, more “cosmetic” issue: when pronouncing the output from alerts.weather.gov, the summary provided included asterisk characters, which Mycroft pronounces, i.e., by saying the work “asterisk”. At a glance it looks like this particular weather information feed is using the asterisk as some kind of delimiter of sorts (rather than an indication of emphasis, which I would consider more typical).

Considerably more tricky, so just FYI: Mycroft also pronouned the timezone abbreviation like a word “acksst” instead of saying something like “Alaska Standard Time”.

Sample of speech transcript from cli:

There are the following alerts DEBUG output
High Wind Warning issued February 20 at 4:47AM AKST until February 20 at 3:00PM AKST by NWS Juneau skills.log, other
…HIGH WIND WARNING IN EFFECT FROM 9 AM THIS MORNING TO 3 PM AKST THIS AFTERNOON… * WHAT…Southeast voice.log
winds 35 to 45 mph with gusts up to 60 mph expected. * WHERE…Cape Fairweather to Cape Suckling Coastal
Area. * WHEN…From 9 AM this morning to 3 PM AKST this afternoon. * IMPACTS…Damaging winds will blow
down trees and power lines. Widespread power outages are expected. Travel will be difficult, especially

Eventually found time for updating this skill:

  • fixed some bugs (scheduler etc.)
  • removal of unwanted “*” and “…”
  • changes for Mycroft 20.02 (some API functions were changed or deprecated)
2 Likes

If anyone wonders, on Arch Linux you need the system package python-shapely installed first.

1 Like