MIT Early warnings → Home Assistant
Earthquake warnings, straight into your smart home.
One Python file that follows official early warnings, a worldwide quake feed and your own seismometer, then tells Home Assistant how hard it will shake at your place and how many seconds you have. No pip install, about 30 MB of RAM.
Runs from a temp folder. This page finds it on 127.0.0.1:8990 by itself.
- Dependencies
- 0
- Memory
- ~30 MB
- CPU idle
- ~0%
- Python
- 3.8+
01 / Live bridge
Everything the bridge hears, in plain sight.
Without a bridge running, this page plays simulated traffic so you can poke around. Start the command above and it switches to your bridge's real traffic within a couple of seconds.
Stays in your browser. It only fills in the command above, rounded to about a kilometre.
Let the bridge push to a webhook the moment an alert lands, or read it as a REST sensor.
/api/webhook/quake_alert_local
# automations.yaml · run the bridge with --webhook-url
- alias: "Earthquake early alert"
triggers:
- trigger: webhook
webhook_id: "quake_alert_local"
local_only: true
actions:
- action: notify.notify
data:
title: "Shaking in {{ trigger.json.s_wave_eta_s | int }} s"
message: "Drop, cover, and hold on."
# configuration.yaml
rest:
- resource: "http://127.0.0.1:8990/status"
scan_interval: 10
sensor:
- name: "Quake Listener Latency"
value_template: "{{ value_json.google_mcs.latency_ms }}"
unit_of_measurement: "ms"
02 / How it works
Push, not polling.
Most smart-home quake integrations ask a public API for news every 30 to 60 seconds. With seismic waves, that's often the whole warning window. This one keeps sockets open to the networks that issue warnings and gets told.
Illustration with one quake at 8 s. A poller only finds out on its next request; a push lands as soon as the network publishes it. For scale: P-waves travel at roughly 6 km/s, the damaging S-waves at about 3.5 km/s. The gap between them is the whole warning window.
Try it
What would you feel?
The same model the bridge runs for every quake. Move the sliders.
- Strong shaking (S) arrives
- 17 s
- Warning from an EEW feed
- 12 s
- Warning from your own sensor
- 7 s
Median estimate, Allen, Wald & Worden (2012); local soil can shift it about ±1 level. EEW assumes the warning is issued 5 s after origin.
Someone feels it first
A national seismic network issues an early warning, a global centre publishes a report, or the sensor in your own house sees the P-wave.
The bridge does the math
Distance to your station, expected intensity there (Allen et al., 2012) and a countdown to the S-wave. Duplicates across feeds collapse into one story.
Your house reacts
"Shaking in 12 seconds." Flash the lights, sound a siren, shut a valve, open the garage: your automations decide what to do with the seconds.
Sources
Multilayer feeds, one policy.
Each feed is honest about what it can do. The bridge notifies once per quake and only again if it gets worse.
Official EEW (Wolfx)
JMA and CENC early warnings relayed by Wolfx, revised as the quake grows.
- Speed
- seconds
- Where
- Japan, mainland China
EMSC reports
Every new or revised quake worldwide over a public WebSocket, CC BY 4.0.
- Speed
- ~6–8 min
- Where
- Worldwide
USGS & SGC feeds
USGS worldwide and Colombia's SGC catalogue, polled with HTTP 304 caching so an idle feed costs almost nothing.
- Speed
- minutes
- Where
- Worldwide · Colombia
Your own sensor
A Raspberry Shake streams over UDP; an STA/LTA trigger catches the P-wave on site. Tested with synthetic signals.
- Speed
- seconds
- Where
- Anywhere
Android sentinel
Optional: a real or containerized Android forwards Google's alert to the bridge. Tried in Oct 2026: no real alert captured; paused.
- Speed
- seconds
- Where
- Where Google alerts
Google MCS socket
Direct Google AEAS push client with S2 Level 8 cell subscriptions (Field 29). A 22-node fleet listens to 88 cells; so far it has received Google crisis alerts (hurricanes, floods), which are logged but never treated as earthquakes. No live earthquake captured yet.
- Speed
- seconds
- Where
- Worldwide (AEAS cells)
03 / Where it stands
Honest status: early warnings where they exist.
Official early warnings reach the bridge in seconds where agencies publish them (Japan, mainland China). A Raspberry Shake gives you on-site P-wave triggers anywhere. EMSC, USGS and SGC report every quake minutes later. Google's Android Earthquake Alerts are monitored via direct MCS socket with S2 Level 8 cell subscriptions (Field 29) and a 22-node fleet; its first catch was Google crisis alerts (hurricanes, US flood warnings), which share the channel and are filtered out of the earthquake path. Intensities follow Allen, Wald & Worden (2012).
- Official EEW feed (JMA, CENC)live
- EMSC, USGS and SGC feedslive
- Intensity + S-wave countdown53 tests passing
- Raspberry Shake triggersynthetic signals
- Android sentinel (Redroid)no real alert yet
- Google MCS socket (Field 29)live listening (22 nodes)