Seismic (earthquakes-vulcanoes) alarms

Any option to add it in HASS somehow?

Maybe this API

https://earthquake.usgs.gov/fdsnws/event/1/

I have a pull request open that reads a Geo RSS feed and filters events by distance to your HA instance.
The corresponding documentation pull request contains an example for USGS earthquake data.

1 Like

Cool, I don’t understand how to integrate USGS data …?

The USGS provides several different Geo RSS feeds with different granularity. In the example I used a feed covering the last day and specified two categories:

sensor:
  - platform: geo_rss_events
    name: USGS All Earthquakes
    url: https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.atom
    categories:
      - 'Past Hour'
      - 'Past Day'

The default radius around your HA instance is 20km, i.e. only events that happened within that radius around you will be included in the sensor. Since you are looking for earthquake warnings you may want to increase the radius.
The sensor shows the number of events, and the info dialogue shows the title of all events - which in case of the USGS data is something like ‘M 4.3 - 21km ESE of Soda Springs, Idaho’.
On top of that you could create a binary template sensor that turns on if there are any events reported at the moment.

1 Like

yes I would do around 100km. How to change that?

I think that’s enough, but will I get the alert report? I mean is good to have an instantaneous report not only 1 hour ago. Is that available?

You will be able to adjust the radius like this:

   radius: 100

And keep in mind that the above is just an example. If you do not specify any categories, you would get all events. And that URL provides all events from the past day. You can find other USGS Geo RSS feeds providing the past 7 days or past 30 days.

By default the data is updated every 5 minutes (i.e. the sensor refreshes its data every 5 minutes). According to the linked USGS site, their feed is also updated every 5 minutes.
I guess if you want a notification, you may want to look at an automation that is triggered by a change of the sensor value, and send yourself a push notification.

Please keep in mind: I did not build this sensor with the intention of a real-time emergency notification service in mind. There will always be delays with published RSS feeds. So, if you live at the foot of a volcano, don’t wait for this sensor tell you to run away.

3 Likes

Sure, I would never live in the foot of a Volcano, no matter the notifications available :smiley:

could you walk me through on installing your component in HASS

Are you sure you want to manually install this component? The pull request is waiting for a final code review, and is otherwise ready to be merged - fingers crossed for the next release.

If you can’t wait and want to manually install it, please copy the file geo_rss_events.py into <HA folder>/.homeassistant/custom_components/sensor. Then add a new sensor to your configuration, e.g. with the above mentioned configuration example.

Edited: Path corrected.

1 Like

not in custom_components/sensor ?

Sorry, yes the file should go into <HA folder>/.homeassistant/custom_components/sensor.

does it show only US earthquakes? I have no use for that.

This service I think is better, is it possible (easy) to insert?

http://webservices.rm.ingv.it/fdsnws/event/1/

The USGS feed does list earthquakes outside the US, at the moment for example some in Argentina, Mexico, Indonesia.

My sensor only supports the Geo RSS format. The URL from INGV is published in QuakeML format which is very different.
I guess you’re interested in earthquakes in Italy? The following service appears to focus on Italian events and is in Geo RSS format: http://info.terremoti.ingv.it/feed/atom/all_week - however this appears to contain thousands of entries. Give it a try, and see if that works for you.

Perfect!!

Yes it is same service (INGV).

With your code is possible to get only events ABOVE a certain magnitude?

Or maybe a code for getting only above X magnitude results??

I see only US … ?

I changed into this, and I get 0 past day and 0 past hour events …

Maybe they just focus more on the US.

Not at this point. The magnitude is just encoded into the title of the event, not available as a separate data point.
Example title: 2017-09-11 20:40:07 UTC - Magnitude(ML) 1.3 - 2 km W Bolognola (MC).
Maybe in a future version of the sensor, I could introduce additional filters; in this case a regular expression filter on the title may help.

Another useful filter for a future version could be to filter by updated date, i.e. only include results within a certain timeframe.

Sorry, forgot to mention: The categories that this sensor supports are encoded into the RSS feed. The USGS feed has categories called ‘Past Hour’ and ‘Past Day’. The INGV feed however does not specify any categories. With the INGV feed you cannot define categories - with them you get zero events, without them you will get all events.

If I take out the category I receive all events?

Yes, correct.

Just to summarise, by now you should have something like this in your configuration:

sensor:
  - platform: geo_rss_events
    name: Terremoti
    url: http://info.terremoti.ingv.it/feed/atom/all_week
    radius: 100

With the above configuration, and my test HA instance configured to be in Naples/Italy, I get 8 events at the moment: