Dusan Vojacek
62a5c64f77
HOTFIX web: /status/full 500 (str→tzinfo), /plan/compare 500 (chybějící comparison), canonical PV fn 4.5s→0.4s (force_custom_plan)
...
CI and deploy / migration-check (push) Successful in 19s
CI and deploy / deploy (push) Successful in 1m17s
1) full_status._iso_utc dostával z JSONB bundle stringy → AttributeError → 500
celého /status/full; nyní parsuje přes _parse_ts.
2) /plan/compare: NameError — 'comparison = _bundle_from_current(compare_raw)'
se nikdy nesestavilo (smazaný řádek), endpoint vždy 500.
3) fn_forecast_pv_slots_range_canonical_ab: PG 18 cachuje plány SQL funkcí →
generický plán 4.5 s / 607k buffers; set plan_cache_mode=force_custom_plan
→ 0.4 s / 34k (změřeno explain analyze na živé DB). Táhne /plan/current,
/plan/compare i rolling plánovač.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 15:48:10 +02:00
Dusan Vojacek
9213d3544b
HOTFIX 3: comment signatura (int, boolean) — deploy R__018 padal 42883; force refresh po PATCH kalibrace
...
CI and deploy / migration-check (push) Successful in 18s
CI and deploy / deploy (push) Successful in 1m0s
Throttle commit změnil signaturu fn_refresh_site_pv_delta_profile_cache na
(int, boolean default false), ale comment on function dál mířil na (int) →
repeatable migrace selhala (function does not exist), oba deploye (7da7205
i 18bf93a ) spadly — na produkci NENÍ nic z delta hotfixů. PATCH kalibrace
nově volá refresh s p_force=true (throttle nesmí zadržet přepočet po změně
parametrů).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 14:54:42 +02:00
Dusan Vojacek
11767dfdbd
HOTFIX výkon: delta-profile cache 44 s/site se přepočítávala každých 15 min
...
CI and deploy / deploy (push) Has been cancelled
CI and deploy / migration-check (push) Has been cancelled
fn_fill_forecast_accuracy (tick :02/:17/:32/:47, 4 lokality) na konci volá
fn_refresh_site_pv_delta_profile_cache → fn_pv_forecast_delta_profile =
agregace 120 dní nad 4.1M řádky forecast_accuracy = ~44 s/site na prod
→ ~3 minuty plné DB zátěže KAŽDOU čtvrthodinu → timeouty /sites a
/health/detailed (30 s), celodenní 'pomalý server'.
Fix: (1) cache refresh throttle 6 h přes delta_profile_cached_at (+p_force;
profil má 14d poločas — 4×/den bohatě stačí); (2) 15min tick lookback
48→3 h (insert část); (3) denní 48h catch-up job 05:50.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 14:25:27 +02:00
Dusan Vojacek
0e7f7b69ae
Discord bot fáze B: tlačítka na EV zprávě → patch session + okamžitý replan
...
CI and deploy / migration-check (push) Successful in 21s
CI and deploy / deploy (push) Has been skipped
services/discord_bot.py: gateway klient jako lifespan task (spojení ven,
žádný veřejný endpoint; bez DISCORD_BOT_TOKEN tiše spí). Tlačítka
[za 2h][za 4h][ráno][do plna][nenabíjet] s custom_id ev:<site>:<charger>:<akce>
(přežijí restart); whitelist DISCORD_ALLOWED_USER_IDS; akce = fn_ev_session_
apply_patch → run_rolling_replan → export_setpoints → edit zprávy novým plánem.
services/ev_notify.py: sdílený builder souhrnu (vyčleněno z collectoru),
send bot-first s webhook fallbackem. requirements: discord.py>=2.4.
7 testů helperů (parse, deadline akce vč. morning přes Prague TZ).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 11:41:05 +02:00
Dusan Vojacek
4095f0f912
EV spotřební forecast: týdenní rytmus vozidla → target SoC a deadline session
...
CI and deploy / migration-check (push) Successful in 19s
CI and deploy / deploy (push) Successful in 56s
Myšlenka uživatele: pondělní služebka ~150 km (~35 kWh) chce skoro plnou,
konec týdne stačí míň, víkend = levné sloty na přípravu pondělka.
- V089: ev_vehicle_obs (odometer+SoC při příjezdu/ODJEZDU — auto v obou
okamžicích vzhůru, žádné buzení navíc), ev_trip (km z odometru, kWh z ΔSoC;
nabíjení cestou → charged_away flag), ev_usage_stats per (vozidlo, DOW);
asset_vehicle: target_soc_forecast_enabled (default false), min_target_soc_pct
- R__096: fn_ev_build_trips (párování), fn_update_ev_usage_stats (job 00:50),
fn_ev_next_departure (příští typický odjezd, >=4 vzorky, >=3 km),
fn_ev_required_soc (P80 spotřeby dne + 10 p.b., clamp [min_target, 100])
- R__016: session při příjezdu bere forecast target+deadline (za per-vozidlo
flagem, fallback defaulty, ruční patch vždy vyhrává) → víkendová session
s pondělním deadline = v2 solver přirozeně nabije v levných slotech
- tesla_client: + vehicle_state endpoint (odometer v MÍLÍCH → km), collector:
departure hook, lifespan: job 00:50
Aktivace po nasbírání dat: update asset_vehicle set target_soc_forecast_enabled=true.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-12 09:06:10 +02:00
Dusan Vojacek
60176fc7b2
Tesla Fleet API: čtení SoC po příjezdu k wallboxu
...
CI and deploy / deploy (push) Successful in 58s
CI and deploy / migration-check (push) Successful in 16s
- services/tesla_client.py: access token s cache + ROTACE refresh tokenu do
ems.tesla_token (env jen seed — Tesla refresh token je jednorázový),
vehicles → vehicle_data?endpoints=charge_state, 408 (spící auto) = tiché
přeskočení, výběr vozidla dle VIN / jediného na účtu (VIN se auto-naučí)
- hook _patch_session_from_tesla v _on_ev_arrival: PŘED replanem doplní
soc_at_connect_pct (+ target z charge_limit_soc) do otevřené session přes
fn_ev_session_apply_patch (rozšířena o soc_at_connect_pct) — energii si
odvodí fn_planning_site_context (SQL-first); selhání neblokuje replan
- V086: asset_vehicle.vin, api_type='tesla' pro tesla-my (Model Y, home-01),
singleton ems.tesla_token; R__095: fn_tesla_token_get/upsert,
fn_tesla_arrival_context, fn_vehicle_set_vin
- config: TESLA_CLIENT_ID/SECRET/REFRESH_TOKEN (prázdné = vypnuto)
- testy parserů; plná sada beze změny
Aktivace: env do /opt/ems-deploy/.env + recreate backendu (docs/tesla-fleet-api.md §Stav).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 23:29:24 +02:00
Dusan Vojacek
e42569f629
Režimy: okamžitá exekuce setpointů po ručním přepnutí módu
...
CI and deploy / deploy (push) Successful in 41s
CI and deploy / migration-check (push) Successful in 25s
Control exporter běží jen v minutách 14/29/44/59 — po POST /mode střídač
až ~15 min jel podle starého plánu (uživatel: 'SELF_SUSTAIN se jen přestane
řídit'). Defaulty režimů exporter umí správně (SELF_SUSTAIN: 108/109=max A,
export 0; PRESERVE: lock; CHARGE_CHEAP: max nabíjení bez exportu; MANUAL:
bez zápisu) — chyběl jen trigger. Fix: fire-and-forget export_setpoints
hned po fn_set_mode (chyby do logu, API neblokuje Modbus).
Pozn.: systémové přepnutí mismatch→SELF_SUSTAIN dál čeká na 2min verify tick
— případné zrychlení řešit v notification_service (mimo rozsah).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-11 16:35:25 +02:00
Dusan Vojacek
d984716f69
speedup zalozka planning
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-05-21 10:37:32 +02:00
Dusan Vojacek
7490ac3d70
planner v2 vc. porovnani
CI and deploy / migration-check (push) Failing after 20s
CI and deploy / deploy (push) Has been skipped
2026-05-15 23:03:32 +02:00
Dusan Vojacek
f3a7b0c64f
FE cutoff vizsualize
CI and deploy / deploy (push) Has been skipped
CI and deploy / migration-check (push) Failing after 11s
2026-04-29 13:47:57 +02:00
Dusan Vojacek
30585c9779
fix
CI and deploy / migration-check (push) Failing after 18s
CI and deploy / deploy (push) Has been skipped
2026-04-27 18:48:04 +02:00
Dusan Vojacek
50a0ca95f4
implementace LED loxone u zaporncyh cen
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped
2026-04-26 22:49:47 +02:00
Dusan Vojacek
1d04790f28
extend webhook per site
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-04-26 22:04:48 +02:00
Dusan Vojacek
1dfab8c7a1
dalsi uprava vypoctu delty (ignorujeme orezane vyroby)
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped
2026-04-22 22:42:12 +02:00
Dusan Vojacek
568b584748
kalibrace per pole
CI and deploy / migration-check (push) Failing after 9s
CI and deploy / deploy (push) Has been skipped
2026-04-22 22:17:28 +02:00
Dusan Vojacek
5a66cfa63f
ladime a ladime
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-04-22 21:05:14 +02:00
Dusan Vojacek
bc0966e4c4
tune forecast correction parametersw
CI and deploy / migration-check (push) Failing after 9s
CI and deploy / deploy (push) Has been skipped
2026-04-22 20:47:32 +02:00
Dusan Vojacek
e085068069
fix forecast korekce
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped
2026-04-22 19:40:55 +02:00
Dusan Vojacek
9ca4b4c577
korkece fve predikce, grafy predikci
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped
2026-04-22 19:26:46 +02:00
Dusan Vojacek
ffe80679cc
move OTE import na 13:25 a 13:12
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-04-20 13:20:05 +02:00
Dusan Vojacek
a07f5d57cb
fix 500
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped
2026-04-20 11:11:47 +02:00
Dusan Vojacek
e3776226a4
implmentace plan guardu
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped
2026-04-19 23:10:25 +02:00
Dusan Vojacek
ee4355f17f
fix FE 96h forecast
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped
2026-04-19 21:40:55 +02:00
Dusan Vojacek
f48a7aad61
zkraceni intervalu planneru na max 35h
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-04-19 21:09:48 +02:00
Dusan Vojacek
014c6f193b
refactor main.py
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped
2026-04-19 20:42:53 +02:00
Dusan Vojacek
93f883f5e0
sql first refactor
CI and deploy / migration-check (push) Successful in 5s
CI and deploy / deploy (push) Failing after 20s
2026-04-19 20:02:20 +02:00
Dusan Vojacek
a1aa6acf61
Add support for inverter current caps in site configuration
...
deploy / deploy (push) Failing after 55s
test / smoke-test (push) Successful in 3s
- Introduced `InverterModbusCurrentCapsBody` model for updating max charge and discharge currents.
- Updated SQL queries to utilize `COALESCE` for effective current limits.
- Modified relevant tests to reflect changes in battery current handling.
- Added new SQL migration for `deye_register_max_current_a` columns in the database.
2026-04-19 12:10:37 +02:00
Dusan Vojacek
f0dfcefd54
fix letni /zimni cas OTE
deploy / deploy (push) Successful in 19s
test / smoke-test (push) Successful in 5s
2026-04-12 21:57:37 +02:00
Dusan Vojacek
d7e6226962
fix graf v sql
deploy / deploy (push) Successful in 20s
test / smoke-test (push) Successful in 7s
2026-04-12 21:00:36 +02:00
Dusan Vojacek
f7d3162eb7
fix forecast graf
deploy / deploy (push) Successful in 1m30s
test / smoke-test (push) Successful in 7s
2026-04-12 20:55:10 +02:00
Dusan Vojacek
71d8405cee
new site BA81, tuyne forecast
deploy / deploy (push) Successful in 23s
test / smoke-test (push) Successful in 5s
2026-04-12 20:11:50 +02:00
Dusan Vojacek
4e81a36371
stranka configuration
test / smoke-test (push) Has been cancelled
deploy / deploy (push) Has been cancelled
2026-04-12 16:56:44 +02:00
Dusan Vojacek
b50041cfc7
do flow pridana ekonomika
deploy / deploy (push) Successful in 1m21s
test / smoke-test (push) Successful in 5s
2026-04-10 23:06:25 +02:00
Dusan Vojacek
f714cab0ab
nova stranka flow a obsluha
deploy / deploy (push) Successful in 8m52s
test / smoke-test (push) Successful in 5s
2026-04-10 22:13:58 +02:00
Dusan Vojacek
806274cf59
uprava adutiu - nacitani dalsich registru, uprava ekonomiky
deploy / deploy (push) Failing after 1m15s
test / smoke-test (push) Successful in 2s
2026-04-10 21:53:32 +02:00
Dusan Vojacek
c955efb9cb
uprava zapisovani casu do deye (nevyvolava self_sustain), notifikace na discord pri zmene rezimu
deploy / deploy (push) Failing after 20s
test / smoke-test (push) Successful in 3s
2026-04-06 20:53:58 +02:00
Dusan Vojacek
61892b258a
priprava multisite
deploy / deploy (push) Successful in 18s
test / smoke-test (push) Successful in 5s
2026-04-05 21:56:58 +02:00
Dusan Vojacek
5fcc47bce2
implementace Ekonomiky
test / smoke-test (push) Successful in 5s
deploy / deploy (push) Successful in 11s
2026-04-05 20:10:43 +02:00
Dusan Vojacek
182d5a37e1
third version before modbus cleanup
2026-04-03 16:03:06 +02:00
Dusan Vojacek
9f4126946d
second version
2026-04-03 14:23:16 +02:00
Dusan Vojacek
897b95f728
x
2026-03-20 14:30:03 +01:00
Dusan Vojacek
2cc5ccfda7
x
2026-03-20 14:29:43 +01:00
Dusan Vojacek
8b4af663d8
Initial commit
...
Made-with: Cursor
2026-03-20 13:27:44 +01:00