Skip to content

Repository files navigation

GitHub Release Validate OE Data Check OE Data Update OE Live Smoke HACS Custom License

home-assistant-ternopil-grid

Public repository staging copy for the Home Assistant custom integration that tracks Ternopil outage schedules and compares them against a live power probe.

Intended public repo name: home-assistant-ternopil-grid.

Included

  • custom_components/ternopil_grid/
    • the integration source
    • translations
    • diagnostics
    • config flow
    • probe logic
    • the const-contract check script
  • examples/power-grid-card.yaml
    • the current Power Grid dashboard block
  • examples/lease-source.example.json
    • portable sample input for the external DHCP / lease resolver
  • tools/export_oe_outage_data.py
    • standalone export to OE_OUTAGE_DATA-compatible JSON
  • data/Ternopil.json
    • generated outage snapshot for external consumers
  • LICENSE
  • CHANGELOG.md

Not Included

  • HomeLAB-wide dashboards outside the Power Grid block
  • shared HomeLAB Telegram bridge packages
  • Proxmox outage automation packages
  • NAS/router deploy scripts

Those stay in the main HomeLAB repo because they are environment-specific.

Project Tree

.
|-- LICENSE
|-- README.md
|-- .gitignore
|-- CHANGELOG.md
|-- hacs.json
|-- custom_components/
|   `-- ternopil_grid/
|       |-- __init__.py
|       |-- api.py
|       |-- binary_sensor.py
|       |-- config_flow.py
|       |-- const.py
|       |-- CONTRACT.md
|       |-- coordinator.py
|       |-- diagnostics.py
|       |-- manifest.json
|       |-- ping.py
|       |-- select.py
|       |-- sensor.py
|       |-- tools/
|       `-- translations/
`-- examples/
    `-- power-grid-card.yaml

Local Validation

python -m compileall .\custom_components\ternopil_grid
python .\custom_components\ternopil_grid\tools\verify_const_contract.py
python .\custom_components\ternopil_grid\tools\verify_repo_assets.py
python .\tools\verify_oe_outage_data.py
python .\tools\export_oe_outage_data.py

OE_OUTAGE_DATA Export

  • generated file path: data/Ternopil.json
  • generator: tools/export_oe_outage_data.py
  • source: live PowerOn API for Ternopil streets, outage groups, and schedules
  • update model: .github/workflows/update-oe-outage-data.yml polls every 6 hours and commits only when the exported JSON actually changes

This keeps the export low-noise on stable days while still refreshing regularly from the live PowerOn API.

Home Assistant Install

  1. Copy custom_components/ternopil_grid into your Home Assistant custom_components/ directory.
  2. Restart Home Assistant.
  3. Add the Ternopil Grid Schedule integration from the UI.
  4. Optionally import or adapt examples/power-grid-card.yaml into your dashboard.

Screenshots

Dashboard overview Today schedule card

Options menu Legacy schedule card

Dashboard overview and current schedule cards, plus the options menu and an earlier card version.

HACS

Add this repo to HACS as a custom integration repository:

  • Repository: yshved-stack/home-assistant-ternopil-grid
  • Category: Integration

Releases

  • release tags follow the integration version from custom_components/ternopil_grid/manifest.json
  • current public release tag: v1.2.4
  • human-readable release notes live in CHANGELOG.md

Notes

  • Street selection stays in the integration settings and as a config select entity.
  • The live power probe can use ICMP, TCP, HTTP, or entity-state checks.
  • Optional external lease resolution is available for standalone installs via DHCP / lease resolver.
  • Resolver order is entity IP -> DHCP/lease source -> saved manual fallback IP.
  • house_number is currently stored for context/title only. If a street maps to multiple outage groups, select the correct Outage Group explicitly until the upstream API exposes house-level resolution.
  • The dashboard block is intentionally focused on the outage view only; broader homelab logic belongs in the parent repo.

External Lease Resolution

When a selected Home Assistant device does not expose its IP directly, the integration can optionally resolve it from an external lease source.

Supported source types:

  • Lease JSON URL
  • Lease JSON file path

Supported lookup strategies:

  • auto
  • hostname
  • mac
  • entity_id

You can also provide an optional Lookup override when the automatic hints from the selected entity are not enough.

Example lease payload: examples/lease-source.example.json

About

Home Assistant custom integration for Ternopil outage schedules and live power probe state.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages