{"id":49944611,"url":"https://github.com/fistacho/ha-eon-pl","last_synced_at":"2026-05-17T14:08:31.644Z","repository":{"id":354488717,"uuid":"1223854916","full_name":"Fistacho/ha-eon-pl","owner":"Fistacho","description":"Home Assistant custom integration for E.ON Polska (Mój E.ON) — energy consumption, OZE production, hourly stats for Energy Dashboard","archived":false,"fork":false,"pushed_at":"2026-04-28T18:51:56.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T20:29:16.107Z","etag":null,"topics":["energy","eon","hacs","hacs-integration","home-assistant","homeassistant","oze","photovoltaics","poland","smart-meter"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fistacho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T18:08:31.000Z","updated_at":"2026-04-28T18:51:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Fistacho/ha-eon-pl","commit_stats":null,"previous_names":["fistacho/ha-eon-pl"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Fistacho/ha-eon-pl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fistacho%2Fha-eon-pl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fistacho%2Fha-eon-pl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fistacho%2Fha-eon-pl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fistacho%2Fha-eon-pl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fistacho","download_url":"https://codeload.github.com/Fistacho/ha-eon-pl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fistacho%2Fha-eon-pl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33141448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["energy","eon","hacs","hacs-integration","home-assistant","homeassistant","oze","photovoltaics","poland","smart-meter"],"created_at":"2026-05-17T14:08:30.603Z","updated_at":"2026-05-17T14:08:31.637Z","avatar_url":"https://github.com/Fistacho.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E.ON Polska — Home Assistant Add-on\n\nAutomatyczne pobieranie zużycia energii z **Mój E.ON** do Home Assistant. Login `email + hasło` raz w configu addona — reszta dzieje się sama.\n\n![iot_class](https://img.shields.io/badge/iot_class-cloud_polling-blue)\n![type](https://img.shields.io/badge/type-HA_Add--on-green)\n\n## Co robi\n\n- **Logowanie automatyczne** — Selenium + chromium odpalane on-demand (~30 s peak), jeśli portal zaakceptuje reCAPTCHA v3.\n- **Tryb ręcznego ciasteczka** — wariant bez CapSolvera: logujesz się normalnie w przeglądarce i wklejasz `.AspNet.Cookies` albo pełny nagłówek `Cookie` w Web UI.\n- **Hourly imported / exported** → Home Assistant **external statistics** (Energy Dashboard).\n- **Year-to-date backfill** przy pierwszym uruchomieniu (chunki 60 dni).\n- **Live \"ostatnia godzina\"** sensors (`pobrana / wprowadzona / bilans`).\n- **Roczne agregaty** + **bieżący okres rozliczeniowy** z `GetBillingData` / `GetOzeAgrData`.\n- **MQTT auto-discovery** — encje pojawiają się w HA same.\n- **Web UI ingress** — status sesji, ostatni login, ręczny refresh.\n- Self-healing: keepalive co 5 min, automatyczne re-login co 12 h lub przy 302 do `/Logowanie`.\n\n## Wymagania\n\n- Home Assistant OS / Supervised z dostępem do Add-on Store\n- **MQTT broker** (np. addon Mosquitto) — addon korzysta z auto-discovery\n- Konto na \u003chttps://eon.pl/mojeon\u003e\n\n## Instalacja\n\n1. **Settings → Add-ons → Add-on Store → ⋮ → Repositories**\n2. Dodaj: `https://github.com/Fistacho/ha-eon-pl`\n3. Zainstaluj **E.ON Polska**\n4. **Configuration**:\n\n   ```yaml\n   email: twoj@email.pl\n   password: TwojeHasło\n   scan_interval_hours: 6\n   cookie_refresh_hours: 12\n   manual_cookie_only: false # true = bez Selenium/CapSolver, tylko wklejone cookie\n   selected_kus: []          # puste = wszystkie aktywne KU\n   log_level: info\n   mqtt_discovery: true\n   ```\n\n5. **Start**\n6. **Open Web UI** — zobacz status, kliknij \"Pobierz dane teraz\" jeśli chcesz przyspieszyć pierwszy fetch.\n\nEncje pojawiają się w HA przez MQTT auto-discovery w ciągu kilku sekund po pierwszym fetchu.\n\nJeśli automatyczne logowanie kończy się błędem reCAPTCHA, ustaw `manual_cookie_only: true`, uruchom addon, otwórz **Open Web UI** i wklej `.AspNet.Cookies` albo pełny nagłówek `Cookie` skopiowany po ręcznym zalogowaniu na `eon.pl`. Addon będzie zapisywał odnowione cookie, jeśli E.ON zwróci nowe `Set-Cookie` podczas keepalive albo pobierania danych.\n\n## Encje (per KU+PPE)\n\n| Encja | Typ | Źródło |\n| --- | --- | --- |\n| `sensor.eon_\u003ckey\u003e_consumption_current_period` | total_increasing kWh | `GetBillingData` |\n| `sensor.eon_\u003ckey\u003e_imported_year` | total_increasing kWh | `GetOzeAgrData` |\n| `sensor.eon_\u003ckey\u003e_exported_year` | total_increasing kWh | `GetOzeAgrData` |\n| `sensor.eon_\u003ckey\u003e_balance_year` | total kWh | `GetOzeAgrData` |\n| `sensor.eon_\u003ckey\u003e_last_hour_imported` | total kWh | hourly CSV |\n| `sensor.eon_\u003ckey\u003e_last_hour_exported` | total kWh | hourly CSV |\n| `sensor.eon_\u003ckey\u003e_last_hour_balance` | total kWh | hourly CSV |\n\nPlus **external statistics** (Energy Dashboard):\n\n- `eon_pl:imported_\u003cPPE\u003e` — godzinowy kumulowany pobór\n- `eon_pl:exported_\u003cPPE\u003e` — godzinowy kumulowany eksport\n\n## Energy Dashboard\n\n**Settings → Dashboards → Energy**:\n\n- **Electricity grid → Add consumption** → `eon_pl:imported_\u003cPPE\u003e`\n- **Electricity grid → Add return** → `eon_pl:exported_\u003cPPE\u003e`\n- **Solar panels → Add solar production** → encja Twojego inwertera\n\n## Architektura\n\n```text\n┌──────────────────────────────────────────┐\n│ HA Add-on container                       │\n│                                            │\n│ ┌──────────┐  ┌─────────────────┐         │\n│ │ Web UI   │  │ Main loop        │         │\n│ │ (ingress)│  │  - keepalive 5min │         │\n│ └─────┬────┘  │  - fetch every Nh │         │\n│       │       │  - relogin every Nh│        │\n│       │       │    or manual cookie │        │\n│       └──────►│  - on-demand login │        │\n│               └────┬─────────┬─────┘         │\n│                    ▼         ▼               │\n│          ┌──────────────┐  ┌─────────────┐  │\n│          │ Playwright + │  │ httpx async │  │\n│          │ chromium     │  │ → eon.pl    │  │\n│          │ (on-demand)  │  └─────────────┘  │\n│          └──────────────┘                    │\n│                              │               │\n│       ┌──────────────────────┴────┐          │\n│       ▼                           ▼          │\n│  ┌─────────┐              ┌──────────┐       │\n│  │  MQTT   │ → discovery  │ HA REST  │       │\n│  │ pub     │   + state    │ recorder │       │\n│  └─────────┘              │ statistics│      │\n│                           └──────────┘       │\n└──────────────────────────────────────────────┘\n```\n\n**RAM profile:**\n\n- Idle: ~30 MB (sam Python + httpx + aiomqtt)\n- Login peak: ~500 MB przez ~30 s (chromium), potem zwolniony\n- Średnio: ~30 MB\n\n## Migracja z `custom_components/eon_pl`\n\nStary HACS-ready custom_component (v0.1–v0.2) został zarchiwizowany w git history (tag `v0.2.1`). Addon to kompletny rewrite:\n\n- Stare encje `sensor.e_on_*` z entity_registry można bezpiecznie usunąć (Settings → Devices \u0026 Services → ⋮ → Entities → filter `e_on`).\n- Stare `eon_pl:imported_\u003cPPE\u003e` external statistics **zostają w recorderze** — addon wznawia od ostatniej znanej sumy, żadnych dziur w Energy Dashboard.\n- W configu HA **nie** trzeba nic dodawać — addon publikuje wszystko przez MQTT discovery.\n\n## Limitacje\n\n- Hourly data ma **24–48 h opóźnienia publikacji**. Addon używa `today − 3` jako górnej granicy okna.\n- Wymaga MQTT brokera w HA.\n- Nieafiliowany z E.ON Polska. Korzystasz na własne ryzyko.\n\n## License\n\nMIT — patrz [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffistacho%2Fha-eon-pl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffistacho%2Fha-eon-pl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffistacho%2Fha-eon-pl/lists"}