Commit Graph

175 Commits

Author SHA1 Message Date
Dusan Vojacek
85dff7f13e v2: měkký EV cíl — oportunistické nabíjení nad target (+ strop energie)
All checks were successful
CI and deploy / migration-check (push) Successful in 44s
CI and deploy / deploy (push) Has been skipped
Uživatel: 'potřebuju do X % (tvrdý), ale klidně dobij na 100 % když je to
skoro zadarmo; při záporných cenách radši do auta než nechat na střeše'.

- V094 asset_vehicle.opportunistic_value_czk_kwh (default 1.0; = hodnota
  ušetřeného BUDOUCÍHO nabíjení — auto neumí zpět, žádný noční prodej)
- R__039 ev_sessions: + headroom_wh ((100−target) % kapacity) + opp value;
  session se nenuluje po dosažení targetu, dokud má headroom
- solver_v2: dekompozice Σ(EV) == needed − unmet + opp, opp ∈ [0, headroom],
  odměna opp×value; zároveň FIX latentního bugu — při buy<0 chyběl strop
  celkové energie do auta (model mohl pumpovat bez limitu)
- 3 testy (neg ceny sají nad target po strop; běžné ceny ne; cap při opp=0);
  eval fixtures beze změny (sessions null)

Víkend (pátek nízký tvrdý cíl + víkendová negativa → samo doplní do 100 %)
vyplývá z mechanismu, žádná speciální logika.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 12:17:59 +02:00
Dusan Vojacek
15d47e8a80 Bazén: sezóna (schedulable), filtrace dle teploty vody, Loxone čidla
All checks were successful
CI and deploy / migration-check (push) Successful in 42s
CI and deploy / deploy (push) Has been skipped
- V092: ems.loxone_sensor + telemetry_loxone_sensor (hypertable) — generické
  čtení Loxone hodnot (poslouží i ohřevu/akumulačce); pool sloupce teplotní
  funkce (ref/base/per_c/min/max) + water_temp_sensor_id
- R__098 fn_pool_daily_runtime_min: clamp(base+per_c×(t−ref)) z poslední
  teploty <24 h, fallback daily_runtime_min; JSON detail pro UI/solver
- collector poll_loxone_sensors: /jdev/sps/io/<name>/state, LL.value parse,
  no-op bez čidel
- sezóna = schedulable přepínač (dokumentováno vč. SQL); hranice filtrace ×
  ohřev TČ (oddělené logiky, sdílí jen čidlo)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 11:47:03 +02:00
Dusan Vojacek
29d854f23d Bazén vizualizace + EV Discord notifikace po příjezdu (fáze A)
Some checks failed
CI and deploy / deploy (push) Has been cancelled
CI and deploy / migration-check (push) Has been cancelled
- R__097: vw_latest_pool_pump + vw_pool_pump_day_energy (denní kWh z delty
  čítače, minuty běhu) + ems_anon granty
- PoolCard na Dashboardu: stav/W/dnešní kWh+hodiny/7denní mini sloupce
- _notify_ev_arrival_plan: po příjezdu EV Discord souhrn (SoC auta → cíl,
  deadline, nabíjecí okna shlukovaná ze slotů aktivního plánu, ø cena)
- docs/discord-ev-interaction.md: fáze B (bot s tlačítky přes gateway —
  žádný veřejný endpoint; čeká na DISCORD_BOT_TOKEN od uživatele)
- docs: pool-shelly + ev-charging aktualizovány (pravidlo docs 1:1)

První commit na dev větvi (nová kadence: deploy až s milníkovým merge).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 10:59:09 +02:00
Dusan Vojacek
ab17e86900 Dokumentace: noc 11.→12. 6. — v2 aktivní, robustnostní trojice, EV forecast, CI opravy
Some checks failed
CI and deploy / migration-check (push) Successful in 16s
CI and deploy / deploy (push) Has been cancelled
- planning-changelog.md: záznam 2026-06-12 (přepnutí na v2, noční polštář /
  PV front-load / denní rampa s tabulkou, EV usage forecast, zimní posouzení)
- planning.md: default PLANNING_ENGINE_VERSION=v2 + sekce robustnosti
- refactor-clean-planner.md: Fáze 3 = v2 AKTIVNÍ
- ev-charging.md: EV spotřební forecast (sběr/statistiky/aktivace)
- consumption.md: bazál odečítá bazén
- deployment-self-hosted.md: tři CI vady + self-install deploy.sh + stop před flyway

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 10:37:20 +02:00
Dusan Vojacek
cf663ae417 Docs: pool-shelly — architektura, šablony seedů, návrh solver integrace
- šablona insertů endpoint/asset/signal_route (placeholdery IP, výkon, runtime)
- tok ovládání přes fn_signal_enqueue_bool a signal_service
- návrh pool[t] binárky analogicky hp[t] s denním runtime constraintem
- checklist oživení, otevřené otázky (sezónnost, bazál, UI)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 22:37:57 +02:00
Dusan Vojacek
5239463699 EV telemetrie: skutečné čtení Teltonika TeltoCharge (konec stub-u)
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped
poll_ev_chargers četl placeholder ('available'/0 W) — EV spotřeba se nikdy
neodečítala z bazálu a session detekce nefungovala. Nyní: blok registrů 0-40
jedním FC 3 (oficiální protokol rev 0.5), parse_teltocharge_frame (status z
reg 6 → available/preparing/charging/..., výkon reg 38, energie session reg 39,
proud max L1-L3 reg 3-5). Při selhání čtení se vzorek NEzapisuje (fabrikovaný
available by falešně ukončoval session).

fn_telemetry_ev_charger_sample: + p_current_a (drop staré 7-arg signatury).
6 nových testů parseru; plná sada beze změny. Docs: modbus-registers-teltocharge.md.

Po deployi: home-01 ev-charger-1/2 začnou posílat reálná data; bazál se začne
čistit od EV (EMA 00:30); rebuild stats má smysl až po ~2 týdnech čisté historie.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 22:10:46 +02:00
Dusan Vojacek
ad4b52c9ce Dokumentace refaktoru a delta-triage skill
- docs/refactor-clean-planner.md: plán Fází 0-4, stav, závazná pravidla
  (golden gate), návod nasazení v2 (shadow → vyhodnocení → přepnutí)
- docs/planning-changelog.md: záznam 2026-06-11 (Fáze 0-3 kompletní)
- docs/04-modules/planning.md: sekce Verze enginu v1/v2 + env flagy
- docs/audits/*: stav implementace FE fixů
- .claude/skills/ems-delta-triage: postup triáže neekonomického chování
  (realita vs plán vs shadow peer vs oracle, verdikt s Kč)
- CLAUDE.md: ukazatele na refaktor, solver_v2 a delta-triage v 'Kde hledat co'

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-11 14:45:16 +02:00
Dusan Vojacek
36cb06b9d0 Branch 5: dynamický terminal SoC factor při future neg buy
Some checks failed
CI and deploy / migration-check (push) Failing after 15s
CI and deploy / deploy (push) Has been skipped
2026-06-06 22:38:05 +02:00
Dusan Vojacek
0f7dc6ed94 Branch 4: BA81 GEN cutoff audit + exekuce při sell<0
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-06-06 22:36:27 +02:00
Dusan Vojacek
a7879f1141 Branch 3: charge-slot-budget v R__063 + odstranit v58 pro BA81/KV1 + fixed evening push
Some checks failed
CI and deploy / migration-check (push) Failing after 25s
CI and deploy / deploy (push) Has been skipped
2026-06-06 22:32:48 +02:00
Dusan Vojacek
09bca0a903 Branch 2: home-01 neg-večer — export k reserve_soc, fix pos_sell_pre_neg_buy + oddělit evening_push od prep relax
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-06-06 22:28:48 +02:00
Dusan Vojacek
2a963c9793 Branch 1: failed run journal + bisect Infeasible + granulární relaxace (bez vypnutí evening push)
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-06-06 22:23:59 +02:00
Dusan Vojacek
1429d402e5 zdokumentovani noveho pohleud na planovani nabijeni
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-06-01 19:53:04 +02:00
Dusan Vojacek
96adbff9ea nakup ve spicce aby prodal lenvneji, ale nemam jak otestovat poac uz bude po slotu (home01)
Some checks failed
CI and deploy / migration-check (push) Failing after 34s
CI and deploy / deploy (push) Has been skipped
2026-06-01 19:17:55 +02:00
Dusan Vojacek
63eff96c5f zas oprava KV1 a BA81
Some checks failed
CI and deploy / migration-check (push) Failing after 41s
CI and deploy / deploy (push) Has been skipped
2026-06-01 19:04:11 +02:00
Dusan Vojacek
0dcf11d471 oprava ranniho nenabijeni
Some checks failed
CI and deploy / migration-check (push) Failing after 50s
CI and deploy / deploy (push) Has been skipped
2026-06-01 18:50:03 +02:00
Dusan Vojacek
430e081841 oprave vercerniho nevyprodeje
Some checks failed
CI and deploy / migration-check (push) Failing after 26s
CI and deploy / deploy (push) Has been skipped
2026-06-01 18:24:57 +02:00
Dusan Vojacek
5d06f49d2b oprava
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-05-31 00:13:44 +02:00
Dusan Vojacek
111f51c06c zas oprava
Some checks failed
CI and deploy / migration-check (push) Failing after 15s
CI and deploy / deploy (push) Has been skipped
2026-05-31 00:07:43 +02:00
Dusan Vojacek
8950fafba2 oprava home-01: Infeasible při rolling hysteréze push (v53)
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-05-31 00:00:47 +02:00
Dusan Vojacek
578cf315e2 urpava KV1 vyliti v maxu v noci
Some checks failed
CI and deploy / migration-check (push) Failing after 19s
CI and deploy / deploy (push) Has been skipped
2026-05-30 23:47:44 +02:00
Dusan Vojacek
a03b45d4a9 oprava zbytecneho curtailu A
Some checks failed
CI and deploy / migration-check (push) Failing after 10s
CI and deploy / deploy (push) Has been skipped
2026-05-30 23:23:17 +02:00
Dusan Vojacek
830aa7a4cc oprava nevyberu maximalnich sell slotu (sahal i na zitejsi vecer)
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-05-30 22:56:28 +02:00
Dusan Vojacek
4f67aad4d8 a dalsi pokus o opravu
Some checks failed
CI and deploy / migration-check (push) Failing after 19s
CI and deploy / deploy (push) Has been skipped
2026-05-30 22:15:40 +02:00
Dusan Vojacek
96d0d52b07 oprava battery hold
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-05-30 22:11:03 +02:00
Dusan Vojacek
5208e035a4 a dalsi oprava
Some checks failed
CI and deploy / migration-check (push) Failing after 24s
CI and deploy / deploy (push) Has been skipped
2026-05-30 22:02:02 +02:00
Dusan Vojacek
d3e9caf0fb dalsi
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped
2026-05-29 23:34:16 +02:00
Dusan Vojacek
308c24f029 dalsi
Some checks failed
CI and deploy / migration-check (push) Failing after 15s
CI and deploy / deploy (push) Has been skipped
2026-05-29 23:24:03 +02:00
Dusan Vojacek
b73c3323e1 oprava
Some checks failed
CI and deploy / migration-check (push) Failing after 28s
CI and deploy / deploy (push) Has been skipped
2026-05-29 23:04:27 +02:00
Dusan Vojacek
877f5b6180 tuning prodeje
Some checks failed
CI and deploy / migration-check (push) Failing after 18s
CI and deploy / deploy (push) Has been skipped
2026-05-29 22:45:02 +02:00
Dusan Vojacek
88df09640c Use observed SoC for neg-prep cushion and evening drain (v40).
Some checks failed
CI and deploy / migration-check (push) Failing after 26s
CI and deploy / deploy (push) Has been skipped
Pre-neg forecast cushion and evening push before negative-sell days now use telemetry SoC instead of chaining LP targets across days, so the planner does not stop discharging early when BMS is higher than the model.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 00:20:05 +02:00
Dusan Vojacek
a7dff75e58 Add export plan guard to block Deye export against plan.
Some checks failed
CI and deploy / migration-check (push) Failing after 39s
CI and deploy / deploy (push) Has been skipped
Force PASSIVE/no-export when sell is negative or export_mode is NONE,
and alert NEG_SELL_EXPORT in plan_actual_slot_guard when export still occurs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 00:14:52 +02:00
Dusan Vojacek
620a557a89 Align evening push with peak-band candidates and dynamic Wh budget.
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped
Restore _evening_peak_export_indices filter so push slots are chosen from
profitable peak-band nights, then ranked by sell until the Wh budget is
exhausted—not all profitable night slots and not a fixed top-3. Docs and
tests match v39 SoC balance tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 00:10:27 +02:00
Dusan Vojacek
ba0b55bf10 Fix SoC balance on battery export and improve evening push (v39).
Some checks failed
CI and deploy / migration-check (push) Failing after 38s
CI and deploy / deploy (push) Has been skipped
SoC continuity now deducts only bd (ge_bat was double-counted via energy
balance), which stopped the plan from draining ~2× faster than BMS during
evening BATTERY_SELL. Also ships dynamic evening push budget + rolling
hysteresis (v38), drops unused fn_soc_tracking_bundle, and adds tests/docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 00:04:48 +02:00
Dusan Vojacek
52e4b68789 ski battery charge u sell
Some checks failed
CI and deploy / migration-check (push) Failing after 26s
CI and deploy / deploy (push) Has been skipped
2026-05-28 23:22:57 +02:00
Dusan Vojacek
d1ba864fc0 oprava ranniho nabijeni a oprava bodu T
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-05-26 14:09:19 +02:00
Dusan Vojacek
58b0a2f882 implementace dynamickeho bodu T (kde se rodpojuje PV A)
Some checks failed
CI and deploy / migration-check (push) Failing after 15s
CI and deploy / deploy (push) Has been skipped
2026-05-26 13:28:31 +02:00
Dusan Vojacek
a53bcd0b81 dokumentace planu
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-05-26 13:00:33 +02:00
Dusan Vojacek
94eb256598 planovac reesi load first
Some checks failed
CI and deploy / migration-check (push) Failing after 21s
CI and deploy / deploy (push) Has been skipped
2026-05-26 09:05:33 +02:00
Dusan Vojacek
b4e5fc5040 uprava aby rano prodaval do site pred sell < 0 oknem
Some checks failed
CI and deploy / migration-check (push) Failing after 20s
CI and deploy / deploy (push) Has been skipped
2026-05-26 08:29:05 +02:00
Dusan Vojacek
91a9bef3d7 implementace co nejdrive dosazeni SOC na home-01 a umozneni plneho socu n slotu ped koncem sell < 0
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-05-26 08:07:00 +02:00
Dusan Vojacek
8494ea26de nerezta PV A pri prodeji z baterie
Some checks failed
CI and deploy / migration-check (push) Failing after 28s
CI and deploy / deploy (push) Has been skipped
2026-05-26 07:34:52 +02:00
Dusan Vojacek
25c864db61 protazeni exportniho okna az do rana pred vyrobu FVE (prichazeli sme o prilezitosti mezi pulnoci a ranem)
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped
2026-05-26 00:00:06 +02:00
Dusan Vojacek
b03f08d3a0 prechazeni omezeni PV A u home-01
Some checks failed
CI and deploy / migration-check (push) Failing after 14s
CI and deploy / deploy (push) Has been skipped
2026-05-25 23:28:47 +02:00
Dusan Vojacek
18ace46ea9 fix spravneho prodeje do site
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-05-25 13:44:30 +02:00
Dusan Vojacek
2e27c8c5de oprava exportu bateir do site vecer
Some checks failed
CI and deploy / migration-check (push) Failing after 24s
CI and deploy / deploy (push) Has been skipped
2026-05-25 12:20:51 +02:00
Dusan Vojacek
91af5c76c2 fix max sell z baterky
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped
2026-05-25 11:59:03 +02:00
Dusan Vojacek
c6074e9c74 nastavitelny max sollar dle stridace (ulozeno v DB)
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-05-25 11:25:29 +02:00
Dusan Vojacek
e06f76b9ff uprava PV omeznovani
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped
2026-05-25 11:08:01 +02:00
Dusan Vojacek
f1a4dbd7e7 zruseni fixnich konstant
Some checks failed
CI and deploy / migration-check (push) Failing after 20s
CI and deploy / deploy (push) Has been skipped
2026-05-25 09:41:06 +02:00