Skip to main content

EMSC Earthquakes smart home integration, free and open source

EMSC Earthquakes integration for Gladys Assistant

Live earthquakes near your home from EMSC-CSEM: magnitude, distance, triggers and a widget.

The earthquakes near your home in Gladys, live, as reported by the EMSC-CSEM (European-Mediterranean Seismological Centre): magnitude, distance, depth, time and region of the latest one, and how many there were in the last 24 hours. Made for the earthquakes you may feel at home: the Pyrenees, the Alps, Provence, Italy, Greece, the French West Indies… No account, no API key.

The integration listens to the EMSC real-time feed: an earthquake reaches Gladys a few seconds after EMSC publishes it, usually a few minutes after it happened. It is not an early warning system: by the time it is reported, the shaking is over. Not affiliated with EMSC.

For the major disasters of the whole world (rated green, orange or red), see the GDACS integration.

What you get​

  • A Nearby earthquakes device: magnitude, distance, depth, time and region of the latest earthquake of your zone, number of earthquakes in the last 24 hours and strongest magnitude in the last 24 hours, with their history.
  • A dashboard widget listing the latest earthquakes of your zone (7 days), newest first, each with its EMSC page (where you can tell EMSC you felt it).
  • Two scene triggers: a new earthquake in your zone, and the magnitude of an earthquake revised.
  • A scene action that reads the earthquakes of the last 24 hours as one sentence, to send by message or have it read aloud.

Requirements​

  • Gladys Assistant 5.1 or later.
  • Internet access from the Gladys host (the integration reads www.seismicportal.eu, the EMSC data portal, over HTTPS and a WebSocket).
  • A location for your house in Gladys (Settings → Houses), or coordinates typed in the configuration.

Configuration​

Settings​

Integrations → EMSC Earthquakes → Configuration:

SettingDefaultMeaning
Centre latitude / longitudeemptyEmpty: the location of your first located house. Decimal degrees, comma or point.
Radius of the near zone200 kmDistance from the centre to the epicentre, 25 to 1,000 km.
Minimum magnitude, nearM2.5Smaller earthquakes are ignored. From M1 to M5.
Radius of the far zoneOffOptional: a wider zone, 500 to 3,000 km, for strong earthquakes only.
Minimum magnitude, farM5.5The minimum of the far zone, from M4 to M7.
Language of the textsFrenchNames of the features (at their creation) and texts sent to the scenes.

Save, then create the device in the Discover tab.

The followed zone​

An earthquake is in your zone when it is within the radius of the near zone and of its minimum magnitude at least, or, when the far zone is on, within the radius of the far zone and of its own minimum magnitude at least. The far zone only counts when both its radius and its magnitude are above those of the near zone: otherwise the Configuration screen says it is ignored.

Rough guide: a magnitude 2.5 is felt near the epicentre only, a magnitude 3 up to a few tens of kilometres, a magnitude 4 up to a hundred, a magnitude 5 up to a few hundred. In an active area (Greece, Italy, Turkey), EMSC lists several earthquakes of magnitude 2 a day: keep a minimum of 2.5 or 3 there.

A typical setting for metropolitan France: 200 km and M2.5 near, 1,000 km and M5 far (a strong earthquake in Italy, Spain or Germany).

Changing the zone (centre, radius, magnitude) starts it from scratch: the earthquakes already in it are loaded without firing any scene.

Device​

FeatureTypeValue
Latest earthquake magnitudeSismicMagnitude of the latest earthquake of the zone, as EMSC rates it.
Latest earthquake distanceDistanceDistance from the centre to its epicentre, in km.
Latest earthquake depthDistanceDepth of its focus, in km.
Latest earthquake timeTextIts date and time, in the time zone of Gladys.
Latest earthquake regionTextIts region, as EMSC names it (in English, e.g. “Western Pyrenees”).
Earthquakes in 24 hCounterNumber of earthquakes of the zone in the last 24 hours.
Strongest magnitude in 24 hSismicThe strongest magnitude of the last 24 hours, 0 when there was none.

The latest earthquake stays shown however old it is. The 24-hour values follow the clock: they go down when an earthquake gets older than 24 hours.

Dashboard widget​

Nearby earthquakes: a heading with the number of earthquakes in 24 hours, then the latest earthquakes of the zone over 7 days (8 at most), newest first: region, distance and time, and the magnitude as a badge (blue, orange from magnitude 4, red from 5). Tap a row for the details (magnitude type, depth, reporting agency, zone) and the link to its EMSC page. The footer gives the source and the time of the last update.

Scene triggers​

EMSC: new earthquake in my zone: an earthquake of your zone less than an hour old, as soon as EMSC publishes it. An earthquake reported later than that (rare), or already there when the zone was set, fires nothing. Filter: Zone (near, far).

EMSC: magnitude revised: EMSC revises by 0.5 or more the magnitude of an earthquake of your zone from the last 24 hours (the first magnitude is often an automatic estimate). Same filter. Extra variable: previous magnitude.

Variables of both: zone (near or far) and zone in words, magnitude, magnitude type (ml, mb, mw…), distance (km), depth (km), region, date and time, summary (e.g. “M3.2 Western Pyrenees, 45 km away, 16/10 15:17”), EMSC page. A condition on a variable (magnitude above 4, distance below 50 km) can follow the trigger in the scene.

Scene action​

EMSC: read the recent earthquakes gives:

  • Earthquakes, in one sentence: e.g. “2 earthquakes in 24 hours: M2.7 Aegean Sea, 167 km away, 16/10 06:31; M2.5 Greece, 83 km away, 16/10 05:58.”, or the latest known one when there was none;
  • Earthquakes in 24 hours and Strongest magnitude in 24 hours, as numbers.

The configuration action Show the latest earthquakes shows the same sentence (three earthquakes at most).

Scene examples​

  • Felt it? Trigger “new earthquake in my zone”, zone near, then a condition “magnitude ≥ 3”: send “Earthquake {summary}. Tell EMSC if you felt it: {url}” by message.
  • Strong earthquake far away: trigger “new earthquake”, zone far: notify the family, read the summary aloud.
  • Morning summary: every day at 8:00, the scene action “read the recent earthquakes”, then send its sentence by message if the number of earthquakes is above 0.

Data sources, terms and quotas​

  • Real-time feed: wss://www.seismicportal.eu/standing_order/websocket, one message per earthquake created or revised in the world. The integration keeps one connection open and reopens it when it is lost (5 seconds, then up to 5 minutes between attempts).
  • Catch-up: the FDSN event service https://www.seismicportal.eu/fdsnws/event/1/query, read only at the start, after the feed was lost and when the zone changes (one request per zone, the last 7 days; after outages, at most every 5 minutes). The feed does the work: the service is never polled.
  • No account, no published quota. The data is distributed by EMSC-CSEM under the CC BY 4.0 licence: credit “EMSC-CSEM, https://www.emsc-csem.org” (shown in the widget). Terms: https://www.seismicportal.eu/terms.html
  • Only the zone is sent to EMSC (centre and radius, in the catch-up request); the integration stores the earthquakes of the last 7 days under /data, never the coordinates of your house.

Troubleshooting​

  • “No centre” in the Configuration screen: give your house a location (Settings → Houses), or type coordinates.
  • “The EMSC real-time feed is lost”: the Gladys host cannot reach www.seismicportal.eu (internet, DNS, proxy, firewall blocking WebSockets). The integration tries again on its own; the earthquakes of the outage are caught up when it is back.
  • No value on the device: the first catch-up has not succeeded yet (see the logs), or the device was created before the first save of the configuration: save once.
  • Too many earthquakes: raise the minimum magnitude, or shrink the radius.
  • More details: LOG_LEVEL=debug shows each earthquake taken in or left out, never your coordinates.

Limits​

  • Not an early warning system: an earthquake is known minutes after it happened. In an emergency, follow the instructions of your local authorities.
  • The magnitude and the position are those EMSC publishes; the first ones are often automatic and revised in the following minutes or hours. National agencies (e.g. RéNaSS in France) may give slightly different values.
  • The distance is measured to the epicentre, not to the area where the earthquake was felt.
  • One zone per Gladys (the first located house, or the coordinates of the configuration).
  • Developed and tested with real EMSC data; not affiliated with EMSC. Feedback welcome.

Configuration settings​

These are the settings EMSC Earthquakes asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your zonesectionNoThe earthquakes EMSC-CSEM reports around your house (or around coordinates), live. Choose a radius and a minimum magnitude, and optionally a wider zone for strong earthquakes only. Save, then create the device in the Discover tab.
Sources and limitssectionNoData © EMSC-CSEM, read without an account through its real-time feed. Not an early warning system: an earthquake is reported minutes after it happens. Not affiliated with EMSC.
Centre latitudestringNoLeave both coordinates empty to use the location of your house in Gladys.
Centre longitudestringNoDecimal degrees, east positive.
Radius of the near zoneselectNoDistance from the centre to the epicentre. A magnitude 3 is felt up to a few tens of kilometres.
Minimum magnitude, near zoneselectNoBelow 2.5 an earthquake is rarely felt; EMSC lists many small ones in active areas.
Radius of the far zoneselectNoOptional: also follow the strong earthquakes farther away. Must be wider than the near zone.
Minimum magnitude, far zoneselectNoMust be above the minimum of the near zone.
Language of the textsselectNoNames of the features (at their creation) and texts sent to the scenes.

How to install EMSC Earthquakes in Gladys​

  1. In Gladys, open Integrations: EMSC Earthquakes appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/guim31/gladys-emsc:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/guim31/gladys-emsc.

EMSC Earthquakes requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

EMSC Earthquakes is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂