Skip to content

ARSO potresi is a repository which contains a Home Assistant custom component integration for information about seismic events like earthquakes in Slovenia. Data provided by ARSO.

License

Notifications You must be signed in to change notification settings

andrejs2/arso_potresi

Repository files navigation

ARSO Potresi - Home Assistant Custom Component

Python License Maintainer Home Assistant HACS GitHub Release

Made in Slovenia

BuyMeCoffee GitHub Sponsors

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

ARSO Potresi is a custom integration for Home Assistant that fetches earthquake data from the ARSO Potresi API and presents it as a sensor entity. The sensor displays the most recent earthquake's location (e.g., "6 km JV od Jelšan") as its state, while additional details are available as attributes.

Data provided by ARSO Potresi - Agencija RS za okolje. This integration is unofficial.

Features

  • Real-Time Data: Fetches the latest earthquake information directly from the ARSO Potresi API.
  • Dual Sensors:
    • Main Sensor (sensor.arso_potresi): Displays key data such as local and UTC times, location, coordinates, depth, magnitude, EMS-98 intensity, and verification status.
    • Map Sensor (sensor.zadnji_potres_magnituda): Enables easy visualization of the latest earthquake on the Home Assistant map, with the magnitude displayed inside the marker.
  • Structured History: A detailed history of past earthquakes is available as structured attributes on the main sensor.
  • Fully Configurable via UI: The integration can be fully configured through the Home Assistant UI, including the update interval and the number of days for historical data.

Installation

HACS Button:

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual Installation

  1. Place the integration folder in your Home Assistant custom_components directory:
    custom_components/arso_potresi/
    ├── __init__.py
    ├── const.py
    ├── config_flow.py
    └── sensor.py
    
    
  2. Restart Home Assistant.

Installation via HACS

If you use HACS, you can add this repository as a custom integration following the HACS documentation for custom integrations.

Configuration

This integration is configured via the UI using Home Assistant's Config Flow. No YAML configuration is required.

  1. Go to Settings > Devices & Services > Integrations.
  2. Click Add Integration and search for ARSO Potresi.
  3. In the configuration dialog, set the Update interval (in minutes) and the History days (e.g., 7 days).
  4. Complete the setup. The integration will create a sensor entity named sensor.arso_potresi that displays the most recent earthquake’s location as its state and includes all details as attributes.

Reconfiguration

You can change the settings at any time without having to delete and re-add the integration. Simply navigate to Settings > Devices & Services > Integrations, find the ARSO Potresi integration, and click the Configure button to edit the options.

Map Display

To display the latest earthquake on a map, use the standard map card with the following configuration:

type: map
entities:
  - entity: sensor.zadnji_potres_magnituda
    label_mode: state

Zajeta slika

How It Works

  • Data Fetching: The sensor fetches data from the ARSO Potresi API. It assumes that the first element in the returned JSON is the latest earthquake event.
  • Earthquake History: The integration now stores a list of earthquakes in the attribute Zgodovina potresov. This list includes all earthquakes that occurred within the selected time period (configured by history_days). This allows you to display historical data in a Lovelace card.
  • Data Formatting: - Local Time: Formatted from the API's TIME field (e.g., "20. 2. 2025 ob 23.11").
    • UTC Time: Derived from the TIME_ORIG field.
    • Coordinates: Latitude and longitude values are formatted with a comma as the decimal separator.
    • Additional Attributes: Depth (with "km" appended), magnitude (formatted with one decimal and a comma), EMS-98 intensity (displayed as "-" if null), and verification status based on the REVISION field.

Device Information

The sensor registers as a device in Home Assistant with the following information:

  • Identifiers: (arso_potresi, arso_potresi_sensor)
  • Name: ARSO Potresi
  • Manufacturer: ARSO
  • Model: Potresi

Troubleshooting

  • Integration Not Showing Up:

  • Ensure that the integration is placed in the correct directory: custom_components/arso_potresi/

  • Check your Home Assistant logs for errors.

  • Restart Home Assistant after installation.

  • Data Issues:

  • Check the logs for any error messages during data fetch.

Contributing

Contributions are welcome!

License

This project is licensed under the MIT License.

About

ARSO potresi is a repository which contains a Home Assistant custom component integration for information about seismic events like earthquakes in Slovenia. Data provided by ARSO.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages