Journal

How the Home Assistant and HappySmart System Protects Your Home from Earthquakes Automatically

ระบบ Home Assistant + HappySmart ทำให้บ้านปลอดภัยจากแผ่นดินไหวแบบอัตโนมัติได้อย่างไร

May 16, 2026 · 1 min read
How the Home Assistant and HappySmart System Protects Your Home from Earthquakes Automatically

What Home Assistant Is and How It Works

Home Assistant (HA) is an open-source Smart Home platform running on a Raspberry Pi or mini PC inside your home. It requires no external cloud dependency, responds in milliseconds, and continues operating even when internet connectivity fails. HA supports over 3,000 IoT device types through protocols including MQTT, Zigbee, Z-Wave, and ESPHome, making it the most powerful and flexible Smart Home hub available today.

How HappySmart Earthquake Sensors Work

HappySmart uses industrial-grade MPU6050 sensors that detect vibration across three axes: X, Y, and Z. Connected to an ESP32 via ESPHome, the sensor streams real-time data to HA through MQTT. Sensitivity thresholds are adjustable to distinguish genuine earthquakes from everyday vibrations such as passing vehicles, footsteps, or doors slamming, ensuring accurate alerts with no false alarms.

Automations HA Runs When an Earthquake Is Detected

HA's most powerful feature is Automation that responds to earthquakes instantly across four key areas:

Automatic gas valve shutoff: Earthquakes risk dislodging gas pipes and stove connections. HA commands the smart gas valve to close the moment vibration exceeds the defined threshold, eliminating the risk of gas leaks and fire.

Emergency door unlocking: For homes with a Smart Door Lock or motorized gate, HA automatically unlocks and opens the door so residents can evacuate without searching for keys in a panicked situation.

Family notification: HA sends alerts via LINE Notify, Telegram, or Push Notification to every phone in the household and to family members outside simultaneously. Emergency lights activate in every room and speakers can announce a voice warning.

CCTV recording: HA commands all cameras to begin recording and upload footage to cloud storage immediately, preserving evidence of damage for insurance claims.

Real Automation Example from HappySmart

At 02:45 AM a sensor detects vibration exceeding 4.0 Richter. HA responds within one second: LINE alerts reach every phone, the gas valve closes, emergency lights activate in every room, the gate opens, CCTV begins recording, and SMS goes to family members. All of this happens before the S-wave arrives, giving the household time to reach open ground safely.

Who This System Suits

This system suits families with young children or elderly residents who need fast and reliable alerts, homeowners in high-risk provinces including Chiang Rai, Chiang Mai, Tak, Mae Hong Son, and Kanchanaburi, existing HA users adding earthquake safety to their setup, and anyone wanting a ready-to-use system without advanced technical knowledge.

What HappySmart Provides

HappySmart delivers a complete service covering site survey and optimal sensor placement, installation of industrial MPU6050 sensors with professional calibration, full HA, ESPHome, and Automation configuration, user training and threshold adjustment, and ongoing after-sales support with OTA firmware updates throughout the system lifetime.

Questions & answers

Does HA require internet at all times to function
No. HA operates entirely on the local network. Gas valve shutoff, emergency lighting, and door unlocking all work without internet. LINE and Telegram notifications require internet, but a UPS battery backup ensures the system keeps running.
How does the system distinguish an earthquake from normal vibration
The system analyzes wave pattern, frequency, and amplitude together. Real earthquakes have a distinct P-wave followed by S-wave pattern that differs from everyday vibration. Thresholds and filters are individually adjusted for each home environment.
Will the system work if power cuts out during the earthquake
Yes, provided a UPS battery backup is installed. A minimum 650VA UPS supplying at least 30 minutes of runtime is recommended, sufficient for evacuation and sending all necessary alerts.
Can HappySmart add earthquake protection to an existing HA installation
Yes. HappySmart can integrate earthquake sensors and Automations into an existing HA setup. The team evaluates the current system before recommending the best integration approach.
What does HappySmart service cost
Pricing depends on home size and device requirements. A typical mid-size home installation covering sensors, ESP32, HA setup, and full Automation runs approximately 10,000 to 20,000 THB. Contact HappySmart for a quote based on your specific home.

Related reading