Skip to content

🌏 The Earthquake That Whispers to My Smart Home

It started with a quiet question: Can my home know when the earth shakes—before I do?

I wasn’t looking for sirens or dramatic alerts. I just wanted my home to respond gently, like turning on hallway lights or sending a message to my phone. Something subtle, but fast.

That’s when I discovered a public MQTT server, generously shared by a member of the Home Assistant Japan Facebook group, that broadcasts real-time earthquake data from the Japan Meteorological Agency (JMA) . And with a few careful steps, I made my smart home listen.


🧠 What Is MQTT, and Why Does It Matter?

Section titled “🧠 What Is MQTT, and Why Does It Matter?”

MQTT is a protocol—a way for devices to talk to each other. But I like to think of it as a whisper network. Instead of shouting updates across the internet, MQTT quietly delivers messages to your smart home, fast and efficiently.

In this case, the message is:

An earthquake just happened in Tokyo.

And your home can respond however you want.


I use Home Assistant OS (HAOS), which makes MQTT integration straightforward. Here’s how I connected to the earthquake alert server—step by step, with no coding required.

Section titled “✅ Step 1: Create a Dedicated MQTT User (Recommended)”

Before connecting anything, it’s best to create a separate user just for MQTT. This keeps your system secure and organized.

  • Limits access to only MQTT
  • Keeps your main Home Assistant account safe
  • Prevents remote login
  1. Go to Settings > People
  2. Click on the Users tab
  3. Click + Add Person
  4. Name it something like Home Assistant MQTT
  5. Set a username and password (e.g., home_assistant_mqtt / securepassword)
  6. Uncheck administrator, check local access only

This user will be used when setting up the MQTT integration in the next step.

  1. Go to Settings > Add-ons
  2. Open the Add-on Store
  3. Search for Mosquitto broker and install it
Home Assistant add-on store displaying Mosquitto broker
  1. Go in Configuration and in the Customize section, turn on active (the folder name should be mosquitto).
  2. Click Start, and enable Start on boot and Watchdog This gives your Home Assistant the ability to listen to MQTT messages.
Mosquitto broker add-on configuration page in Home Assistant
  1. Go to Settings > Devices & Services
  2. Click + Add Integration
  3. Search for MQTT and add it
MQTT integration setup dialog in Home Assistant
  1. When prompted, enter the username and password you created in Step 1

Home Assistant will connect to the Mosquitto broker using your dedicated MQTT user.

✅ Step 4: Connect to the Earthquake Alert Server

Section titled “✅ Step 4: Connect to the Earthquake Alert Server”

Now comes the magic. You’ll bridge your local MQTT broker to a public server that shares JMA earthquake alerts.

In Home Assistant OS, create a file at:

/share/mosquitto/earthquake.mayberry.farm.conf

I personally use the Studio Code add-on to create and edit this file directly from Home Assistant. I had to open the folder / first, then navigate to /share/mosquitto/ to create the new file (it was showing a specific folder by default that confused me).

connection jma_earthquake_mayberry_farm
address earthquake.mayberry.farm:1883
remote_username hajma
remote_password hajma
start_type automatic
cleansession true
topic homeassistant/sensor/japan_earthquake_tokyo/# in 0
topic homeassistant/sensor/japan_earthquake_kanagawa/# in 0

This tells your smart home to listen for earthquake alerts in Tokyo and Kanagawa. You can add/remove more regions by adding more topic lines—like Osaka, Hokkaido, or wherever you live. japan_earthquake_any works for all regions.

Visual Studio Code editor showing MQTT configuration file for earthquake alerts

Once connected, Home Assistant will automatically create sensors for each prefecture you subscribed to. You don’t need to write any YAML or install any custom integrations.

These sensors update within about 60 seconds of an earthquake. And from there, you can create automations like:

  • Flashing hallway lights
  • Sending a phone notification
  • Pausing music or turning off appliances
  • Logging events for later review

I didn’t build the MQTT server. I didn’t write any code. I just followed the steps shared by someone in the community—and now my home listens to the earth.

It’s not loud. It’s not dramatic. But it’s fast, and open. And in a country like Japan, where earthquakes are part of life, that quiet awareness feels like a small comfort.