Skip to content

Geek-MD/USGS_Quakes

Repository files navigation

Geek-MD - USGS Quakes Stars Forks

GitHub Release License HACS Custom Repository

Ruff + Mypy + Hassfest Ruff Checked with mypy

icon

USGS Quakes

USGS Quakes is a custom integration for Home Assistant that monitors earthquake events from the USGS Earthquake Hazards Program. It provides geo_location entities for each event matching your filter criteria.


🌍 Features

  • Monitors earthquakes from the USGS GeoJSON feed.
  • Filters by:
    • Minimum Magnitude (Mw)
    • Maximum Distance from your location (Radius)
  • Creates geo_location entities for each event.
  • Includes a special sensor sensor.usgs_quakes_latest that:
    • Stores only new earthquake events (based on their unique id)
    • Exposes a formatted list of recent events:
      • Title
      • Place
      • Magnitude
      • Date/time (local)
      • Google Maps link to epicenter

⚙️ Requirements

  • Home Assistant 2024.6.0 or newer
  • Internet access to fetch data from USGS

📦 Installation

Option 1: HACS (recommended)

  1. Open HACS in Home Assistant.
  2. Go to Integrations → Custom Repositories.
  3. Add this repository:
    https://github.com/Geek-MD/USGS_Quakes
    
    Select type: Integration
  4. Install and restart Home Assistant.
  5. Go to Settings → Devices & Services → Add Integration and select USGS Quakes.

Option 2: Manual Installation

  1. Download this repository.
  2. Copy the folder custom_components/usgs_quakes/ into your Home Assistant config/custom_components/ directory.
  3. Restart Home Assistant.
  4. Add the integration via the UI.

🔧 Configuration

All configuration is done through the UI.

Options

  • Latitude / Longitude – Your location
  • Radius (Km) – Max distance to include earthquakes
  • Minimum Magnitude (Mw) – Ignore earthquakes below this
  • Feed Type – Select from 20 different USGS feeds (past hour, day, week, etc.)

You can modify these settings anytime from the integration’s Options menu.


📡 Feed Types

Supported USGS feed types include:

  • All earthquakes (past hour, day, week, month)
  • Only significant events
  • Filtered by magnitude: 1.0+, 2.5+, 4.5+

Full list: USGS GeoJSON Feed Documentation


🧪 Sensor: sensor.usgs_quakes_latest

This sensor exposes:

  • state: Timestamp of the latest event
  • events: List of the last 10 new earthquakes
  • formatted_events: Multiline string with summary info

Example:

M 5.2 - Near Valparaíso, Chile
Place: 8 km NW of Valparaíso
Magnitude: 5.2 Mw
Date/Time: 2025-09-18 04:33:22
Location: https://www.google.com/maps?q=-33.0458,-71.6197

🚀 Manual Feed Refresh

Call the following service to manually refresh the earthquake feed:

service: usgs_quakes.force_feed_update

You can trigger this from Developer Tools, automations, or UI buttons.


💡 Optional Lovelace Cards

For visualizing data in Lovelace, install the USGS Quakes Cards from USGS Quakes Cards repository:

  • Map of recent earthquakes
  • List of formatted events
  • Button to manually refresh the feed

These cards are not included in this repository and must be added manually or via HACS (coming soon).


📓 Notes

  • On first setup, all events matching the filters are included.
  • On updates, only new events (based on USGS id) are added.
  • Sensor shows events in reverse chronological order (newest first).
  • All magnitude and distance values follow standard units (Mw, km).

🙋‍♂️ Credits

Developed by @Geek-MD
Powered by USGS GeoJSON Feed

Special thanks to @AdamsLab01 for reporting critical bugs and improvements.


📄 License

MIT © Edison Montes @GeekMD


💻 Proudly developed with GitHub Copilot 🚀

About

USGS Home Assistant custom integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages