diff --git a/tools/debug-journal.md b/tools/debug-journal.md index 22b4ee03a5..78d2cf34c5 100644 --- a/tools/debug-journal.md +++ b/tools/debug-journal.md @@ -85,7 +85,7 @@ Two more shapes from the GH#5169/PR #5171 round (code-read plus one observed red **A found pair does not by itself say whether the fix belongs in the culprit's test cleanup or in the production code the victim exercises.** The first pair found (`calculate_yesterday` → `prediction_batch`, crashing on `self.car_charging_battery_size[car_n]` in `prediction.py:768` with no bounds check against `self.num_cars`) initially looked like it might be a real latent gap, since a genuine divergence between those two in production would crash the same way — but `calculate_yesterday()` turned out not to touch `car_charging_battery_size` at all, so that one traced back to test-fixture state, not a live code path. Check both before writing a fix. -Unknown apps.yaml keys are **silently ignored** — `validate_config()` (`predbat.py:1459`) iterates over `APPS_SCHEMA` checking required-ness and type and never the reverse, so a typo'd or obsolete key produces no diagnostic at all. The nearest thing to a net is `unmatched_args` (`userinterface.py:1209`), which only captures args whose `re:` regex matched nothing (GH#4999 is the enhancement request for a warning). If that warning ever gets implemented, the allowlist cannot be `APPS_SCHEMA` alone: component yaml blocks (`octopus:`, `web:`, …) are validated via `COMPONENT_LIST` (`components.py:56`), Predbat injects derived args at runtime via `set_arg()` (so the check must read the startup snapshot `args_from_apps_yaml`, not live `self.args`), and dict-valued schema entries such as `predheat` have un-enumerated inner keys. +Unknown apps.yaml keys are **silently ignored** — `validate_config()` (`predbat.py:1459`) iterates over `APPS_SCHEMA` checking required-ness and type and never the reverse, so a typo'd or obsolete key produces no diagnostic at all. The nearest thing to a net is `unmatched_args` (`userinterface.py:1209`), which only captures args whose `re:` regex matched nothing (GH#4999 is the enhancement request for a warning). If that warning ever gets implemented, the allowlist cannot be `APPS_SCHEMA` alone: component yaml blocks (`octopus:`, `web:`, …) are validated via `COMPONENT_LIST` (`components.py:56`), Predbat injects derived args at runtime via `set_arg()` (so the check must read the startup snapshot `args_from_apps_yaml`, not live `self.args`), and dict-valued schema entries such as `predheat` have un-enumerated inner keys. Same class, different gap (verified by reading the dispatch in full, 2026-11-02, PR #5808 review): an `APPS_SCHEMA` `allowed: [...]` list is enforced **only inside the string and integer branches** of `validate_config()`'s type dispatch (the `allowed` check exists at exactly two sites in `predbat.py`) — on any other type (boolean, float, dict, …) the key is silently ignored and an out-of-list value validates clean. `threads` is the only `allowed` user on main and hits the string branch through its `"string|integer"` type (the combined types split and dispatch per token); when adding `allowed` to a new item, check the branch it lands in first rather than trusting the schema key. Related, sensor-typed config items **reject fixed numeric scalars** (GH#2172, probe-verified): 13 `APPS_SCHEMA` items (`car_charging_battery_size`, `pv_forecast_today`, `car_charging_soc`, ...) are typed `{"type": "sensor"}`, and the `sensor` branch of `validate_config()` wraps a scalar into a list only when it is a *string*, so `77.4` or `100` falls through to the generic `not of type 'sensor'` error while a one-element list (`- 77.4`) passes. Two strings to search on: with `entries` resolving to 1 it is `not of type 'sensor'`; above 1 the pre-dispatch length check fires first and reports `Invalid type, expected list`. Impact is status-only (`arg_errors` zeroes the `config_valid` sensor; the value itself reads fine). Do not fix it by loosening the validator — the obvious wrap-any-scalar patch was rejected on the issue because several sensor-typed items (`pv_forecast_today`, `car_charging_soc`) should never hold a fixed value; the maintainer's direction was to fix the documentation to the list form, and that has now landed for `car_charging_battery_size` (PR #5024, v9.0.2, docs only — the validator still rejects the scalar form, and `docs/car-charging.md` now says to use the list). Start here on any "validator says X should be a sensor but the docs show a fixed value" report. @@ -109,13 +109,13 @@ Grep for the named symbol rather than trusting a line number. | Area | What past debugging found | Targeted test | |------|---------------------------|---------------| | Fox (`fox.py`) | The cloud API returns errno 42015/44096 for settings a given device does not support (`FOX_SETTINGS_UNSUPPORTED_ERRNO`); those are marked unavailable and never polled or written again. Entity type matters — WorkMode is a select, ExportLimit a number. Two later capacity/schedule traps; the first still live on main, with the fix drafted: `publish_data()` sums every capacity-carrying `batteryList` entry unconditionally (the `battery_capacity += battery.get("capacity", 0)` loop in `publish_data()`, fox.py), and an AIO ESS returns one physical pack as four `bmu` entries all carrying the inverter's own `batterySN`, so `soc_max` comes out at 4x the correct `batteryDesignCapacity` and `soc_kw` with it (GH#4919, read out of the reporter's own API response; a second reporter reproduced 40.96 kWh on a Fox **EVO 10-5-H** comment on #4919 — duplicate-serial payloads are not AIO-ESS-only, that model's payload unexamined). **Draft PR #5629 (unmerged at writing) moves the sum into `FoxAPI.battery_capacity_wh(detail)`:** no serial repeating among capacity-carrying entries returns the plain sum as before; a serial repeat returns `batteryDesignCapacity` × 1000 (which may arrive as a number or a numeric string); a repeat with an unusable design capacity counts each serial once. Until it merges keep every pre-fix reading on current logs — including "four `bmu` entries with the same serial means soc_max is 4x too big"; once it merges cut this to "fixed in #5629" and keep the signature for older logs. The discovery observer now publishes `battery_capacity_entries`/`battery_capacity_serials` ratings alongside (verified on main 2026-10-19) — neither `len(batteryList)` nor the entry count alone can tell the bug from a healthy four-module stack, but four entries against one serial is the GH#4919 signature. Not verified: whether `batteryDesignCapacity` is the whole-system total on a multi-pack stack — that is why the PR uses it only when a serial repeats. `fox_automatic: true` re-`set_arg`s `soc_max` every cycle and `soc_max` is not in `CONFIG_API_OVERRIDE`, so apps.yaml cannot override it - the escape hatch is `fox_automatic: false`. With the Mode Scheduler deleted the scheduler `enable` flag reads 0 and `compute_schedule()` (`fox.py:1080`) derives the displayed charge window from the legacy `forceChargeTime` read, which Predbat cannot clear: `set_battery_charging_time()` (`fox.py:1009`), the only writer of that endpoint, has zero production callers - re-verified on main, where it is referenced only by `test_fox_api.py` (GH#4939). Note this is the *residual* half of that issue: the blocker the reporter actually hit was HA event routing filtering on the literal string `predbat` rather than the configured entity prefix, **fixed in PR #4962**. Unlike the self-referential HA verify trap below, a Fox `didn't complete got X` is a genuine failure - the read-back polls entities the component republishes from Fox Cloud. A separate trap on the **HA/modbus path** (inverter type `FoxESS`, not `FoxCloud`): the stock template binds `reserve:` to `number.foxess_min_soc_on_grid` (`templates/fox.yaml`), and that file's own mode table ties both Freeze charging and Hold charging to that entity. A reporter had `reserve:` bound to `number.foxess_inverter_min_soc` instead - a name that appears nowhere in `templates/` or `docs/` - so Predbat never read or wrote `min_soc_on_grid`; when the inverter stranded it at 100 (observed sitting there six days) Predbat could neither see it nor clear it, and `min_soc_on_grid` at 100% stops the battery discharging while grid-connected. `FoxESS` is `has_idle_time: False` (`config.py`), so the `idle time is ...` line is bookkeeping only and never programs a demand period - discharge outside a charge window depends entirely on the inverter's own settings, which is what makes a wrong reserve binding silent (GH#4961). FoxCloud freeze export (GH#5015, **fixed in PR #5038**, v9.0.2 - keep the mechanism for pre-v9.0.2 logs): `support_feedin_first: True` makes `prediction.py`'s freeze branch model freeze export as genuine Feed-in-First — load exports up to the limit, only the surplus beyond it charges the battery — but the cloud path used to never select the `Feedin` work mode: `apply_battery_schedule()` (`fox.py`) only emitted `SelfUse`/`ForceCharge`/`ForceDischarge` groups and `adjust_inverter_mode()` hardcodes `SelfUse` for Fox (`inverter.py`), so the inverter sat in SelfUse where surplus PV charges the battery *before* exporting and the plan's freeze-export revenue didn't match the hardware. #5038 makes `apply_battery_schedule()` select `Feedin` as the baseline work mode whenever freeze export is requested; note the cloud API's verify read is slow there — a write can log success, read back pre-write 3s later and read back the new mode after ~18s (recorded in a `fox.py` comment), so a quick verify read is not evidence of failure. `support_feedin_first` therefore means two different things depending on connection method: the modelling is correct on the FoxESS HA/modbus path, where `discharge_freeze_service` genuinely selects Feed-in First (#4207, fixed by #4425), while #4582 extended the flag to the cloud defs with no equivalent execution path. Log check: a freeze-export day shows hundreds of full-day `SelfUse` groups in `Fox: New schedule` lines and never a `ForceDischarge` or `Feedin` group — and `ForceDischarge` appearing in a `Fetch scheduler V1 returned` enum list is **not** evidence a discharge window was written. Workaround: turn `set_export_freeze` off so the planner stops selecting freeze-export slots. #4182 is the neighbouring open issue. **The device MaxSoc setting is published but never bound (GH#5395, code-read on main 2026-10-04):** `number._fox__setting_maxsoc` is user-writable with a working write-back to Fox Cloud, but `automatic_config()` binds only `soc_max`/`reserve`/`battery_min_soc`/`export_limit`, there is no per-inverter max-SoC arg in `inverter.py`, and the planner's only upper ceiling is the global `best_soc_max` in kWh — so "the plan models full capacity while the inverter stops at the device's Max SoC" is a real gap; a tree-wide grep for `maxsoc` landing only in the component (plus its test) is the tell. The writer hardcodes `maxSoc: 100` on baseline/filler groups and sends `max(soc, reserve)` on charge groups, while schedule reads derive the published entity with **max across groups** — the reporter's device read back 80 against writes of 100, implying the device applies Max SoC on that write path somewhere (**unverified**). Family: #4832 (GE Cloud floor-side sibling), #2128 (the same ask as a user input number), #3837 (FoxESS modbus: the plan charge target is never written to the device max_soc entity); do not confuse with `manual_soc_max` (a time-of-day manual percent override, PR #4841). **GH#3398 — fixed in PR #5623 (merged 2026-10-24):** the ForceCharge branch of `apply_battery_schedule()` used to send `"fdSoc": 100` with the charge target only in `maxSoc`, while the read side in `compute_schedule()` keys the charge target off `maxSoc` and the discharge target off `fdSoc` — so a pre-#5623 "Fox charges past the planned ForceCharge target" report starts at that write (reporter-sourced, no live Fox API here), and pre-#5623 logs show `fdSoc: 100` on ForceCharge groups — that value is the bug, not a user setting. The fix sends `max(soc, reserve)` in all three charge-branch fields and deliberately leaves the read side alone. The other `"fdSoc": 100` literals in `compute_schedule()` (unused-slot placeholders and the legacy `forceChargeTime` slots) are read-side only and never written, so grepping them up during a fix PR is not a second bug. **A hold/freeze can drain-block through the shipped template's `charge_freeze_service` → "Back-up" mapping (GH#5704, verified 2026-10-23 against main 333c358c read + the reporter's v9.4.3 log/dump; the mapping itself re-verified in `templates/fox.yaml` on 2026-10-26):** the hold-above-target pass (`execute.py`'s `Hold charging as SoC ... is above target SoC` branch) sets reserve = target+1, disables the charge window and marks the inverter charging, and the charge-immediate block then calls `adjust_charge_immediate(..., freeze=True)` in both branches (`execute.py`) — including when `charge_limit_best[0]` is not a planner freeze — so `charge_freeze_service` runs; on FoxESS that selects `select.foxess_work_mode = "Back-up"`, a mode in which the battery supplies no house load at all, defeating the hold's reserve-based drain (the reporter's battery sat unchanged for an hour while the plan predicted a drain to 1.82 kWh; alerts are not required — a pre-alert 03:00 Back-up write was in the log; log greps: `charge_freeze_service` and `Back-up` preceding the complaint). Config workaround: removing `charge_freeze_service` makes the call fall back to `charge_stop_service` (Self Use). Suspected, not fixed: passing `freeze=True` from the charge-immediate block only for genuine planner freezes — #3200 (the alert keep rendered as a freeze window) is the complementary half of that fix. Review-convention (d) in the Traps below is the PR-review mirror of this trap. | `fox_api`, `fox_oauth` | -| Solis (`solis.py`) | `SOLIS_CID_STORAGE_MODE = 636` is Modbus 43110, a bit mask. On firmware "4B and above" (what `is_tou_v2_mode()` detects: CID 6798 reads 43605) the timed charge/discharge enable moved to the per-slot registers — `SOLIS_CID_CHARGE_ENABLE_BASE`/`..._DISCHARGE_ENABLE_BASE`, Modbus 43707, six slots not three — and every mode value carrying TOU bit 1 (3/35/43/51/98) was dropped; 35 became 33, 98 became 96. Such an inverter answers a CID 636 write with code 0 and reads back without bit 1, so a log full of CID 636 verification warnings is a refused bit, not a failed write (GH#4707). `set_storage_mode_if_needed()` decides the bit from `is_tou_v2_mode()`: never asked for on V2, always asked for and retried on V1, where bit 1 still *is* the timed charge/discharge enable. Do not try to learn it from the read-back instead — GH#4710 did, and GH#4774 showed why that cannot work: on six inverters the same write of 179 verifies minutes before and minutes after the one that reads back 177, so a single post-write read is not evidence of a firmware property. Latching it was also silent rather than noisy: the verify read refreshes `cached_values`, so after a stripped write the cache held the stripped value, the suppressed computed value matched it, and `set_storage_mode_if_needed()` stopped writing CID 636 at all for the whole 8-hour verdict — across an overnight charge window. GH#4239's "only retained while a window is configured" is not the whole story — it was refused with slot 1 enabled and its window in force. `read_and_write_cid()` re-reads once after `verify_settle_seconds` before calling a mismatch a failure, because the immediate verify read is taken about half a second after the write. On the SolisCloud select path specifically, **PR #5247 (merged 2026-09-26) makes a discovered inverter's slot-time writes run their handler immediately** so Predbat's read-back sees them in the same cycle — pre-#5247 the select callback only queued the event (GH#4875) and the queue drained at the top of `run()` up to a minute later, so the write verified against the stale value and logged a spurious `didn't complete` once per moved slot time (pass 1, V1 and the slot SoC/current writes keep their every-minute retry). Do not "stop the failed verify poisoning the cache" — `write_cid()` caches the value it *requested* and the post-write `read_cid()` deliberately overwrites it with what the inverter actually reports, so the cache mirrors the inverter rather than Predbat's intent; skipping that update would leave the cache agreeing with the write that just failed, and change detection would then never retry it. The two control paths choose the storage mode differently and it matters: V1 picks from `in_charge_slot`/`in_discharge_slot`, which are clock tests, so CID 636 changes value and gets written the moment a window opens; V2 picks from `slot1_active`, which is only "slot 1 has a window configured", so the mode is written when the slot is *programmed* and nothing at all happens at the window boundary. On the GH#4774 night the last CID 636 write was 22 minutes before the window opened, and the comparison night that worked had one near the window - so `claim_window_mode_assertion()` now asserts the mode once per window on both paths. Slot registers are polled hourly, plus every 5 minutes while `is_inside_active_window()` is true, so drift during the window that matters is caught in the same cycle it happens. GH#4774 also left a useful negative result: that inverter grid-charged from 20% to 91% overnight with bit 1 clear throughout, confirming the per-slot enables alone drive timed charging on V2 — so a "charge window never started" report on V2 firmware is not a CID 636 problem and needs looking at elsewhere. Separately, an inverter reporting `batteryType 'No Battery'` stays in `self.inverter_sn` for polling; `is_battery_inverter()` keeps control writes off it, which was most of the warning volume in GH#4707. That explanation doesn't cover every CID 636 report, though: a later GH#4707 comment showed zero `setting storage mode to` idle-mode log lines, and both V1 mode-decision idle paths always log that line — so a report with neither line cannot be coming from `write_time_windows_if_changed()` at all. The only remaining write path is the HA select handler, `set_storage_mode_value()` at `solis.py:2574`. Check which write path actually ran before assuming this entry's explanation applies. Separately, on inverters using `H M` time format (`GS_fb00`, most cloud subtypes) `adjust_force_export()` used to re-commit a stable export window every cycle — `is_hm_format` alone made `changed_start_end` true, so `press_and_poll_button()` fired on every cycle of an unchanged export window (GH#4709, confirmed live on main at the time) — and PR #4713 fixed the twin idle-cycle press where the times being managed came back as `None` and never compared equal to what the inverter still reported (GH#4712, #2328). **Both merged together in PR #4711 (`bc853a0e`, 2026-09-12, post-v9.0.2)**: `adjust_force_export()` re-commits only on a real schedule change through the commit-once ledger (`last_committed`/`commit_pending`, `commit_needed()`/`record_commit()` in `inverter.py` — the attribute this entry used to name, `last_export_schedule_committed`, is gone), and a commit is only recorded when the writes *and* the button press both succeeded; **the guard only became real when PR #5126 (merged 2026-09-26, unreleased at the time of writing) stopped rebuilding Inverter objects every cycle** — pre-#5126 the rebuild reset the latch to empty each cycle, so the guard was decorative and the every-cycle export commit (the #2328 ~288 TOU-register-write-batches/day signature) stayed live; keep that reading for pre-#5126 logs, where counting `Successfully pressed button` lines settles the actual volume. (The every-cycle `H M` time-entity rewrite remains, deliberately — #1529 write reliability); `press_and_poll_button()` takes a `side` argument so a split-button config no longer presses the unrelated side's button (which is what cleared `timed_charge_current` alongside the intended one); and `adjust_inverter_mode()` now sleeps 30s after a real window change as a GivTCP settle workaround, so expect a 30s pause per real window change on those types (the sleep is unconditional on any just-written export window — the v8.37.x `rest_data` GivTCP-REST exemption is gone since #4864 — GH#4180; open PR #5647 adds a narrow eco-toggle-only exemption — a cycle in which the eco toggle itself cannot be written (missing, a fixed value or a non-switch binding) settles nothing — narrow this on merge). Keep the mechanism for pre-merge logs, where the signature is a button press logged every 5 minutes inside a window. Away from the CID work, `automatic_config()` had an asymmetric arg-binding defect, **fixed in PR #5308 (merged 2026-09-29, v9.3.3) - keep the pre-#5308 signature:** it bound `battery_rate_max` - which fed *both* the charge and the discharge cap - to the per-device `max_charge_power` entity, while the `max_discharge_power` entity it also creates was bound to nothing; `inverter.py`'s `min(inverter_limit_discharge, battery_rate_max_raw)` then capped discharge at the charge limit on an asymmetric inverter, and `inverter_limit_discharge` could not lift it because the raw value was the binding constraint (GH#4940, confirmed against the reporter's debug yaml). The fix: Solis publishes a `battery_rate_max` sensor holding the **larger** of the two per-direction limits and binds `battery_rate_max` to it - auto-discovery still beats a manual apps.yaml value for that binding (`component_base.py:96-110`), so an apps.yaml `battery_rate_max` does not opt out - and binds `inverter_limit_charge`/`inverter_limit_discharge` to the two per-direction limits with `overwrite=False`, so an apps.yaml `inverter_limit_*` (an AC rating, a DNO cap) still wins. Separately, on Solis Cloud/TOU-V2 the per-slot current write is clamped by `write_time_windows()` (`solis.py`, `new_current = min(slot_data['discharge_current'], cap)`). **The cap's source was rewritten in PR #5314 (merged 2026-09-30, v9.3.3) - keep the pre-#5314 signature:** the cap used to be the *minimum* `sysCommand.max` metadata across all six slot CIDs from `cached_infos` — read here at the time as deliberate, but the metadata is actually a UI definition for a *list of model codes* (its `productModel`), and the cloud hands back definitions for other models: an S5-EH1P5K-L (model 3104, 5kW, registers reading 100A) was given 60A for its slot currents from the models-3101/3102 definition and 62.5A for slot 1 charge from models 3111/3140/3145's, holding exports to ~3.6kW (GH#5068). `slot_current_limits()` now ignores the metadata: the cap starts from the battery-side limit register itself (CID 7224 charge / 7226 discharge, read as-is - not multiplied by pack count - and `SOLIS_SLOT_CURRENT_DEFAULT_AMPS` when never read), and once `ensure_slot_current_probed()` has measured what the slots really accept a **measured** ceiling replaces the rated estimate (PR #5309's probe, runnable as `python3 apps/predbat/solis.py --probe-ceiling` without `--write`; it starts from the register and the sweep ends with a half-amp step, so a 62.5A ceiling is found exactly rather than rounded down, with candidates written as the inverter shows them). The verify-echo traps survive the rewrite: the number entity is republished from the local `charge_discharge_time_windows` cache, so the write verify reads back the *clamped* value converted at the **live** battery voltage (60A × ~51.6V ≈ 3094W, not 48V) and logs `didn't complete got 3094.0` every cycle — while a "Wrote N successfully now N" line can also be self-referential (cached == clamped skips the CID write entirely). Grep `CID 5967 ... is set to` to see what actually went to the inverter. The planner models `battery_rate_max_discharge` from apps.yaml/entity max and knows nothing of the clamp, so the plan is systematically optimistic while it binds; on a current build set `inverter_limit_discharge` to the measured cap × pack voltage, pre-#5314 it was 60A × pack voltage. #4220 is the same 60A clamp from the user's angle. Separately it built every arg list - PV, load and grid included - from the battery-filtered `devices` list (`solis.py:1456`, narrowed by `cd6e7c79`), dropping a PV-only inverter's generation from `pv_today`/`pv_power`; the PV half was fixed in PR #4923, load/grid deliberately left battery-only because those registers can overlap on a shared-CT install. **A string inverter that declares its no-battery state in *neither* place was still enrolled as a battery inverter (GH#5279, fixed in PR #5281, merged 2026-09-28 — keep the pre-#5281 signature):** `_reports_no_battery()` was deliberately narrow (absence of the fields = "unknown", never dropped), and the captured string model (product `0106`) reports `batteryType '0'` — the code batteryList uses for "No Battery" on the alternative firmware, not a name — with an empty `batteryList` and zero battery readings, while `batteryHealthSoh: 0` parses as `0.0` rather than `None`, so `automatic_config()` counted it as a battery and bound control args to it (the #4707 refused-write stream). Signature: `Configuring Predbat for N inverter(s) with batteries` with **no** `Skipping inverter … reports no battery` line and **no** `Including N inverter(s) with no battery in the PV totals` line, plus `Set arg soc_percent = [two entries]`. #5281's detection requires all of: no battery type named (absent, empty or the code `0`), no batteryList entry, `batteryNum == 0` **and** `batteryJump.batteryCount == 0`, and `batteryVoltage` **and** `batteryCapacitySoc` both present and 0 — an unread detail, a named pack reporting zeros, or a detail missing the `batteryNum`/`batteryJump` keys still counts as a battery (that omission is exactly the second #5279-family unit's shape: Solis Cloud reports the string inverter's `batteryType` alternating `'0'`/`'0.0'` on **alternate polls**, so match battery codes by value — `_reads_zero()`, `solis.py` — not by string), and a named pack is decided before the readings are looked at; a PV-only inverter now gets `inverterDetail` only (startup TOU read and hourly register reads skipped, publish stops at the detail sensors, event handlers ignore it) and takes its place in the PV totals. The #4923 PV-args split can now apply to such an inverter, which is exactly why it could not before: it never left the battery list. Pre-#5281 workaround remains `solis_inverter_sn` pinned to the battery inverter — which silently removes all PV generation from the plan, so on a current version the fix is the upgrade. **Grid-tied machines by model number (PR #5764, merged 9985960b 2026-10-26):** `SOLIS_GRID_TIED_MACHINE_PATTERN` (`^S\d+-GR\dP`, case-insensitive — S6-GR1P6K, S5-GR3P10K) reads a machine Solis names grid-tied as PV-only when top-level `batteryVoltage` and `batteryCapacitySoc` are both exactly zero, with **no** pack-count corroboration; a named pack still decides first and live or absent readings keep the inverter enrolled. The `machine` field is top-level in `inverterDetail`, get_state-polled every cycle and allow-listed into the `describe_inverter_detail()` summary log line, so it is visible in a reporter's log even on a version predating the fix. One more shape worth remembering: the entity-event queue used to drain at the top of `run()`, before the `first` block created the `ClientSession` and discovered inverters, so an event queued during startup executed against `session=None` with an empty `inverter_sn` - and was popped before execution, making it a silently lost write (fixed in `9fe1f7e0`). Three September fixes and one still-live trap. **PR #5089 (merged 2026-09-14)** closed the SolisCloud API-allowance family (GH#5087/#5091): `B0115` ("Datalogger offline or disconnected") and `R0000` ("Daily API request allowance exhausted") are now classified in `SOLIS_API_CODES` and excluded from retry (`SOLIS_API_CODES_NO_RETRY`) - retrying cannot change the answer and every attempt still spends one of the 200 daily requests - with a per-inverter datalogger-offline cooldown (`datalogger_offline()`) so one offline datalogger backs off alone rather than the fleet; and `automatic_config()` is no longer first-cycle-only: `run()` retries it every cycle until it returns True (`automatic_config_done`), so an API outage at startup no longer leaves `load_today` unset until a Predbat restart (the ValueError-at-fetch symptom this produced has its own row in the symptom table). Keep the mechanism for pre-#5089 logs: B0115 was treated as rate limiting (10s sleep + retry, the `ad26f95a` "Quick rate limit hack") and any R-series code fell through to `Unknown code` with the full retry ladder - an offline datalogger drained the 200/day allowance and R0000 arrived hours later. `automatic_config()` makes no API calls of its own - it reads only `self.inverter_details` - and returns False when details are still missing, which is the retryable case. **PR #5095 (merged 2026-09-15)** fixed the amp↔watt conversion voltage (GH#5090): `get_nominal_voltage()` now prefers `solis_nominal_voltage` from apps.yaml (the only stated physical property), then a live reading above `SOLIS_HV_BATTERY_VOLTAGE` (HV packs keep the live voltage as they have since #4493), then BMS charge voltage classification (16S at/above 55V charge voltage, 15S below - settings rather than measurements, so the result holds across polls), then the 48V fallback; the live voltage had swung 10-14% over a month on every sampled system, dragging `battery_rate_max`, the write tolerance computed from it and the read-back of every rate setpoint along. No workaround existed pre-#5095 - `solis_nominal_voltage` fed only the capacity path (`get_capacity_voltage()`), so telling a user to set it fixed capacity but not the rate paths. Diagnostic tell for pre-#5095 logs: failed-write readbacks at a constant ratio of the target (e.g. exactly 66/70) are consistent with write-time vs read-time voltage difference alone. **Still live (GH#5093):** `SolisAPI.run()` folds per-inverter failures into one `poll_success` bool - discovery failure, any inverter's detail fetch, TOU window reads, the in-window re-read - and `ComponentBase.start()` gates startup on that return: False → `api_started` never set, and the startup burst (discovery, details, `startup_reset_registers()`, the infrequent poll) re-runs on a doubling backoff from 60s to a 128-minute cap, so a multi-inverter fleet is held hostage to the least reachable device and every retry re-spends quota. Per-inverter success booleans already exist at every `poll_success` site, so the fix is contained to `run()`; the interim workaround is listing only working SNs in `solis_inverter_sn`. PR #5185 (merged 2026-09-23) also backs off `startup_reset_registers()` per-inverter with a persistent B0600 pause, and a refused startup register read no longer aborts startup — the try/except now sitting at the `run()` call site covers both triggers, the #5177 B0600 refusal and the SolisCloud timeout (GH#5202, closed as its dup: the traceback matched main line-for-line, the same `SolisAPIError` escaping the same call). Three Modbus-vs-component bindings and a mode-domain split (GH#5127/#5128/#5129, triaged 2026-09-17). On `charge_time_format: "H M"` types (`GS_fb00`, most cloud subtypes) `adjust_charge_window()` rewrites the charge start/end time entities on every 5-minute cycle of a programmed window (the format check in its write condition, inverter.py) - deliberately, the same #1529 write-reliability workaround the export side has - so "Predbat hammers my Solis with writes" is this first, not SoC-hold micromanagement: `adjust_battery_target()` is change-gated (logs `already at target` and writes nothing when equal) and the hold path's `disable_charge_window()` writes nothing unless the enable switch was on. The Modbus-path types (`GS`, `GS_fb00`, `SX4`, Sofar) have **no Predbat component at all** - every control arg is bound only by the hand-edited template; `create_missing_arg()` only ever *dummies* absent capabilities (a dummy `charge_limit` 100 when `has_target_soc` is False), so no INVERTER_DEF default binds a real entity, and a GS_fb00 user who misses the template's `charge_limit` uncomment gets a silent 100.0 target plus `No entity_id for charge_limit to write N` on every target change while the inverter keeps charging to its own default (GH#5129 - the signature is the repeated `No entity_id` line, not a startup error). On the Solis Cloud component the opposite applies: `automatic_config()` binds `charge_limit` with `set_arg_auto(..., overwrite=True)` (solis.py), so an apps.yaml `charge_limit:` pointing at the inverter's own timed-charge-SoC entity is replaced and logged `auto-discovery wins for this setting` - the first thing to grep a reporter's log for when #2328's guidance "didn't help" (GH#5127). Separately, Solis has **two mode-switch control paths whose mode domains do not overlap** (GH#5128): the HA `solax_modbus` integration (`inverter_type: "GS"`) writes a mode *name* from `SOLAX_SOLIS_MODES`/`SOLAX_SOLIS_MODES_NEW` through `alt_charge_discharge_enable()` and only ever computes 33/35 - the 64/96/98 "Feed-in priority" entries are dead in that table - while the SolisCloud API path above does use feed-in priority in its idle paths; so a "why doesn't Predbat use feed-in priority" report is GH#5128's gap on modbus and already-covered on the API component. Trap for any fix there: 33/35 mean different things in the two tables (`SOLAX_SOLIS_MODES` vs `_NEW`, the `solax_modbus_new` switch), so writes must go through the table-derived name, never a bare number; the reusable pattern is `support_feedin_first` (PR #5038, Fox). Check `fox.py`/`gecloud.py` for the same fold-everything-into-one-bool shape - GE Cloud still runs its own auto-config under `if first:` only, with no retry, so its self-heal after an outage is the pre-#5089-era slow one. **GH#5187, fixed in PR #5189 (merged 2026-09-24) - keep the mechanism for pre-#5189 logs.** Slot currents are now capped at the inverter's rated power (from the `inverter_size` sensor, logged `Capping slot currents on ... at the most the inverter can deliver at its rated power`); pre-#5189 the bound was only CID 7226 × count and the per-slot `sysCommand.max` metadata, so a 3.6 kW AC inverter reading 100 A at CID 7226 refused every 100 A slot-current write and left the slot enabled at 0 A, while the planner side never saw the AC rating - pre-#5308 auto-config bound `battery_rate_max` to `max_charge_power` (GH#4940) and set no `inverter_limit_discharge`; since PR #5308 the component binds `inverter_limit_discharge` to `max_discharge_power` and an apps.yaml value still wins (`overwrite=False`), so `inverter_limit_discharge: 3600` remains the plan-side workaround where the modelling matters. Implausible recovery SoC (CID 7229) no longer defeats the #4706 clamp: 0/1/≤over-discharge/>100 now falls back to `over_discharge_soc + 1` with a log line; pre-#5189 a 65521 read passed the guard and made Predbat attempt to write the recovery register itself down every cycle. **Still live:** the write-skip on a never-read slot current CID — `cached_values.get(cid, cap)` defaults to the cap, so a register the poll has never returned reads as "no change" and **no write is attempted at all** (`solis.py`, both charge and discharge paths); if a fixture shows no write of the slot CID, check whether the fixture seeded it in `cached_values` before assuming a bug. Test notes from #5177: `test_solis.py`'s first-cycle tests mock `startup_reset_registers` via instance attribute (`del api.startup_reset_registers` restores the real method); a canned `api.session` set before `run(0, True)` reaches the real request path; and do not patch `asyncio.sleep` to speed up a retried error — `_with_retry` budgets with `time.monotonic()`, so a no-op sleep just burns the real ~30 s budget across ~8 attempts. The hold lever on Solis modbus is window-scoped (GH#5152, code-verified): the only discharge-suppression write is `set_current_from_power()`'s `timed_{charge,discharge}_current` (re-asserted on every rate adjustment, #4415); the standing `battery_discharge_current` registers are never driven anywhere in the repo, and GS makes the timed write the *only* lever (`has_reserve_soc: False`, `has_timed_pause: False`) — so a hold's 0A binds only inside the timed slot, and a "hold/freeze doesn't stop discharge" report on Solis-modbus points at GH#5152 before any plan logic: the execute-side hold gates fire correctly, the lever they pull is what is window-scoped. (The "only binds during the slot" firmware semantics is read off the register names in the solax_modbus integration, not yet live-log confirmed.) Same firmware on the **solax_modbus** path: `inverter_type: GS` with the integration's plain "Solis" plugin on V2/FB00 firmware shows as `Setting Solis Energy Control Switch to 35 Self-Use from 33 Self-Use - No Timed Charge/Discharge` every cycle, the write "succeeds", and the next read is 33 again — a `Control interference: N change(s) in the last 24h, sustained on [...energy_storage_control_switch]` count in the hundreds. Charging still worked (SoC 28→100% overnight) but exports never ran: the discharge slot's times were written but its per-slot enable (43707) stayed 0, which the `solis.py` V2 time-window decode showed as `discharge_enable: 0`. Not a code bug — the user needs the solax_modbus "Solis FB00" plugin (per-slot enable switches, no mode 35) and `inverter_type: GS_fb00` via `templates/ginlong_solis_fb00.yaml`; confirmed fixed on a live system on 26 Sep 2026. Adding Solis Cloud credentials *without* `solis_automatic: True` on such a system leaves inverter 0 bound as GS while `solis.py` still runs its slot/mode logic with no plan — it logs `no active slot`, clears discharge slot 1 and sets 'Self-Use - No Timed Charge/Discharge', fighting the modbus path. **GH#5190 (verified on main): PEP 515 underscores defeat every numeric-parse guard.** Python ≥3.6 `int()`/`float()` accept `_` digit separators, so a junk register string such as `"1234567890_00"` (datalogger off the remote-control platform; polls fail with `B0063 "Lack of iot platform three elements"`) parses as `123456789000` with no exception — `parse_cid_int()`, `cid_value_matches()` and the raw `int(...)`/`float(...)` coercion all accept it, so every `try/except ValueError` fallback silently passes. Consequences seen in the reporter's config: `reserve`/`battery_min_soc` auto-bound to the junk percent (inverter.py raises `set_reserve_min` to it), CID 636 never converging (every-minute write + failed-verify repeat), and no `B0063` handling anywhere in `solis.py`. The same gap is in the core `get_arg()` float coercion (`userinterface.py`), so it generalises past Solis: start there on any "value reads as an absurdly huge number / the fallback never fires" report. Fix shape per the issue: one strict-parse helper (plain decimal only), range checks, publish `None` for unparseable reads, never write CID 636 from an unreadable current mode. Holds and freeze (PR #5265): `reserve` is now bound to the **Battery Reserve SOC** (CID 157, `reserve_soc`) and the row declares `has_reserve_soc` True - `battery_min_soc` stays the over-discharge SOC (CID 158). Solis only treats the Battery Reserve SOC as a discharge floor while CID 636 bit 4 (`SOLIS_BIT_BACKUP_MODE`) is on, so `set_storage_mode_if_needed()` always sets that bit: `set_reserve_enable` only decides whether Predbat *changes* the reserve, and with it off `inverter.py` plans against the live reserve, so the inverter must enforce it too (gating the bit on `set_reserve_enable` left the plan flooring at a register the inverter ignored). Reserve writes are shown in the cache and entity at once by `show_soc_limit_now()` and written from the event queue - non-slot events wait for the next `run()`, far beyond Predbat's 2s write verify. Hold detection has a 1% hysteresis (`SOLIS_HOLD_HYSTERESIS`) so the mode does not flip across the target; a hold outside a slot needs no extra grid-charging logic because outside slots the component already writes a No-Grid-Charging mode. Inside an open charge slot with the battery at or above the slot's SOC (`is_holding_in_charge_slot()` - a freeze charge, or a charge that reached its target) it writes `Self-Use - No Grid Charging` (`ENUM_SELF_USE_HOLD`: 3 on V1 where bit 1 is the slot enable, 1 on V2) ahead of the 0A -> Feed-in rule, which on V1 used to select Feed-in priority - exporting PV - during a freeze charge. **`Warn: Inverter N battery_scaling read as 0.0 ... retaining last known value` repeating every cycle (GH#5368, code-verified on main + `triage_test.sh inverter`):** `solis_automatic` binds `battery_scaling` to the per-inverter `_battery_soh` sensors (`solis.py`), which publish Solis Cloud `batteryHealthSoh`/100 **as-is, including 0** (deliberate, the #4494 decision); the `refresh_config()` guard (`inverter.py`, from PR #4500) retains the last valid value (default 1.0), so **the plan is unaffected** and the report is about the repeat — a warning whose guard comment assumed a transient outage but never sees a valid read again, an enhancement (one-time/backoff per inverter), not a planning bug. apps.yaml `battery_scaling` is **not** a workaround: `set_arg_auto(..., overwrite=True)` (`component_base.py`) replaces an explicit apps.yaml value with the discovered sensor binding, so the only config-level opt-out is `solis_automatic: false`. Keep the SOH-derived `battery_scaling` distinct from `battery_scaling_auto` (usage-data degradation measurement, `fetch.py`) — different knobs, easily confused in reports. **CID 499 (max export power) is scaled asymmetrically (GH#5385, code-read + debug replay on main, 2026-10-04):** the read treats raw < 200 as 100 W units and multiplies by 100, publishing raw ≥ 200 as watts (`_discovery_export_limit()` documents and duplicates the split into the discovery record), while the write path (`number_event_handler()`) is unconditional `int(value) // 100` — so a register reported ≥ 200 that is actually still in 100 W units (reporter: raw 480 ⇒ a 0.48 kW export limit on both inverters) lies by 100x on every read-back; the ≥200⇒watts half came in with commit `05514917` (v8.37.4, no linked issue) and no recorded case of a Solis reporting raw watts exists, so an unconditional ×100 on the read (both call sites plus the test cases) is the maintainer-facing fix direction — but `test_solis.py::test_publish_entities_export_power_unit_conversion` pins the threshold split (case 6 asserts raw 200 stays 200.0), so a suite green there is not unit-correctness evidence, and any future "Solis export limit wrong by 100x" report with raw ≥ 200 (a ≥ 20000 W limit) maps here (related #3700). **PR #5625 (draft, unmerged at writing) is the fix in flight (2026-10-19):** `export_power_cid_to_watts()` treats CID 499 as 100 W units at **every** value — matching the write side, which has divided by 100 unconditionally since `5e4d4627` — so until it merges any limit ≥ 20 kW still reads back 100x too small and auto-binds to `export_limit` under `solis_automatic`; the sharpest symptom line is an `export limit 0.48kW` figure in the `Inverter N with soc_max ...` startup line against what Solis Cloud Control shows. Test trap that came out of the same fix session: `number_event_handler()` resolves the inverter SN by splitting the entity id (`number.{prefix}_solis_{sn}_{field}`) and taking `parts[0]`, so a mock SN containing an underscore (e.g. `EXPORT_TEST`) never matches and the handler logs `Warn: Solis API: Unknown inverter EXPORT in number_event` without writing anything — use underscore-free SNs (`SN0EXPORT1`, which also passes cspell) in any Solis test that drives an event handler (`find_inverter_by_sn()` then validates case-insensitively, so the case half is handled; the underscore half never will be). The issue's "cannot be overridden in apps.yaml" half is by design: `export_limit` binds via `set_arg_auto(..., overwrite=True)` (grep `apps_yaml_override_warned` in the dump), with `inverter_limit_charge`/`_discharge` the `overwrite=False` exceptions. Post-#5625 residual: the unconditional ×100 assumes the register is always in 100 W units - a firmware reporting CID 499 in raw watts would read 100x too large (fails open; the inverter still enforces its own register at dispatch time). No recorded case exists, so treat that as "not seen, not impossible" - a small raw number on a high-limit inverter is the fingerprint (read-verified, GH#5625 review). **CID 5965 slot-SOC verify readback tracks the battery, not the write (GH#4184, triaged 2026-10-18 from a v8.44.0 log+yaml):** the readback moved with the live SOC across the reporter's whole log (50→44→31→15 against SOC 61→13, timestamped against the `- battery is currently at N%` lines) while the sibling entity-path write logged `Wrote 10 to discharge_target_soc, successfully now 10.0` on the entity Predbat just wrote — so a failed 5965 verify does not distinguish a refused write from a read-back that answers with something that moves, and entity-level `successfully now N` on a Solis-bound entity is not register evidence. #4184 is the parent ticket of the whole 60 A family (#4220 closed as its dup — the sysCommand-metadata mechanism is the #5068 entry above). Still live: `SOLIS_SLOT_CURRENT_DEFAULT_AMPS` (60.0) is the cap when the CID 7224/7226 register has never been read, and the measured ceiling from `ensure_slot_current_probed()` only ever lowers it (`limits[direction] = min(limits[direction], limits[direction + "_probed"])` in `slot_current_limits()`) — "capped at 60 A though I probed 290 A" means the register was never read, not that the probe failed; whether some S6 models never expose 7224/7226 via the cloud API is untested. **`Warn: Solis API poll failed for : ''` — a payload that is just the serial number in single quotes is a Python `KeyError` repr, not an API message (fixed in PR #5733, merged 2026-10-26; keep the pre-#5733 signature for older logs).** The failure was Predbat's own cache bookkeeping: `poll_inverter_data()` logged `except Exception as e` around cache updates where a `cached_values[sn]` created without `cached_infos[sn]` (number-event handlers, `show_soc_limit_now()`) was later read with both-caches init guarded on `cached_values` alone. #5733 makes both caches `setdefault`-tolerant at every init, per-cache. Invariant when reading that file: `cached_infos` is **write-only in production code** — nothing outside the cache-init reads it (only tests do) — so unreadable-cache bugs bite at the init statements and reader-side tolerance is the sufficient fix shape. Related, still live: `_with_retry()` catches only `SolisAPIError`, so a non-Solis error (KeyError, TypeError) raised inside an operation is not retried and surfaces as `run() returned False` or these bare-repr warns. | `solis` | +| Solis (`solis.py`) | `SOLIS_CID_STORAGE_MODE = 636` is Modbus 43110, a bit mask. On firmware "4B and above" (what `is_tou_v2_mode()` detects: CID 6798 reads 43605) the timed charge/discharge enable moved to the per-slot registers — `SOLIS_CID_CHARGE_ENABLE_BASE`/`..._DISCHARGE_ENABLE_BASE`, Modbus 43707, six slots not three — and every mode value carrying TOU bit 1 (3/35/43/51/98) was dropped; 35 became 33, 98 became 96. Such an inverter answers a CID 636 write with code 0 and reads back without bit 1, so a log full of CID 636 verification warnings is a refused bit, not a failed write (GH#4707). `set_storage_mode_if_needed()` decides the bit from `is_tou_v2_mode()`: never asked for on V2, always asked for and retried on V1, where bit 1 still *is* the timed charge/discharge enable. Do not try to learn it from the read-back instead — GH#4710 did, and GH#4774 showed why that cannot work: on six inverters the same write of 179 verifies minutes before and minutes after the one that reads back 177, so a single post-write read is not evidence of a firmware property. Latching it was also silent rather than noisy: the verify read refreshes `cached_values`, so after a stripped write the cache held the stripped value, the suppressed computed value matched it, and `set_storage_mode_if_needed()` stopped writing CID 636 at all for the whole 8-hour verdict — across an overnight charge window. GH#4239's "only retained while a window is configured" is not the whole story — it was refused with slot 1 enabled and its window in force. `read_and_write_cid()` re-reads once after `verify_settle_seconds` before calling a mismatch a failure, because the immediate verify read is taken about half a second after the write. On the SolisCloud select path specifically, **PR #5247 (merged 2026-09-26) makes a discovered inverter's slot-time writes run their handler immediately** so Predbat's read-back sees them in the same cycle — pre-#5247 the select callback only queued the event (GH#4875) and the queue drained at the top of `run()` up to a minute later, so the write verified against the stale value and logged a spurious `didn't complete` once per moved slot time (pass 1, V1 and the slot SoC/current writes keep their every-minute retry). Do not "stop the failed verify poisoning the cache" — `write_cid()` caches the value it *requested* and the post-write `read_cid()` deliberately overwrites it with what the inverter actually reports, so the cache mirrors the inverter rather than Predbat's intent; skipping that update would leave the cache agreeing with the write that just failed, and change detection would then never retry it. The two control paths choose the storage mode differently and it matters: V1 picks from `in_charge_slot`/`in_discharge_slot`, which are clock tests, so CID 636 changes value and gets written the moment a window opens; V2 picks from `slot1_active`, which is only "slot 1 has a window configured", so the mode is written when the slot is *programmed* and nothing at all happens at the window boundary. On the GH#4774 night the last CID 636 write was 22 minutes before the window opened, and the comparison night that worked had one near the window - so `claim_window_mode_assertion()` now asserts the mode once per window on both paths. Slot registers are polled hourly, plus every 5 minutes while `is_inside_active_window()` is true, so drift during the window that matters is caught in the same cycle it happens. GH#4774 also left a useful negative result: that inverter grid-charged from 20% to 91% overnight with bit 1 clear throughout, confirming the per-slot enables alone drive timed charging on V2 — so a "charge window never started" report on V2 firmware is not a CID 636 problem and needs looking at elsewhere. Separately, an inverter reporting `batteryType 'No Battery'` stays in `self.inverter_sn` for polling; `is_battery_inverter()` keeps control writes off it, which was most of the warning volume in GH#4707. That explanation doesn't cover every CID 636 report, though: a later GH#4707 comment showed zero `setting storage mode to` idle-mode log lines, and both V1 mode-decision idle paths always log that line — so a report with neither line cannot be coming from `write_time_windows_if_changed()` at all. The only remaining write path is the HA select handler, `set_storage_mode_value()` at `solis.py:2574`. Check which write path actually ran before assuming this entry's explanation applies. Separately, on inverters using `H M` time format (`GS_fb00`, most cloud subtypes) `adjust_force_export()` used to re-commit a stable export window every cycle — `is_hm_format` alone made `changed_start_end` true, so `press_and_poll_button()` fired on every cycle of an unchanged export window (GH#4709, confirmed live on main at the time) — and PR #4713 fixed the twin idle-cycle press where the times being managed came back as `None` and never compared equal to what the inverter still reported (GH#4712, #2328). **Both merged together in PR #4711 (`bc853a0e`, 2026-09-12, post-v9.0.2)**: `adjust_force_export()` re-commits only on a real schedule change through the commit-once ledger (`last_committed`/`commit_pending`, `commit_needed()`/`record_commit()` in `inverter.py` — the attribute this entry used to name, `last_export_schedule_committed`, is gone), and a commit is only recorded when the writes *and* the button press both succeeded; **the guard only became real when PR #5126 (merged 2026-09-26, unreleased at the time of writing) stopped rebuilding Inverter objects every cycle** — pre-#5126 the rebuild reset the latch to empty each cycle, so the guard was decorative and the every-cycle export commit (the #2328 ~288 TOU-register-write-batches/day signature) stayed live; keep that reading for pre-#5126 logs, where counting `Successfully pressed button` lines settles the actual volume. (The every-cycle `H M` time-entity rewrite remains, deliberately — #1529 write reliability); `press_and_poll_button()` takes a `side` argument so a split-button config no longer presses the unrelated side's button (which is what cleared `timed_charge_current` alongside the intended one); and `adjust_inverter_mode()` now sleeps 30s after a real window change as a GivTCP settle workaround, so expect a 30s pause per real window change on those types (the sleep is unconditional on any just-written export window — the v8.37.x `rest_data` GivTCP-REST exemption is gone since #4864 — GH#4180; open PR #5647 adds a narrow eco-toggle-only exemption — a cycle in which the eco toggle itself cannot be written (missing, a fixed value or a non-switch binding) settles nothing — narrow this on merge). Keep the mechanism for pre-merge logs, where the signature is a button press logged every 5 minutes inside a window. Away from the CID work, `automatic_config()` had an asymmetric arg-binding defect, **fixed in PR #5308 (merged 2026-09-29, v9.3.3) - keep the pre-#5308 signature:** it bound `battery_rate_max` - which fed *both* the charge and the discharge cap - to the per-device `max_charge_power` entity, while the `max_discharge_power` entity it also creates was bound to nothing; `inverter.py`'s `min(inverter_limit_discharge, battery_rate_max_raw)` then capped discharge at the charge limit on an asymmetric inverter, and `inverter_limit_discharge` could not lift it because the raw value was the binding constraint (GH#4940, confirmed against the reporter's debug yaml). The fix: Solis publishes a `battery_rate_max` sensor holding the **larger** of the two per-direction limits and binds `battery_rate_max` to it - auto-discovery still beats a manual apps.yaml value for that binding (`component_base.py:96-110`), so an apps.yaml `battery_rate_max` does not opt out - and binds `inverter_limit_charge`/`inverter_limit_discharge` to the two per-direction limits with `overwrite=False`, so an apps.yaml `inverter_limit_*` (an AC rating, a DNO cap) still wins. Separately, on Solis Cloud/TOU-V2 the per-slot current write is clamped by `write_time_windows()` (`solis.py`, `new_current = min(slot_data['discharge_current'], cap)`). **The cap's source was rewritten in PR #5314 (merged 2026-09-30, v9.3.3) - keep the pre-#5314 signature:** the cap used to be the *minimum* `sysCommand.max` metadata across all six slot CIDs from `cached_infos` — read here at the time as deliberate, but the metadata is actually a UI definition for a *list of model codes* (its `productModel`), and the cloud hands back definitions for other models: an S5-EH1P5K-L (model 3104, 5kW, registers reading 100A) was given 60A for its slot currents from the models-3101/3102 definition and 62.5A for slot 1 charge from models 3111/3140/3145's, holding exports to ~3.6kW (GH#5068). `slot_current_limits()` now ignores the metadata: the cap starts from the battery-side limit register itself (CID 7224 charge / 7226 discharge, read as-is - not multiplied by pack count - and `SOLIS_SLOT_CURRENT_DEFAULT_AMPS` when never read), and once `ensure_slot_current_probed()` has measured what the slots really accept a **measured** ceiling replaces the rated estimate (PR #5309's probe, runnable as `python3 apps/predbat/solis.py --probe-ceiling` without `--write`; it starts from the register and the sweep ends with a half-amp step, so a 62.5A ceiling is found exactly rather than rounded down, with candidates written as the inverter shows them). The verify-echo traps survive the rewrite: the number entity is republished from the local `charge_discharge_time_windows` cache, so the write verify reads back the *clamped* value converted at the **live** battery voltage (60A × ~51.6V ≈ 3094W, not 48V) and logs `didn't complete got 3094.0` every cycle — while a "Wrote N successfully now N" line can also be self-referential (cached == clamped skips the CID write entirely). Grep `CID 5967 ... is set to` to see what actually went to the inverter. The planner models `battery_rate_max_discharge` from apps.yaml/entity max and knows nothing of the clamp, so the plan is systematically optimistic while it binds; on a current build set `inverter_limit_discharge` to the measured cap × pack voltage, pre-#5314 it was 60A × pack voltage. #4220 is the same 60A clamp from the user's angle. Separately it built every arg list - PV, load and grid included - from the battery-filtered `devices` list (`solis.py:1456`, narrowed by `cd6e7c79`), dropping a PV-only inverter's generation from `pv_today`/`pv_power`; the PV half was fixed in PR #4923, load/grid deliberately left battery-only because those registers can overlap on a shared-CT install. **A string inverter that declares its no-battery state in *neither* place was still enrolled as a battery inverter (GH#5279, fixed in PR #5281, merged 2026-09-28 — keep the pre-#5281 signature):** `_reports_no_battery()` was deliberately narrow (absence of the fields = "unknown", never dropped), and the captured string model (product `0106`) reports `batteryType '0'` — the code batteryList uses for "No Battery" on the alternative firmware, not a name — with an empty `batteryList` and zero battery readings, while `batteryHealthSoh: 0` parses as `0.0` rather than `None`, so `automatic_config()` counted it as a battery and bound control args to it (the #4707 refused-write stream). Signature: `Configuring Predbat for N inverter(s) with batteries` with **no** `Skipping inverter … reports no battery` line and **no** `Including N inverter(s) with no battery in the PV totals` line, plus `Set arg soc_percent = [two entries]`. #5281's detection requires all of: no battery type named (absent, empty or the code `0`), no batteryList entry, `batteryNum == 0` **and** `batteryJump.batteryCount == 0`, and `batteryVoltage` **and** `batteryCapacitySoc` both present and 0 — an unread detail, a named pack reporting zeros, or a detail missing the `batteryNum`/`batteryJump` keys still counts as a battery (that omission is exactly the second #5279-family unit's shape: Solis Cloud reports the string inverter's `batteryType` alternating `'0'`/`'0.0'` on **alternate polls**, so match battery codes by value — `_reads_zero()`, `solis.py` — not by string), and a named pack is decided before the readings are looked at; a PV-only inverter now gets `inverterDetail` only (startup TOU read and hourly register reads skipped, publish stops at the detail sensors, event handlers ignore it) and takes its place in the PV totals. The #4923 PV-args split can now apply to such an inverter, which is exactly why it could not before: it never left the battery list. Pre-#5281 workaround remains `solis_inverter_sn` pinned to the battery inverter — which silently removes all PV generation from the plan, so on a current version the fix is the upgrade. **Grid-tied machines by model number (PR #5764, merged 9985960b 2026-10-26):** `SOLIS_GRID_TIED_MACHINE_PATTERN` (`^S\d+-GR\dP`, case-insensitive — S6-GR1P6K, S5-GR3P10K) reads a machine Solis names grid-tied as PV-only when top-level `batteryVoltage` and `batteryCapacitySoc` are both exactly zero, with **no** pack-count corroboration; a named pack still decides first and live or absent readings keep the inverter enrolled. The `machine` field is top-level in `inverterDetail`, get_state-polled every cycle and allow-listed into the `describe_inverter_detail()` summary log line, so it is visible in a reporter's log even on a version predating the fix. One more shape worth remembering: the entity-event queue used to drain at the top of `run()`, before the `first` block created the `ClientSession` and discovered inverters, so an event queued during startup executed against `session=None` with an empty `inverter_sn` - and was popped before execution, making it a silently lost write (fixed in `9fe1f7e0`). Three September fixes and one still-live trap. **PR #5089 (merged 2026-09-14)** closed the SolisCloud API-allowance family (GH#5087/#5091): `B0115` ("Datalogger offline or disconnected") and `R0000` ("Daily API request allowance exhausted") are now classified in `SOLIS_API_CODES` and excluded from retry (`SOLIS_API_CODES_NO_RETRY`) - retrying cannot change the answer and every attempt still spends one of the 200 daily requests - with a per-inverter datalogger-offline cooldown (`datalogger_offline()`) so one offline datalogger backs off alone rather than the fleet; and `automatic_config()` is no longer first-cycle-only: `run()` retries it every cycle until it returns True (`automatic_config_done`), so an API outage at startup no longer leaves `load_today` unset until a Predbat restart (the ValueError-at-fetch symptom this produced has its own row in the symptom table). Keep the mechanism for pre-#5089 logs: B0115 was treated as rate limiting (10s sleep + retry, the `ad26f95a` "Quick rate limit hack") and any R-series code fell through to `Unknown code` with the full retry ladder - an offline datalogger drained the 200/day allowance and R0000 arrived hours later. `automatic_config()` makes no API calls of its own - it reads only `self.inverter_details` - and returns False when details are still missing, which is the retryable case. **PR #5095 (merged 2026-09-15)** fixed the amp↔watt conversion voltage (GH#5090): `get_nominal_voltage()` now prefers `solis_nominal_voltage` from apps.yaml (the only stated physical property), then a live reading above `SOLIS_HV_BATTERY_VOLTAGE` (HV packs keep the live voltage as they have since #4493), then BMS charge voltage classification (16S at/above 55V charge voltage, 15S below - settings rather than measurements, so the result holds across polls), then the 48V fallback; the live voltage had swung 10-14% over a month on every sampled system, dragging `battery_rate_max`, the write tolerance computed from it and the read-back of every rate setpoint along. No workaround existed pre-#5095 - `solis_nominal_voltage` fed only the capacity path (`get_capacity_voltage()`), so telling a user to set it fixed capacity but not the rate paths. Diagnostic tell for pre-#5095 logs: failed-write readbacks at a constant ratio of the target (e.g. exactly 66/70) are consistent with write-time vs read-time voltage difference alone. **Still live (GH#5093):** `SolisAPI.run()` folds per-inverter failures into one `poll_success` bool - discovery failure, any inverter's detail fetch, TOU window reads, the in-window re-read - and `ComponentBase.start()` gates startup on that return: False → `api_started` never set, and the startup burst (discovery, details, `startup_reset_registers()`, the infrequent poll) re-runs on a doubling backoff from 60s to a 128-minute cap, so a multi-inverter fleet is held hostage to the least reachable device and every retry re-spends quota. Per-inverter success booleans already exist at every `poll_success` site, so the fix is contained to `run()`; the interim workaround is listing only working SNs in `solis_inverter_sn`. PR #5185 (merged 2026-09-23) also backs off `startup_reset_registers()` per-inverter with a persistent B0600 pause, and a refused startup register read no longer aborts startup — the try/except now sitting at the `run()` call site covers both triggers, the #5177 B0600 refusal and the SolisCloud timeout (GH#5202, closed as its dup: the traceback matched main line-for-line, the same `SolisAPIError` escaping the same call). Three Modbus-vs-component bindings and a mode-domain split (GH#5127/#5128/#5129, triaged 2026-09-17). On `charge_time_format: "H M"` types (`GS_fb00`, most cloud subtypes) `adjust_charge_window()` rewrites the charge start/end time entities on every 5-minute cycle of a programmed window (the format check in its write condition, inverter.py) - deliberately, the same #1529 write-reliability workaround the export side has - so "Predbat hammers my Solis with writes" is this first, not SoC-hold micromanagement: `adjust_battery_target()` is change-gated (logs `already at target` and writes nothing when equal) and the hold path's `disable_charge_window()` writes nothing unless the enable switch was on. The Modbus-path types (`GS`, `GS_fb00`, `SX4`, Sofar) have **no Predbat component at all** - every control arg is bound only by the hand-edited template; `create_missing_arg()` only ever *dummies* absent capabilities (a dummy `charge_limit` 100 when `has_target_soc` is False), so no INVERTER_DEF default binds a real entity, and a GS_fb00 user who misses the template's `charge_limit` uncomment gets a silent 100.0 target plus `No entity_id for charge_limit to write N` on every target change while the inverter keeps charging to its own default (GH#5129 - the signature is the repeated `No entity_id` line, not a startup error). On the Solis Cloud component the opposite applies: `automatic_config()` binds `charge_limit` with `set_arg_auto(..., overwrite=True)` (solis.py), so an apps.yaml `charge_limit:` pointing at the inverter's own timed-charge-SoC entity is replaced and logged `auto-discovery wins for this setting` - the first thing to grep a reporter's log for when #2328's guidance "didn't help" (GH#5127). Separately, Solis has **two mode-switch control paths whose mode domains do not overlap** (GH#5128): the HA `solax_modbus` integration (`inverter_type: "GS"`) writes a mode *name* from `SOLAX_SOLIS_MODES`/`SOLAX_SOLIS_MODES_NEW` through `alt_charge_discharge_enable()` and only ever computes 33/35 - the 64/96/98 "Feed-in priority" entries are dead in that table - while the SolisCloud API path above does use feed-in priority in its idle paths; so a "why doesn't Predbat use feed-in priority" report is GH#5128's gap on modbus and already-covered on the API component. Trap for any fix there: 33/35 mean different things in the two tables (`SOLAX_SOLIS_MODES` vs `_NEW`, the `solax_modbus_new` switch), so writes must go through the table-derived name, never a bare number; the reusable pattern is `support_feedin_first` (PR #5038, Fox). Check `fox.py`/`gecloud.py` for the same fold-everything-into-one-bool shape - GE Cloud still runs its own auto-config under `if first:` only, with no retry, so its self-heal after an outage is the pre-#5089-era slow one. **GH#5187, fixed in PR #5189 (merged 2026-09-24) - keep the mechanism for pre-#5189 logs.** Slot currents are now capped at the inverter's rated power (from the `inverter_size` sensor, logged `Capping slot currents on ... at the most the inverter can deliver at its rated power`); pre-#5189 the bound was only CID 7226 × count and the per-slot `sysCommand.max` metadata, so a 3.6 kW AC inverter reading 100 A at CID 7226 refused every 100 A slot-current write and left the slot enabled at 0 A, while the planner side never saw the AC rating - pre-#5308 auto-config bound `battery_rate_max` to `max_charge_power` (GH#4940) and set no `inverter_limit_discharge`; since PR #5308 the component binds `inverter_limit_discharge` to `max_discharge_power` and an apps.yaml value still wins (`overwrite=False`), so `inverter_limit_discharge: 3600` remains the plan-side workaround where the modelling matters. Implausible recovery SoC (CID 7229) no longer defeats the #4706 clamp: 0/1/≤over-discharge/>100 now falls back to `over_discharge_soc + 1` with a log line; pre-#5189 a 65521 read passed the guard and made Predbat attempt to write the recovery register itself down every cycle. **Still live:** the write-skip on a never-read slot current CID — `cached_values.get(cid, cap)` defaults to the cap, so a register the poll has never returned reads as "no change" and **no write is attempted at all** (`solis.py`, both charge and discharge paths); if a fixture shows no write of the slot CID, check whether the fixture seeded it in `cached_values` before assuming a bug. Test notes from #5177: `test_solis.py`'s first-cycle tests mock `startup_reset_registers` via instance attribute (`del api.startup_reset_registers` restores the real method); a canned `api.session` set before `run(0, True)` reaches the real request path; and do not patch `asyncio.sleep` to speed up a retried error — `_with_retry` budgets with `time.monotonic()`, so a no-op sleep just burns the real ~30 s budget across ~8 attempts. The hold lever on Solis modbus is window-scoped (GH#5152, code-verified): the only discharge-suppression write is `set_current_from_power()`'s `timed_{charge,discharge}_current` (re-asserted on every rate adjustment, #4415); the standing `battery_discharge_current` registers are never driven anywhere in the repo, and GS makes the timed write the *only* lever (`has_reserve_soc: False`, `has_timed_pause: False`) — so a hold's 0A binds only inside the timed slot, and a "hold/freeze doesn't stop discharge" report on Solis-modbus points at GH#5152 before any plan logic: the execute-side hold gates fire correctly, the lever they pull is what is window-scoped. (The "only binds during the slot" firmware semantics is read off the register names in the solax_modbus integration, not yet live-log confirmed.) Same firmware on the **solax_modbus** path: `inverter_type: GS` with the integration's plain "Solis" plugin on V2/FB00 firmware shows as `Setting Solis Energy Control Switch to 35 Self-Use from 33 Self-Use - No Timed Charge/Discharge` every cycle, the write "succeeds", and the next read is 33 again — a `Control interference: N change(s) in the last 24h, sustained on [...energy_storage_control_switch]` count in the hundreds. Charging still worked (SoC 28→100% overnight) but exports never ran: the discharge slot's times were written but its per-slot enable (43707) stayed 0, which the `solis.py` V2 time-window decode showed as `discharge_enable: 0`. Not a code bug — the user needs the solax_modbus "Solis FB00" plugin (per-slot enable switches, no mode 35) and `inverter_type: GS_fb00` via `templates/ginlong_solis_fb00.yaml`; confirmed fixed on a live system on 26 Sep 2026. Adding Solis Cloud credentials *without* `solis_automatic: True` on such a system leaves inverter 0 bound as GS while `solis.py` still runs its slot/mode logic with no plan — it logs `no active slot`, clears discharge slot 1 and sets 'Self-Use - No Timed Charge/Discharge', fighting the modbus path. **GH#5190 (verified on main): PEP 515 underscores defeat every numeric-parse guard.** Python ≥3.6 `int()`/`float()` accept `_` digit separators, so a junk register string such as `"1234567890_00"` (datalogger off the remote-control platform; polls fail with `B0063 "Lack of iot platform three elements"`) parses as `123456789000` with no exception — `parse_cid_int()`, `cid_value_matches()` and the raw `int(...)`/`float(...)` coercion all accept it, so every `try/except ValueError` fallback silently passes. Consequences seen in the reporter's config: `reserve`/`battery_min_soc` auto-bound to the junk percent (inverter.py raises `set_reserve_min` to it), CID 636 never converging (every-minute write + failed-verify repeat), and no `B0063` handling anywhere in `solis.py`. The same gap is in the core `get_arg()` float coercion (`userinterface.py`), so it generalises past Solis: start there on any "value reads as an absurdly huge number / the fallback never fires" report. Fix shape per the issue: one strict-parse helper (plain decimal only), range checks, publish `None` for unparseable reads, never write CID 636 from an unreadable current mode. Holds and freeze (PR #5265): `reserve` is now bound to the **Battery Reserve SOC** (CID 157, `reserve_soc`) and the row declares `has_reserve_soc` True - `battery_min_soc` stays the over-discharge SOC (CID 158). Solis only treats the Battery Reserve SOC as a discharge floor while CID 636 bit 4 (`SOLIS_BIT_BACKUP_MODE`) is on, so `set_storage_mode_if_needed()` always sets that bit: `set_reserve_enable` only decides whether Predbat *changes* the reserve, and with it off `inverter.py` plans against the live reserve, so the inverter must enforce it too (gating the bit on `set_reserve_enable` left the plan flooring at a register the inverter ignored). Reserve writes are shown in the cache and entity at once by `show_soc_limit_now()` and written from the event queue - non-slot events wait for the next `run()`, far beyond Predbat's 2s write verify. Hold detection has a 1% hysteresis (`SOLIS_HOLD_HYSTERESIS`) so the mode does not flip across the target; a hold outside a slot needs no extra grid-charging logic because outside slots the component already writes a No-Grid-Charging mode. Inside an open charge slot with the battery at or above the slot's SOC (`is_holding_in_charge_slot()` - a freeze charge, or a charge that reached its target) it writes `Self-Use - No Grid Charging` (`ENUM_SELF_USE_HOLD`: 3 on V1 where bit 1 is the slot enable, 1 on V2) ahead of the 0A -> Feed-in rule, which on V1 used to select Feed-in priority - exporting PV - during a freeze charge. **`Warn: Inverter N battery_scaling read as 0.0 ... retaining last known value` repeating every cycle (GH#5368, code-verified on main + `triage_test.sh inverter`):** `solis_automatic` binds `battery_scaling` to the per-inverter `_battery_soh` sensors (`solis.py`), which publish Solis Cloud `batteryHealthSoh`/100 **as-is, including 0** (deliberate, the #4494 decision); the `refresh_config()` guard (`inverter.py`, from PR #4500) retains the last valid value (default 1.0), so **the plan is unaffected** and the report is about the repeat — a warning whose guard comment assumed a transient outage but never sees a valid read again, an enhancement (one-time/backoff per inverter), not a planning bug. apps.yaml `battery_scaling` is **not** a workaround: `set_arg_auto(..., overwrite=True)` (`component_base.py`) replaces an explicit apps.yaml value with the discovered sensor binding, so the only config-level opt-out is `solis_automatic: false`. Keep the SOH-derived `battery_scaling` distinct from `battery_scaling_auto` (usage-data degradation measurement, `fetch.py`) — different knobs, easily confused in reports. **CID 499 (max export power) is scaled asymmetrically (GH#5385, code-read + debug replay on main, 2026-10-04):** the read treats raw < 200 as 100 W units and multiplies by 100, publishing raw ≥ 200 as watts (`_discovery_export_limit()` documents and duplicates the split into the discovery record), while the write path (`number_event_handler()`) is unconditional `int(value) // 100` — so a register reported ≥ 200 that is actually still in 100 W units (reporter: raw 480 ⇒ a 0.48 kW export limit on both inverters) lies by 100x on every read-back; the ≥200⇒watts half came in with commit `05514917` (v8.37.4, no linked issue) and no recorded case of a Solis reporting raw watts exists, so an unconditional ×100 on the read (both call sites plus the test cases) is the maintainer-facing fix direction — but `test_solis.py::test_publish_entities_export_power_unit_conversion` pins the threshold split (case 6 asserts raw 200 stays 200.0), so a suite green there is not unit-correctness evidence, and any future "Solis export limit wrong by 100x" report with raw ≥ 200 (a ≥ 20000 W limit) maps here (related #3700). **PR #5625 (draft, unmerged at writing) is the fix in flight (2026-10-19):** `export_power_cid_to_watts()` treats CID 499 as 100 W units at **every** value — matching the write side, which has divided by 100 unconditionally since `5e4d4627` — so until it merges any limit ≥ 20 kW still reads back 100x too small and auto-binds to `export_limit` under `solis_automatic`; the sharpest symptom line is an `export limit 0.48kW` figure in the `Inverter N with soc_max ...` startup line against what Solis Cloud Control shows. Test trap that came out of the same fix session: `number_event_handler()` resolves the inverter SN by splitting the entity id (`number.{prefix}_solis_{sn}_{field}`) and taking `parts[0]`, so a mock SN containing an underscore (e.g. `EXPORT_TEST`) never matches and the handler logs `Warn: Solis API: Unknown inverter EXPORT in number_event` without writing anything — use underscore-free SNs (`SN0EXPORT1`, which also passes cspell) in any Solis test that drives an event handler (`find_inverter_by_sn()` then validates case-insensitively, so the case half is handled; the underscore half never will be). The issue's "cannot be overridden in apps.yaml" half is by design: `export_limit` binds via `set_arg_auto(..., overwrite=True)` (grep `apps_yaml_override_warned` in the dump), with `inverter_limit_charge`/`_discharge` the `overwrite=False` exceptions. Post-#5625 residual: the unconditional ×100 assumes the register is always in 100 W units - a firmware reporting CID 499 in raw watts would read 100x too large (fails open; the inverter still enforces its own register at dispatch time). No recorded case exists, so treat that as "not seen, not impossible" - a small raw number on a high-limit inverter is the fingerprint (read-verified, GH#5625 review). **CID 5965 slot-SOC verify readback tracks the battery, not the write (GH#4184, triaged 2026-10-18 from a v8.44.0 log+yaml):** the readback moved with the live SOC across the reporter's whole log (50→44→31→15 against SOC 61→13, timestamped against the `- battery is currently at N%` lines) while the sibling entity-path write logged `Wrote 10 to discharge_target_soc, successfully now 10.0` on the entity Predbat just wrote — so a failed 5965 verify does not distinguish a refused write from a read-back that answers with something that moves, and entity-level `successfully now N` on a Solis-bound entity is not register evidence. #4184 is the parent ticket of the whole 60 A family (#4220 closed as its dup — the sysCommand-metadata mechanism is the #5068 entry above). Still live: `SOLIS_SLOT_CURRENT_DEFAULT_AMPS` (60.0) is the cap when the CID 7224/7226 register has never been read, and the measured ceiling from `ensure_slot_current_probed()` only ever lowers it (`limits[direction] = min(limits[direction], limits[direction + "_probed"])` in `slot_current_limits()`) — "capped at 60 A though I probed 290 A" means the register was never read, not that the probe failed; whether some S6 models never expose 7224/7226 via the cloud API is untested. **`Warn: Solis API poll failed for : ''` — a payload that is just the serial number in single quotes is a Python `KeyError` repr, not an API message (fixed in PR #5733, merged 2026-10-26; keep the pre-#5733 signature for older logs).** The failure was Predbat's own cache bookkeeping: `poll_inverter_data()` logged `except Exception as e` around cache updates where a `cached_values[sn]` created without `cached_infos[sn]` (number-event handlers, `show_soc_limit_now()`) was later read with both-caches init guarded on `cached_values` alone. #5733 makes both caches `setdefault`-tolerant at every init, per-cache. Invariant when reading that file: `cached_infos` is **write-only in production code** — nothing outside the cache-init reads it (only tests do) — so unreadable-cache bugs bite at the init statements and reader-side tolerance is the sufficient fix shape. Related, still live: `_with_retry()` catches only `SolisAPIError`, so a non-Solis error (KeyError, TypeError) raised inside an operation is not retried and surfaces as `run() returned False` or these bare-repr warns. **On a Solis parallel pair (master + slave, shared bank), the master's TOU V2 slot current is the whole group's and Predbat's write cap is structurally one-inverter's-worth (GH#5556, reporter-verified live 2026-10-21/11-01):** both units' CID 7224/7226 read 135 and a 135 A slot charged ≈7 kW across the pair with the slave untouched; with Predbat off and only the master's slot at 270 A the pair moved ≈11.8 kW each — Solis balances the pair itself, PV on the master or not. `slot_current_limits()` (solis.py) starts from CID 7224/7226 read as-is per inverter and its ceiling can only *lower* (`min()`), while a 270 write to CID 7226 itself is refused — those registers are per-inverter hardware limits, not group limits — so a parallel pair plans (per-inverter) more power than any write can deliver. Fix shape in open PR #5909 (CI-green at the 2026-11-01 triage; V2-only, warns on V1 masters): `solis_parallel_slaves` (master→slave serials) + `solis_parallel_slot_current_max` (amps, from the bank's rating, not the inverters' sum), master's slot write = own + each enabled-in-same-direction slave's planned current — and it records the `upper` each probe was swept against and re-probes when it changes, because a saved probe ceiling from before the user raised the cap would otherwise pin the group at the old figure. | `solis` | | Solis Modbus (`GS`, `GS_fb00` in `inverter.py`) | The Energy Storage Control Switch (Modbus 43110, `energy_control_switch`) is driven by `alt_charge_discharge_enable()`, gated on the `has_solis_energy_control` capability. `GS` reaches it through `mimic_target_soc()` and uses the Timed Charge/Discharge bit as the charge enable (35/33). `GS_fb00` has a target SoC, so it never reached `mimic_target_soc()` - until the fix it never wrote the switch at all, and a switch left on `Self-Use - No Grid Charging` (1, bit 5 clear) made every charge slot hold the battery at 0 W while Predbat logged a correct slot, target and rate. For FB00 it is driven through `write_solis_energy_control()` from `adjust_charge_immediate()` on non-exporting cycles - `Backup/Reserve` (49) to charge or idle, `Backup/Reserve - No Grid Charging` (17) for a freeze or a car/iBoost/reserve hold - and from `adjust_export_immediate()` on exporting cycles - `Feed-in priority - No Grid Charging` (64) for a freeze export, `Backup/Reserve` for a real export (PR #5258). The Battery Reserve bit (bit 4) is what makes the template's `reserve` (`backup_mode_soc`, 43024) a discharge floor, so the reserve holds in `execute_plan()` work unchanged; grid charging goes off during holds because the reserve is raised to SoC + 1 and the inverter would import to reach it, again each cycle. `execute_plan()` never calls both immediate methods with a real target in one cycle, and the idle `adjust_export_immediate(100)` deliberately leaves the switch alone; GS still writes from `mimic_target_soc()`. Adding a writer anywhere else (e.g. `adjust_battery_target()`) flips the switch twice per cycle. Older logs: PR #5256 (merged 2026-09-26) held it on `Self-Use` (33) from `adjust_battery_target()`, and before that GS_fb00 never wrote the switch at all. A SolisCloud session is the usual way the switch ends up at 1: `solis.py` maps `"Self-Use - No Timed Charge/Discharge"` to `ENUM_SELF_USE_NO_GRID_CHARGING`, which clears bit 5, and writes it whenever no slot is active - so stopping the cloud component outside a slot leaves grid charging disallowed. The FB00 Solax Modbus plugin's option names differ from the pre-FB00 plugin's (`Self-Use` is 33 there, 35 here) - `SOLAX_SOLIS_MODES_FB00`. Verified from a user log (26 Sep 2026) and the plugin source. **"timed_{charge,discharge}_current never written" on GS/GS_fb00 = the #4415 change-guard bootstrap, fixed in PR #4437 (v8.48.2) — keep the mechanism for pre-v8.48.2 logs.** The timed-current write rode inside `adjust_charge_rate()`'s 5% rate-change guard while the dummy `charge_rate` virtual is seeded at max, so an unchanged planned rate never opened the guard and the register was never touched; PR #4437 makes `set_current_from_power()` re-assert on every rate invocation (its docstring cites #4415), pinned by `test_current_reasserted_on_unchanged_rate`. The `inv_charge_discharge_with_rate` gates in execute.py zero the power register only, not the timed-current register — gate-widening fixes proposed against the old shape (GH#4033) are unnecessary post-#4437. Open siblings at triage (2026-10-18): #3914; #3868 (GS_fb00 HV battery "wrong amp values") may hinge on `set_current_from_power()`'s power ÷ battery_voltage conversion — check which voltage entity an HV install maps when picking it up. And a 2600 W rate appearing in their plan = `battery_rate_max_raw`'s 2600.0 fallback (`inverter.py`), the GH#4198 family. | `./run_all --test inverter` (`solis_fb00_*`, `solis_gs_*`) | | SolaX (`solax.py`) | Code `10402` is a token/auth failure, retried in-request rather than waiting for the next cycle. SolaX clamps battery minimum SOC at 10% (`SOLAX_MIN_RESERVE_PERCENT`), so `battery_min_soc` is auto-configured to stop Predbat writing limits the inverter will reject. **Follow-up on the GH#4993 thread (2026-09-21, from a 23-hour reporter log):** `10402` repeating every cycle with data still flowing is **server-side token invalidation between cycles**, not broken auth or lost data — Predbat's in-request refresh recovers every cycle. The tell: the same token value succeeds mid-cycle and is rejected next cycle while Predbat holds it untouched in memory between cycles (the auth-error branch of `_request_get_impl()` clears it, and `request_wrapper()` retries with a fresh token instead of failing the fetch), and a stated ~30-day `expires_in` against a real ~1-cycle token lifetime. Prime suspect is a second client sharing the same `solax_client_id`/`solax_client_secret` — the reporter ran the separate SolaX Developer API HA integration — **suspected, not proven** (one-active-token-per-app is common but could not be confirmed against SolaX docs); the decisive test is disabling the second client for an hour or registering each client its own app. Count `error 10402` lines against `Fetched ... successfully` lines before calling data lost, and note each 10402 also increments the component's lifetime error counter (`solax.py` auth-error branch), which is what accumulates in the Components panel — do not "fix" this by removing the in-request retry. Secondary, same thread: `Warn: SolarAPI: No solar forecast data was returned from HA sensors.` with the SolaX Cloud template means **no PV forecast source is configured at all** — with `forecast_solar`/`open_meteo`/`solcast_host`+`solcast_api_key` all absent, `fetch_pv_forecast()` falls through to the HA-sensor branch (`solcast.py` sets `active_source = "ha_sensors"`) and the template's `pv_forecast_today`-style `re:` regexes (`templates/solax_cloud.yaml`) match nothing unless the Solcast HA integration is installed. Check which source the log names ("Obtaining solar forecast from Forecast Solar API" vs "Using Solcast integration from inside HA") — a working source dropped during a template migration looks exactly like this. **Plant `totalYield` overstates PV on a mixed plant (GH#5356, code-verified on main 2026-10-02, payload semantics rest on the reporter's plant+device captures):** `automatic_config()` binds `pv_today` to the plant-level `sensor._solax__total_yield` (solax.py:447), `publish_plant_info()` fills that sensor straight from plant realtime `totalYield` (solax.py:2640), and `total_load` adds the same `totalYield` to imported+discharged−exported−charged (solax.py:2709) — but SolaX's plant total is PV **plus** every deviceType-1 inverter's AC output, so on a plant mixing a PV-only inverter with a separate AC-coupled battery inverter, battery discharge is counted twice (once in `totalDischarged`, once inside `totalYield`), PV history is inflated (reporter's calibration scaled 2.89x, ~1.6x legitimate), and the class presents as "calibration too high / overnight under-charging / wrong savings". `pv_power` is unaffected (per-device `pvMap`/`mpptMap` sums, solax.py:2276-2285). The ingredient a fix needs all already exist: a device-level `...__total_yield` sensor (solax.py:2366), failed reads keep the previous value (solax.py:2245), and `plant_inverters[plant_id]` holds every deviceType-1 device (solax.py:1483). Not a regression — the plant wiring dates to original SolaX Cloud development (#3140). The reporter's proposed fix direction (maintainer call pending): sum device `totalYield` over `plant_inverters` into a new `pv_today` sensor; caveat for whoever builds it — the plant **lifetime** total does not decompose as PV+discharge on that site, so derive from the daily relationship (which matched exactly on three days), not the lifetime number. **PR #5357:** `pv_today` is now `..._pv_yield`, summed by `get_plant_pv_yield()` from each inverter's **last known** `totalYield` (kept per inverter, seeded after a restart from its own `...__total_yield` sensor), so a failed read or a dead inverter does not drop out of the sum; an inverter with no `totalYield` of its own counts as 0, and the value is held only when an inverter that `onlineStatus` says should answer failed its read and has never given a yield. `pv_power`/`grid_power` are plant sensors summed over every inverter, no longer the first inverter listed. Device `dailyYield` reads 0.0 once the inverter sleeps in the evening, so it is no use as a daily counter. On a live plant of two DC-coupled hybrids with panels (2026-10-04) device `dailyYield` (23.3, 2.6) and `dailyACOutput` (24.1, 9.5) were separate counters and the plant `dailyYield` (33.6) was exactly the sum of the AC outputs, so the plant figure is inverter AC output on every plant shape seen and device yield is not; device yield was not checked against an independent PV measurement. Still wrong after the fix: a plant whose only inverter is an X1-AC (no `totalYield`, empty `mpptMap`/`pvMap`) falls back to the plant figure, which there is battery discharge (`dailyYield` = `dailyACOutput` = `dailyDischarged`), and its `load_power` goes negative when a third-party PV inverter SolaX cannot see is exporting. `plant_inverters` is keyed by the plant ID as SolaX gives it while entity names use the lowercased form - look up with the raw ID. **GH#5388 (2026-10-04):** a plant lifetime counter can dip and recover within a day (`totalYield` 4437.8 → 4260.4 → 4441.7, `totalDischarged` with it) and, published as received, the recovery was recorded as 181.3 kWh of PV that day - an absurd `pv_today` or `export_today` on one day followed by a PV forecast several times the array size is this, via calibration. An upward step of thousands of kWh on the same counters did not show in `pv_today`. `hold_counter_dip()` now holds the five plant totals and each inverter's `total_yield` at the last published value and takes a lower value as a genuine reset only after `SOLAX_COUNTER_DIP_HOLD_HOURS`; how long a real dip lasts was not measured. After a restart the last value is seeded from the sensor, or from the `counters` entry in storage when the sensor is gone (Predbat's sensors do not survive a Home Assistant restart); the time a dip started is saved there too, without it a restart began the hold again and a system restarted daily would never accept a genuine reset. A plant where no inverter has PV inputs (X1-AC only: no `totalYield`, empty `mpptMap`/`pvMap`) now publishes **0** for `pv_yield` instead of the plant total, with a one-off `has no inverter with PV inputs` warning; `total_load` then has no PV term, so on a site with third-party PV it under-reads by what that PV supplies and can fall while the site exports. Nothing in the SolaX data measures that PV: a 12 hour dump of `/openapi/v2/device/history_data` (params `snList`, `deviceType`, `startTime`/`endTime` in ms, `timeInterval` minutes, `businessType`) carried the same fields as realtime, yield null and `gridPowerM2` 0.0 throughout daylight, and no plant checked had a `deviceType=3` meter device. `M2` fields are meter 2, positive = export per the SolaX API text; `solax.py` does not read them, and a meter 2 that was once fitted shows as a non-zero `totalExportEnergyM2` that no longer moves. A hybrid with no panels still reports a populated `mpptMap` of zeros, so it counts as having PV inputs and is not covered by the 0. | `solax` | -| Sigenergy (`sigenergy.py`) | Lifetime/history totals are cumulative server-side and reset around EU midnight, which showed up as an overnight dip; `fetch_history_totals` applies a monotonic clamp. "Energy totals went backwards overnight" starts here. Separately, a user `apps.yaml` override of `inverter.has_reserve_soc: true` (stock `SIG` default is `False`, deliberately — reverted in `5bfc5c80` after #2873/#3124) bypasses two guards that normally make reserve writes inert for Sigenergy (`execute.py:947-950`, `inverter.py:547-549`), so `adjust_reserve()` writes straight to `number.sigen_plant_ess_discharge_cut_off_state_of_charge`. Confirmed from a reporter's log: zero occurrences of the "Inverter does not support reserve" disable message the first guard would normally log, plus 56 reserve writes landing on that register (GH#4728). The stock template's `reserve:` line also points at that same entity rather than `ess_backup_state_of_charge`, which is what makes the override immediately destructive rather than merely inert. `Applying mode=eco ... duration=720min` is emitted only by the no-window fall-through branch (`sigenergy.py:2199`), so seeing it while a plan export window is live means the component's control snapshot never saw the window. Two code-verified routes to that, both still live: with `sigenergy_automatic: False`, `automatic_config()` - the only wiring of the component's control entities into Predbat - never runs, so Predbat's plan writes land on its own simulated dummy entities (`inverter.py:539-545`) and a `True == True` read-back is Predbat comparing against itself rather than reading a register; and `fetch_controls` runs on the first tick only (`if first:`, `sigenergy.py:2658`), so a single missed `call_service` event leaves the component's internal state permanently out of step while Predbat's write-skip comparison guarantees the healing write is never re-issued (GH#4894, probe-verified in `test_sigenergy.py`). `_publish_mqtt` logged the live `accessToken` on every command until PR #4926 added `SigenergyAPI.redact()`. The docs template still writes `number.sigen_plant_grid_import_limitation` to 0 in both freeze branches (`docs/inverter-setup.md:1936-1940` and `:1971-1975`), and Sigenergy's own EVAC/EVDC chargers are EMS-throttled to the plant import limit - so the block lands exactly when Predbat asks for Freeze Charging to hold for a car (GH#4911). On the **stock** `has_reserve_soc: False` shape the planned reserve floor is model-only and the battery drains to the inverter's own cut-off — see the "Plan shows a flat hold at the reserve" symptom row (GH#5358). **Every power lever on SIGCLOUD has been silently inert (GH#5376, hardware-verified by the reporter's live MQTT log and battery data; **fixed in PR #5377, merged 2026-10-03 and first shipped in v9.3.5** — the six optional fields are now built into the command object, `sigenergy.py` — keep the pre-#5377 reading for older logs):** `send_battery_command()` writes its six optional power/priority fields — `chargingPower`, `pvPower`, `maxSellPower`, `maxPurchasePower`, `chargePriorityType`, `dischargePriorityType` — at the **top level** of the payload while the required command fields sit inside `commands[0]` (since `cba12cc3`, first released v8.36.11); the API reads the levers from the command objects, so the top-level fields are silently ignored, and planned charge rate, bidirectional export cap, freeze-charge/`freeze_export_hold` `chargingPower: 0` and both priority types (all set in `apply_controls()`, `sigenergy.py`) have never reached the hardware. The suite passed while the bug was live because `test_sigenergy.py` asserted `payload["chargingPower"]` at the top level while checking `commands[0]` for the required fields — **a test that locks in the implementation's current output makes suite-green meaningless for that surface**; the #5377 fix rewrote the test to assert inside `commands[0]` (its "optional fields that were not passed are omitted" cases are the in-tree example of testing the fixed shape). Suspect, not verified: the fixed surface has never been hardware-tested by the triage bot, so a post-v9.3.5 regression report about holds/exports on SIGCLOUD may be that surface going live for the first time; pre-#5377, the #4761 freeze-export reasoning and the `freeze_export_hold` branch never acted with real effect. **Docs entity-name split (GH#5459, docs defect, fixed in PR #5464, `c0d901db`, 2026-10-12):** `docs/inverter-setup.md`'s `predbat_max_*_limit_action` automations reference `sensor.sigen_inverter_ess_rated_charging_power`/`..._discharging_power` - inverter level with the plant suffix - while the upstream integration defines the rated-power pairs at two levels with different suffix spellings: plant `plant_ess_rated_charging/discharging_power` (-ing) and inverter `inverter_ess_rated_charge/discharge_power` (no -ing), so the docs names match neither set; the docs' own rename note points at the inverter alternates, and the template binds `battery_rate_max` to the plant-level `-ing` name (the right clamp level for the plant-level limit numbers the automations write). A Sigenergy "float got invalid input 'unknown'" automation error resolves by mapping level first (plant vs inverter), then suffix; the automations are docs content and no Predbat code creates them. PR #5681 (merged 2026-10-21, `0eaafc6b`) added the plant grid export limit: `openapi/change` state (per system: `antiReflux` + `gridMaxBackfeedPowerW`) now lives in `self.grid_export` and **is cached across restarts** (`SIGENERGY_CACHE_KEYS` gained `grid_export` — a change-message state that is discovery-owned dies at restart, so this closes the class on main; check the *reader* before assuming a post-restart figure is stale, the capacity/rated-power sensors read `self.devices` which the periodic poll keeps fresh), with the limit semantics antiReflux off → 99999 (unlimited) whatever the backfeed figure says, on → the backfeed value including 0, never reported → backfeed when >0 else 99999; `automatic_config()` binds `export_limit` with `set_arg_auto(..., overwrite=False)` so a hand-set apps.yaml value wins. **Onboarding outcome codes are barely mapped (GH#5691, triaged 2026-10-22, still live on main — table and dead constants re-verified by grep 2026-10-26):** `onboard_systems()` (`sigenergy.py`) maps only pending-review→`pending_approval`, 1103/1112→`in_other_vpp`, 1105→`firmware_no_vpp`, 1401/1111→`no_permission`; anything else falls to the generic `result is None` branch, which logs `Onboard request failed ... (code=N)` and leaves `onboard_status` unchanged — including the production-observed top-level **13001** "station info not found"; `SIGENERGY_CODE_STATION_NOT_FOUND` (1106) and `..._STATION_INFO_NOT_FOUND` (1108) are defined but consumed nowhere. A mistyped ID and a valid-but-unapproved system are indistinguishable until the onboard POST — both 403 on `GET /openapi/system/{id}/devices` and land in `_not_onboarded` (see the 1201 symptom row); the discriminator is the onboard POST response lines (`Response from POST /openapi/board/onboard: {'code': ...}`), nothing else in the log separates the two cases. Outcome codes arrive per-item (`data[0].codeList[0]`) or top-level (`_last_api_code`). No test mocks a top-level outcome through `onboard_systems()` beyond the stale-code guard fixture. **Two plant-reported SoC floors surface differently (PR #5723, merged 2026-10-24):** `backupCutOffSOC%` → `battery_min_soc` (via the `battery_reserve_min` sensor, `set_arg_auto(..., overwrite=False)` so an apps.yaml value wins) while `dischargeCutOffSOC%` → the reserve (`controls[system]["reserve"]`) — and `apply_controls()` floors forced exports at `max(export_target_soc, reserve_soc)`, so the **plan's** floor is the backup cut-off and a higher discharge cut-off is honoured at execution only (automatic_config()'s comment spells this out) — on "Predbat plans below where my Sigen stops discharging", read `dischargeCutOffSOC%` from the change-message dump first; the durable fix (bind `battery_min_soc` to the max of both) is not built, and whether a self-consumption plant discharges below Backup SOC for house load is unverified. Two follow-up shapes to expect: `get_arg("battery_min_soc", ..., index=self.id)` quietly applies its default per inverter when the bound sensor entity is absent, and the `set_reserve_min` self-heal is one-way — it follows the plant's cut-off up, never down, so a plant lowering its Backup SOC needs one manual `set_reserve_min` lower. **Operating-mode writes have no observed path in (PRs #5692/#5724, author-reported against their own systems, not independently verified):** MQTT `openapi/instruction/mode` never took effect — #5692's ten read-only systems were held in VPP for minutes to ~29h with the set logged every minute and the next mode read still VPP; the REST `PUT /openapi/instruction/settings` sent alongside also did not change the MQTT-stubborn system and was dropped by #5724, since every REST call counts against the app key's shared rate limit (the `/openapi/system` 1201 throttle above). The working readout is `fetch_current_mode()` (REST GET of the same settings) and the one release observed to work is `POST /openapi/board/offboard` — main's `_exit_vpp_for_offboard()` defers offboarding until telemetry confirms the owner-controlled mode. A stuck-in-VPP report's answer is "no known-working write path while onboarded", not a Predbat defect; `set_operating_mode()`'s docstring carries the conclusion. **MQTT `period` freshness (PR #5757, merged ef1432be 2026-10-25, then #5790 widened the arrival window):** each `openapi/period` entry carries `statisticsTime` — epoch seconds for when the reading was *taken*, on a ~5-minute grid, distinct from arrival time and consistent with the REST envelope (real UTC; MQTT is 3.1.1, so there are no message properties to carry a timestamp). The broker observed fell ~2 h behind while still delivering a message every ~5–6 min, so **arrival time proves nothing about freshness** on this feed; `mqtt_data_lag[sid]` records the per-message lag (`_mqtt_listener_loop()`), beyond-threshold fields merge into `mqtt_period_raw` only (messages carry only changed fields, so anything handling `period` data must merge — absent fields read back as 0) with the `energy_flow` rewrite and publish skipped and a `Warn:` giving the age in minutes, and `run()`'s `mqtt_fresh` requires fresh arrival **and** lag within `SIGENERGY_MQTT_STALE_SECONDS`; `mqtt_data_lag` is not persisted, so the worst case after a restart is one tick trusting arrival time. **Do not "fix" `last_mqtt_update` to `statisticsTime`:** it is published as `sigenergy__time` and wired as Predbat's `inverter_time` (checked by `check_clock_skew()` → `auto_restart()` past `INVERTER_CLOCK_SKEW_RESTART_MINUTES` — inverter.py), so freezing it behind the feed's lag would make healthy-but-laggy feeds look like hours of clock skew and restart the app — the GH#5562 "clock skew measures data age" class with the opposite design consequence. Symptom: "Predbat plans from a stale Sigenergy SoC despite live-looking MQTT / REST spikes in SoC history" → the lag gate, and the `Warn: ... MQTT period data ... minutes old` line is the discriminator. **Automatic config caps power at the device-list nameplate; the real per-direction maxima go unread (GH#5784, grep-verified on main 2026-10-27, still open):** `_get_battery_max_power_kw()`/`_get_inverter_max_power_kw()` read only the polled REST device list, so a plant whose real per-direction maxima arrive only via MQTT (`period`-message `inverterMax{FeedIn,Absorption}ActivePowerW` → `mqtt_period_raw`, read by **nothing** on main; `batteryMax{Charge,Discharge}PowerW` → `flow_status.rated*`, sensor-attributes only) plans under what the hardware can deliver — the reporter's measured 6.6 kW/6.6 kW per-direction vs the configured 6.0 kW nameplate cap; "SIGCLOUD automatic config force-export/charge sits ~0.6 kW under what the inverter can deliver" starts here. Facts for any fix: change-msg `inverterMaxActivePowerW` lands in `self.systems[sid]["ratedActivePower"]` and is **write-only**; the period fields carry only values that changed (absent reads back as 0) and `mqtt_period_raw` is not in `SIGENERGY_CACHE_KEYS`, so it resets on restart and refills within one ~5 s period cadence (the devices fallback covers the gap); the capacity helper *prefers* the change-msg systems value while the power helpers read the device list only — asymmetry unresolved; the component's rate number entities are bounded by the same helpers (`_control_info`/fetch_controls clamp), so a cap fix widens those ranges too; `inverter_limit_override` can only lower (`min()`); `automatic_config()` binds `inverter_limit`/`battery_rate_max` with plain `set_arg` (a remedy is `set_arg_auto(..., overwrite=False)`, the pattern `export_limit`/`battery_min_soc` already use). Classify with the #4908/#5275/#5238 under-cap family, not as a regression. Suspect, unverified: whether the change-msg `inverterMaxActivePowerW` equals nameplate or the real max across plant sizes. | `sigenergy` | +| Sigenergy (`sigenergy.py`) | Lifetime/history totals are cumulative server-side and reset around EU midnight, which showed up as an overnight dip; `fetch_history_totals` applies a monotonic clamp. "Energy totals went backwards overnight" starts here. Separately, a user `apps.yaml` override of `inverter.has_reserve_soc: true` (stock `SIG` default is `False`, deliberately — reverted in `5bfc5c80` after #2873/#3124) bypasses two guards that normally make reserve writes inert for Sigenergy (`execute.py:947-950`, `inverter.py:547-549`), so `adjust_reserve()` writes straight to `number.sigen_plant_ess_discharge_cut_off_state_of_charge`. Confirmed from a reporter's log: zero occurrences of the "Inverter does not support reserve" disable message the first guard would normally log, plus 56 reserve writes landing on that register (GH#4728). The stock template's `reserve:` line also points at that same entity rather than `ess_backup_state_of_charge`, which is what makes the override immediately destructive rather than merely inert. `Applying mode=eco ... duration=720min` is emitted only by the no-window fall-through branch (`sigenergy.py:2199`), so seeing it while a plan export window is live means the component's control snapshot never saw the window. Two code-verified routes to that, both still live: with `sigenergy_automatic: False`, `automatic_config()` - the only wiring of the component's control entities into Predbat - never runs, so Predbat's plan writes land on its own simulated dummy entities (`inverter.py:539-545`) and a `True == True` read-back is Predbat comparing against itself rather than reading a register; and `fetch_controls` runs on the first tick only (`if first:`, `sigenergy.py:2658`), so a single missed `call_service` event leaves the component's internal state permanently out of step while Predbat's write-skip comparison guarantees the healing write is never re-issued (GH#4894, probe-verified in `test_sigenergy.py`). `_publish_mqtt` logged the live `accessToken` on every command until PR #4926 added `SigenergyAPI.redact()`. The docs template still writes `number.sigen_plant_grid_import_limitation` to 0 in both freeze branches (`docs/inverter-setup.md:1936-1940` and `:1971-1975`), and Sigenergy's own EVAC/EVDC chargers are EMS-throttled to the plant import limit - so the block lands exactly when Predbat asks for Freeze Charging to hold for a car (GH#4911). On the **stock** `has_reserve_soc: False` shape the planned reserve floor is model-only and the battery drains to the inverter's own cut-off — see the "Plan shows a flat hold at the reserve" symptom row (GH#5358). **Every power lever on SIGCLOUD has been silently inert (GH#5376, hardware-verified by the reporter's live MQTT log and battery data; **fixed in PR #5377, merged 2026-10-03 and first shipped in v9.3.5** — the six optional fields are now built into the command object, `sigenergy.py` — keep the pre-#5377 reading for older logs):** `send_battery_command()` writes its six optional power/priority fields — `chargingPower`, `pvPower`, `maxSellPower`, `maxPurchasePower`, `chargePriorityType`, `dischargePriorityType` — at the **top level** of the payload while the required command fields sit inside `commands[0]` (since `cba12cc3`, first released v8.36.11); the API reads the levers from the command objects, so the top-level fields are silently ignored, and planned charge rate, bidirectional export cap, freeze-charge/`freeze_export_hold` `chargingPower: 0` and both priority types (all set in `apply_controls()`, `sigenergy.py`) have never reached the hardware. The suite passed while the bug was live because `test_sigenergy.py` asserted `payload["chargingPower"]` at the top level while checking `commands[0]` for the required fields — **a test that locks in the implementation's current output makes suite-green meaningless for that surface**; the #5377 fix rewrote the test to assert inside `commands[0]` (its "optional fields that were not passed are omitted" cases are the in-tree example of testing the fixed shape). Suspect, not verified: the fixed surface has never been hardware-tested by the triage bot, so a post-v9.3.5 regression report about holds/exports on SIGCLOUD may be that surface going live for the first time; pre-#5377, the #4761 freeze-export reasoning and the `freeze_export_hold` branch never acted with real effect. **Docs entity-name split (GH#5459, docs defect, fixed in PR #5464, `c0d901db`, 2026-10-12):** `docs/inverter-setup.md`'s `predbat_max_*_limit_action` automations reference `sensor.sigen_inverter_ess_rated_charging_power`/`..._discharging_power` - inverter level with the plant suffix - while the upstream integration defines the rated-power pairs at two levels with different suffix spellings: plant `plant_ess_rated_charging/discharging_power` (-ing) and inverter `inverter_ess_rated_charge/discharge_power` (no -ing), so the docs names match neither set; the docs' own rename note points at the inverter alternates, and the template binds `battery_rate_max` to the plant-level `-ing` name (the right clamp level for the plant-level limit numbers the automations write). A Sigenergy "float got invalid input 'unknown'" automation error resolves by mapping level first (plant vs inverter), then suffix; the automations are docs content and no Predbat code creates them. PR #5681 (merged 2026-10-21, `0eaafc6b`) added the plant grid export limit: `openapi/change` state (per system: `antiReflux` + `gridMaxBackfeedPowerW`) now lives in `self.grid_export` and **is cached across restarts** (`SIGENERGY_CACHE_KEYS` gained `grid_export` — a change-message state that is discovery-owned dies at restart, so this closes the class on main; check the *reader* before assuming a post-restart figure is stale, the capacity/rated-power sensors read `self.devices` which the periodic poll keeps fresh), with the limit semantics antiReflux off → 99999 (unlimited) whatever the backfeed figure says, on → the backfeed value including 0, never reported → backfeed when >0 else 99999; `automatic_config()` binds `export_limit` with `set_arg_auto(..., overwrite=False)` so a hand-set apps.yaml value wins. **Onboarding outcome codes are barely mapped (GH#5691, triaged 2026-10-22, still live on main — table and dead constants re-verified by grep 2026-10-26):** `onboard_systems()` (`sigenergy.py`) maps only pending-review→`pending_approval`, 1103/1112→`in_other_vpp`, 1105→`firmware_no_vpp`, 1401/1111→`no_permission`; anything else falls to the generic `result is None` branch, which logs `Onboard request failed ... (code=N)` and leaves `onboard_status` unchanged — including the production-observed top-level **13001** "station info not found"; `SIGENERGY_CODE_STATION_NOT_FOUND` (1106) and `..._STATION_INFO_NOT_FOUND` (1108) are defined but consumed nowhere. A mistyped ID and a valid-but-unapproved system are indistinguishable until the onboard POST — both 403 on `GET /openapi/system/{id}/devices` and land in `_not_onboarded` (see the 1201 symptom row); the discriminator is the onboard POST response lines (`Response from POST /openapi/board/onboard: {'code': ...}`), nothing else in the log separates the two cases. Outcome codes arrive per-item (`data[0].codeList[0]`) or top-level (`_last_api_code`). No test mocks a top-level outcome through `onboard_systems()` beyond the stale-code guard fixture. **Two plant-reported SoC floors surface differently (PR #5723, merged 2026-10-24):** `backupCutOffSOC%` → `battery_min_soc` (via the `battery_reserve_min` sensor, `set_arg_auto(..., overwrite=False)` so an apps.yaml value wins) while `dischargeCutOffSOC%` → the reserve (`controls[system]["reserve"]`) — and `apply_controls()` floors forced exports at `max(export_target_soc, reserve_soc)`, so the **plan's** floor is the backup cut-off and a higher discharge cut-off is honoured at execution only (automatic_config()'s comment spells this out) — on "Predbat plans below where my Sigen stops discharging", read `dischargeCutOffSOC%` from the change-message dump first; the durable fix (bind `battery_min_soc` to the max of both) is not built, and whether a self-consumption plant discharges below Backup SOC for house load is unverified. Two follow-up shapes to expect: `get_arg("battery_min_soc", ..., index=self.id)` quietly applies its default per inverter when the bound sensor entity is absent, and the `set_reserve_min` self-heal is one-way — it follows the plant's cut-off up, never down, so a plant lowering its Backup SOC needs one manual `set_reserve_min` lower. **Operating-mode writes have no observed path in (PRs #5692/#5724, author-reported against their own systems, not independently verified):** MQTT `openapi/instruction/mode` never took effect — #5692's ten read-only systems were held in VPP for minutes to ~29h with the set logged every minute and the next mode read still VPP; the REST `PUT /openapi/instruction/settings` sent alongside also did not change the MQTT-stubborn system and was dropped by #5724, since every REST call counts against the app key's shared rate limit (the `/openapi/system` 1201 throttle above). The working readout is `fetch_current_mode()` (REST GET of the same settings) and the one release observed to work is `POST /openapi/board/offboard` — main's `_exit_vpp_for_offboard()` defers offboarding until telemetry confirms the owner-controlled mode. A stuck-in-VPP report's answer is "no known-working write path while onboarded", not a Predbat defect; `set_operating_mode()`'s docstring carries the conclusion. **MQTT `period` freshness (PR #5757, merged ef1432be 2026-10-25, then #5790 widened the arrival window):** each `openapi/period` entry carries `statisticsTime` — epoch seconds for when the reading was *taken*, on a ~5-minute grid, distinct from arrival time and consistent with the REST envelope (real UTC; MQTT is 3.1.1, so there are no message properties to carry a timestamp). The broker observed fell ~2 h behind while still delivering a message every ~5–6 min, so **arrival time proves nothing about freshness** on this feed; `mqtt_data_lag[sid]` records the per-message lag (`_mqtt_listener_loop()`), beyond-threshold fields merge into `mqtt_period_raw` only (messages carry only changed fields, so anything handling `period` data must merge — absent fields read back as 0) with the `energy_flow` rewrite and publish skipped and a `Warn:` giving the age in minutes, and `run()`'s `mqtt_fresh` requires fresh arrival **and** lag within `SIGENERGY_MQTT_STALE_SECONDS`; `mqtt_data_lag` is not persisted, so the worst case after a restart is one tick trusting arrival time. **Do not "fix" `last_mqtt_update` to `statisticsTime`:** it is published as `sigenergy__time` and wired as Predbat's `inverter_time` (checked by `check_clock_skew()` → `auto_restart()` past `INVERTER_CLOCK_SKEW_RESTART_MINUTES` — inverter.py), so freezing it behind the feed's lag would make healthy-but-laggy feeds look like hours of clock skew and restart the app — the GH#5562 "clock skew measures data age" class with the opposite design consequence. Symptom: "Predbat plans from a stale Sigenergy SoC despite live-looking MQTT / REST spikes in SoC history" → the lag gate, and the `Warn: ... MQTT period data ... minutes old` line is the discriminator. **Automatic config caps power at the device-list nameplate; the real per-direction maxima go unread (GH#5784, grep-verified on main 2026-10-27, still open):** `_get_battery_max_power_kw()`/`_get_inverter_max_power_kw()` read only the polled REST device list, so a plant whose real per-direction maxima arrive only via MQTT (`period`-message `inverterMax{FeedIn,Absorption}ActivePowerW` → `mqtt_period_raw`, read by **nothing** on main; `batteryMax{Charge,Discharge}PowerW` → `flow_status.rated*`, sensor-attributes only) plans under what the hardware can deliver — the reporter's measured 6.6 kW/6.6 kW per-direction vs the configured 6.0 kW nameplate cap; "SIGCLOUD automatic config force-export/charge sits ~0.6 kW under what the inverter can deliver" starts here. Facts for any fix: change-msg `inverterMaxActivePowerW` lands in `self.systems[sid]["ratedActivePower"]` and is **write-only**; the period fields carry only values that changed (absent reads back as 0) and `mqtt_period_raw` is not in `SIGENERGY_CACHE_KEYS`, so it resets on restart and refills within one ~5 s period cadence (the devices fallback covers the gap); the capacity helper *prefers* the change-msg systems value while the power helpers read the device list only — asymmetry unresolved; the component's rate number entities are bounded by the same helpers (`_control_info`/fetch_controls clamp), so a cap fix widens those ranges too; `inverter_limit_override` can only lower (`min()`); `automatic_config()` binds `inverter_limit`/`battery_rate_max` with plain `set_arg` (a remedy is `set_arg_auto(..., overwrite=False)`, the pattern `export_limit`/`battery_min_soc` already use). Classify with the #4908/#5275/#5238 under-cap family, not as a regression. Suspect, unverified: whether the change-msg `inverterMaxActivePowerW` equals nameplate or the real max across plant sizes. **The change push is now cancelled-then-re-subscribed on every MQTT connect** (PR #5813 merged `426ec388`, then PR #5815 added the pause — `b23dbd88`; both on main): `_mqtt_listener_loop()` publishes the undocumented app-level cancel `openapi/unsubscription/change` (topic carries no app_key/system_id; payload `{accessToken, systemIdList}` — found by the PR author probing the live broker with MQTT 5 PUBACK reason codes: `0x87 Not authorized` names a nonexistent topic, `0x00` a real one — a reusable probe; only the diagnostic paths, `sigenergy.py` `--mqtt-scan`/`--command-test`, speak V5), sleeps `SIGENERGY_MQTT_RESUBSCRIBE_DELAY` (5 s, `sigenergy.py:148`), then publishes the three `openapi/subscription/*` requests — so the full `openapi/change` snapshot (`antiReflux`/`gridMaxBackfeedPowerW` → export limit, the SoC cut-offs → `battery_min_soc`/reserve/charge target) is re-delivered at each reconnect instead of only at the first connect after onboarding; "export limit reads 99999" should first ask which build the plant is on and whether a snapshot ever arrives. The cancel and the subscribes ride **different topics with no cross-topic ordering**: sent back-to-back (pre-#5815) the backend could apply the cancel after the subscribes and leave the system with no change subscription at all — seen on 2 of 29 of the author's live plants, both recovered by the 5 s pause — but the pause bounds the race empirically, not deterministically, and a qos=1 publish being awaited proves the broker accepted the message, not that the backend applied it. The production listener connects **without `protocol=`** → aiomqtt negotiates MQTT 3.1.1 → a refused cancel cannot be signalled at all, and the log's `SigenergyAPI: MQTT subscriptions published ...` proves nothing; on an ACL tightening this would silently revert plants to the 100 kW default export limit after `grid_export`/`device_cutoffs` caches age out at 28 days (`SIGENERGY_SETTINGS_CACHE_EXPIRY_DAYS`, chosen per key in `_save_cache`). Suggested hardening (review finding, still open at writing): warn when no `openapi/change` message arrives within ~10 s of a connect, and/or teach the V5 probe to publish the cancel topic and report its code. | `sigenergy` | | AlphaESS (`alphaess.py`) | Once any discharge window is configured (`ctrDis=1`), AlphaESS firmware allows discharge *only* inside that window — outside it the battery is charge-from-PV-only, with no self-consumption fallback (AlphaESS's own documented behaviour, per GH#4701). Predbat's generic handling of what happens outside a configured discharge window (`execute.py`) has no AlphaESS-specific case and assumes normal demand mode resumes there, which holds for other brands but not this one — the next best export window Predbat schedules can be hours away, leaving the battery locked out of discharge until then (GH#4723). A separate write-ordering bug, **fixed in PR #4776 (merged 2026-08-27)**: the periodic API commits a schedule in stages — window, then enable switch, then target SoC — pressing the write button after each, so the *first* commit of a cycle always carried the *previous* cycle's target while `alphaess_min_write_interval` (default 300s) held the correcting write back for the rest of that pacing window; a manual charge on an already-live slot could run at the stale target for up to five minutes (GH#4769, confirmed from the reporter's log, not inferred). Also: the legacy `/updateDisChargeConfigInfo` endpoint's `batUseCap` field (the reserve/export-SoC value) has no floor on the Predbat side (`alphaess.py:1103`/`:1143`), while the periodic path clamps it to AlphaESS's documented `[10,100]` range — a reserve/export-SoC entity set below 10 gets every legacy write rejected with an undocumented `10001` (GH#4748); that errno is the signature to recognise this class by. **The single most important thing to know here, documented on `main` since PR #4744: the AlphaESS Open API cannot control export at all, so Predbat cannot make it export.** There is no forced-export, working-mode or dispatch endpoint - only a grid-charge window with a target SoC, a discharge window with an SoC floor, or both together on entitled systems. Force Export therefore exports nothing beyond genuine solar surplus, and Freeze Export comes out byte-identical to Demand mode because `gridCharge` gates only *timed grid charging* and nothing can stop the battery charging from solar. The documented answer is to set `select.predbat_mode` to `Control charge` on AlphaESS; left on `Control charge & discharge` Predbat plans exports that never happen *and* programs the discharge window up to `plan_interval_minutes` early, which on permission-window semantics bars the battery from covering house load until the window opens (that is GH#4723's mechanism). Forced export is reachable over local Modbus, never from the cloud API. Separately, PR #4867 changed how a hold is expressed: Predbat now writes a synthetic **enabled 10% target at 100 W** on a stable daily window (`ALPHAESS_HOLD_SOC`/`ALPHAESS_HOLD_POWER`, `alphaess_const.py:183-184`) rather than the old zero-rate hold, because zero power disables charging in Predbat and AlphaESS may discard such a profile. A genuine grid charge is not replaced by it (`alphaess.py:1106`). Note the consequence, raised in review and not tested on hardware: unlike a zero-rate hold this profile is not energy-neutral by construction, so an install sitting below 10% SoC has a standing 100 W charge request while the hold is in force. | `alphaess_control` | | Ohme (`ohme.py`) | A vendored, version-pinned copy of `dan-r/ohmepy` (`ohme.py:33`, `VERSION`). GH#4719 (2026-08-25) found it several minor versions behind upstream with the control routes (max-charge, session rule) pointing at a withdrawn `/v1/chargeSessions/{id}/rule` — a 404 with Spring's `NoResourceFoundException` — while GET/pause/resume/approve kept working since those stayed on v1 upstream. **Fixed on `main` since** (confirmed 2026-08-27): the vendored client now calls the v2 routes upstream moved those endpoints to. A reporter on an older Predbat version seeing control-only failures (GETs/pause/resume fine, target time/percent/preconditioning silently not applying) is hitting this, not a new bug. Separately, and **still live** (GH#4952): `slot_list()` derives slot energy as `watts * hours` (`ohme.py:124`), treating `watts` as a sustained rate when the observed 16A -> 10A -> 6A taper shows it is a per-slot cap - a reporter measured 48.49 kWh modelled against 19.02 kWh of real charge, 2.55x. Ohme publishes `estimatedSoc`, which would give the true delta, and `ohme.py` never reads it anywhere. The same slots are published as dispatches with `location: "AT_HOME"` and no `source` (`ohme.py:670`), so `rate_add_io_slots()` stamps the whole plug-in-to-target block at the low rate. Note the existing tests assert the current `watts * hours` semantics, and `estimatedSoc` is itself extrapolated when the car has no SoC telemetry - so neither side is a drop-in swap. See the car-charging row for why the `predict()` clamp has to be trimmed *after* this, not before. **Two ownership/executor findings on the same install shape are both fixed on main (PRs #5401 and #5405, merged 2026-10-05, unreleased at the time of writing - keep the pre-fix mechanisms for logs on v9.3.5-):** with `ohme_automatic` on and `ohme_control` off on a non-Intelligent tariff, Predbat's own car plan had **no executor** - `control_charge()` is the only executor and `enable_control()` returns early without `ohme_control`, every other consumer of `car_charging_slots` is model/display-side, and no load-only mode existed, so the charger followed Ohme's schedule while Predbat's plan was a fiction (GH#5399). Now Ohme's session slots become the car plan through the same path Intelligent dispatches take, labelled a charger schedule so they earn no cheap rate (import rates untouched; `reprice_charger_schedule_slots()` re-prices them on this cycle's rates because `load_octopus_slots()` runs before rates are built), and the dispatch/schedule/Predbat-led choice is re-made on every poll instead of once at start-up. And slot-ownership auto-detection was tariff-only - `octopus_intelligent_wanted()` never looked at which Intelligent device Octopus actually drives, so on an Intelligent tariff with a car-linked device (BMW/Mini/VW, `is_charger: false`) Ohme claimed slots Octopus schedules through the car itself (GH#5402). Detection now looks at the Octopus component's live non-suspended Intelligent devices (`is_ohme_charger()` = `is_charger` + provider "ohme"): an Ohme among them takes the slots; Octopus driving another device leaves them to Octopus and `ohme_control` stands down; every device suspended or an Intelligent tariff with no device keeps Ohme's schedule as the plan; an explicit `ohme_automatic_octopus_intelligent` still wins. `test_ohme.py`'s older tariff-only cases encode the pre-#5405 detection, so a green suite there proves nothing about a device-check change. **Two 404 classes on `/v1/chargeSessions/...` — keep them apart (GH#5444, verified by reading the vendored `ohme.py` on v9.3.6-4):** #4719 is the route-withdrawal class with Spring's `No static resource ...` body (route dead); the no-active-session class (2026-10-08) has body `Entity of type: 'ActiveChargeSessionDB' and id: '' not found` — the stop route is live but keyed on the *device serial* in the session-id position, and Ohme's server keeps no active-session row once a charge has finished or the car is unplugged, so any pause attempt in that state 404s forever. Predbat-side amplifier: `control_charge()` awaits `async_max_charge()`/`async_pause_charge()` with **no exception guard**, so the `ApiException` escapes before `self.control_charging = should_charge` records the transition — the state machine believes it still holds a window and retries the identical pause every `CONTROL_INTERVAL_SECONDS` (60 s), and each failure also skips `update_success_timestamp()`, which the component health monitor reads, so a long storm degrades the component toward unhealthy. Upstream `dan-r/ohmepy` main has the same unguarded stop/resume, so the guard belongs in Predbat's control layer. **Path trap:** the log's `File "/config/ohme.py"` traceback is the vendored Predbat client (message strings `Warn: Ohme API response error` / `Outside the charge plan, pausing the charger`), not the HA Ohme integration. **Drift check:** upstream ohmepy's `VERSION` now lives in `ohme/const.py` while Predbat pins it inline in `ohme.py` — diff both files when checking vendored drift. **An attached-but-idle car reads unplanned (same ticket):** with `ohme_control: true` Ohme's schedule is deliberately not the car plan (`charger_slots_wanted()` returns False while `control_active`) and `plan_car_charging()` runs only while `binary_sensor.predbat_ohme_connected` is on — published ON only for `CONNECTED_STATUSES` = PENDING_APPROVAL/CHARGING/PLUGGED_IN/PAUSED, which **excludes FINISHED** — so a just-completed session (attached, idle) reads "not planned": no slots and Predbat-led control keeps the charger paused; a manual app charge creates a live session and flips the gate. Workaround: `ohme_control: false` (v9.3.6+ then takes Ohme's own schedule as the plan, #5401). The plugged-in-idle session mode is the chain's unverified link — confirm it from a reporter capture taken during a no-slots hour before treating it as root cause. | `ohme` | -| Solcast (`solcast.py`) | `max_kwh` — the array-capacity ceiling used to sanity-check the forecast — is initialised to `9999` just before the `fetch_pv_forecast()` branch chain (`solcast.py:1718`) and is only ever reassigned on the Forecast.Solar and Open-Meteo branches. On the direct-API and HA-sensor Solcast paths it stays `9999`, so the "Raw forecast exceeds the array ceiling" warning (`solcast.py:1538`) can never fire for Solcast users — confirmed by reading the assignments (GH#4730). That warning is exactly the diagnostic an "impossible PV predicted" report needs, so its absence isn't evidence the ceiling wasn't exceeded. Branch order at `solcast.py:1368` also means a configured `solcast_api_key` always wins over `pv_forecast_*` HA sensors, so comparing Predbat's number against the HA entity compares against the wrong source when both are set. Two more. `solcast_poll_hours: 4.8` is silently truncated to 4: component args come from `COMPONENT_LIST`'s int defaults via `get_arg()`, which does `int(float(value))` (`userinterface.py:266`), and GH#4441's fix lives on the CONFIG_ITEMS route that component args bypass - the reporter's log showed real fetches at exactly 4h and 18x `code 429` against a 10/day hobbyist limit, while `docs/apps-yaml.md` recommends 4.8 for two-array accounts (GH#4925). And `publish_pv_stats()` reads the shared, briefly-rewound `midnight_utc` live (GH#4804) - see "The shared clock is rewound for ~0.8s every hour" above, which has since been confirmed as a real bug class by a separate merged fix. PV calibration self-reference (GH#5116, **fixed in PR #5121** — mechanism kept for older logs): `sensor._pv_forecast_h0` publishes the **calibrated** `power_nowCL` as its state whenever calibration is on, with the raw value only in the `now` attribute, so anything reading the state history gets calibrated output — and calibration itself used to read that history as its "past forecast" while applying its factors to the raw series, which settles the factor at **√(actual/raw)** and corrects only ~half the bias (logged 0.9073x against a measured 0.82). #5121 replaced the read with a dedicated `sensor._pv_forecast_h0_uncalibrated`, published unconditionally and never scaled by `pv_scaling`; `pv_forecast_history()` reads it (scaled by the *current* `pv_scaling`, so a change takes effect over the whole window at once), falls back per-point to the h0 `now` attribute and then the h0 state for points predating the sensor (`now` was added in the same commit that made the state calibrated, so a point without `now` recorded the raw state), and the web chart plots the uncalibrated series. The h0 state-vs-`now` distinction stays live for other consumers. Two general facts from the same PR's review: `history_attribute(attributes=True)` drops any point whose attributes lack the key unless `fallback_to_state=True` (the state path filters `unavailable`/`unknown`; the attribute path only skips them inside the fallback read — `utils.py`), and the DB mirror returns rows with `attributes = {}` on JSON decode failure (`db_engine.py` — the row is still appended), so an empty attribute read on a `db_primary` history does not prove the data predates the attribute. Anything comparing h0 attributes against Predbat's internal PV series must also account for `pv_scaling`, which sits on one side only (`now` is pre-scaling, the internal series post-scaling). Test-fidelity trap: a calibration test that patches `history_attribute_to_minute_data` cannot see which series calibration learned from — the real path needs a `get_history_wrapper` mock with HA-shaped entries wrapped in `patch_now_utc_exact()`, because `now_utc_exact` is real wall-clock while `minutes_now`/`midnight_utc` are frozen; `prune_today`'s default `group=15` also drops history points closer than 15 minutes apart. `pv_calibration()`'s past-forecast history additionally flows through the **module-global** `history_attribute_to_minute_data` (solcast.py imports it by name), so an instance-level override cannot intercept it — patch `solcast.history_attribute_to_minute_data` and restore it in a `finally`, and re-patch before a second call in the same test. **Open-Meteo shading is client-side (GH#5224):** the Open-Meteo `v1/forecast` API has no `horizon` parameter (closest solar-geometry options are `tilt`/`azimuth` for GTI), so any horizon feature — Predbat's or a user asking for one — must be applied client-side to the downloaded irradiance, which is exactly what the HA Open-Meteo Solar Forecast integration (rany2) does; Predbat's existing knob is the static per-array monthly `shading_factors` applied in `gti_hourly_to_period_kwh()` (`solar_model.py`), which cannot express geometric blocking. *Suspected, not verified:* that integration's published attribute names could not be confirmed compatible with Predbat's HA-sensor PV path (`detailedForecast`/`forecast` with `pv_estimate` entries), so do not recommend pointing Predbat at its sensors as a workaround without checking the entity shape. **Band built from the wrong series with calibration off (GH#5345, fixed in PR #5347 \[v9.3.4\]: `pv_calibration()` now takes `calibrate_band` and builds the band on the P50 it is returned with — the switch-off path swaps both p50 and the band back to raw, and Open-Meteo keeps its own ensemble band instead of a synthesised `create_pv10` one; keep the pre-#5347 mechanism for older logs):** on a `create_pv10` source (Open-Meteo, Forecast.Solar) with `metric_pv_calibration_enable` off, `pv_calibration()` built `pv_forecast_minute10`/`90` and the published `pv_estimate10`/`90` from the **calibrated** series and only swapped P50 back to raw at its final `return`, so P10 could exceed P50 and P90 fall below it, and `get_cloud_factor`'s (ΣP50 − ΣP10) gap was arbitrary - reported as "the saw tooth has gone". Signature in `sensor._pv_today` `detailedForecast`: `pv_estimate10 / pv_estimateCL` and `pv_estimate90 / pv_estimateCL` constant in every slot while `pv_estimateCL / pv_estimate` varies. Dead end: it is not Open-Meteo's ensemble P10 being "confident" - at the time that download was fetched and then overwritten by `pv_calibration()`, because every Open-Meteo branch set `create_pv10`; the same change makes `fetch_pv_forecast()` keep an ensemble band (`create_pv10` False, `calibrate_band` True) and fall back to the history-based band only when the ensemble download fails. The band is the ensemble's P10 and P90 **as ratios of the ensemble's own median**, applied to the deterministic P50, not the ensemble's absolute values: the P50 comes from the best-match deterministic call and the spread from `icon_seamless`, two different model runs that can disagree on a whole day's level - live on 2 Oct 2026 the absolute ensemble P10 sat above the deterministic P50 for a day three ahead (clamped, leaving a 2% downside) and at 0.28 of it elsewhere. Known weakness of the ratio: the deterministic forecast is re-issued between ensemble runs and moved one site's next-day total from 1635 to 3887 Wh/m2 in ten minutes, above the ensemble's own P90, and P50 x (P90/median) then overshoots anything the sky can deliver - only the `1.2 x kWp` power ceiling bounds it, there is no clear-sky cap. So an implausibly high `pv_estimate90` on an Open-Meteo site maps here. Test trap from that work: the solar test mock returns the first response whose key is a substring of the URL, and `api.open-meteo.com` is a substring of `ensemble-api.open-meteo.com`, so a test registering both in that order silently serves the forecast body to the ensemble call and exercises the no-ensemble path. The in-function `enabled_calibration` flag means "enough history", not the user switch, so the fixed 0.7/1.3 band does not apply with the switch off. Routine SolarAPI Info lines are not in shipped logs; read the `pv_today`/`pv_forecast_h0` attributes instead. A source that publishes a 0-PV day is not a safe fallback either — the counter-argument to any "just publish 0" suggestion: a 0-yield day is a `pv_calibration()` down-day (actual < 10% of forecast) and ≤ 2 valid days switches calibration off entirely, leaving the raw forecast (GH#5388 context, code-read on main; `solcast.py`). The AC-coupled netting case (GH#5552 — see the solar-optimism symptom row below) is this shape with `pv_today` bound but reading 0 every day: every valid day is a down-day and the log line to look for is `SolarAPI: PV Calibration: Not enough valid (non-down) days for calibration`. **PV source precedence and the missing Solcast fallback (GH#5545, re-verified on main 2026-10-15):** `fetch_pv_forecast()` picks the source by one elif chain, in this order: Forecast.Solar with `forecast_solar_open_meteo_first` set (Open-Meteo primary, Forecast.Solar fallback) → Forecast.Solar (the only source with an in-tree fallback, `forecast_solar_open_meteo_backup`, and it triggers on *empty data* only, `solcast.py:1742`) → `open_meteo_forecast` (`solcast.py:1749`) → Solcast direct (`solcast.py:1756`) → HA sensors. So configuring `open_meteo_forecast` makes Open-Meteo the *only* PV plan source even with `solcast_host`/`solcast_api_key` also set - Solcast is never consulted; route any "I configured Solcast but Open-Meteo feeds my plan" report here before suspecting anything else. Solcast direct has **no fallback at all**: on any failed HTTP call (429 included) `cache_get_url()` returns the stale cached payload rather than None (`solcast.py:221`), so after any prior success `pv_forecast_data` is non-empty and an empty-data trigger like the Forecast.Solar backup can never fire for Solcast - the plan then ages indefinitely on stale cache (`solcast_poll_hours` gates the refetch cadence, not staleness), which means any Solcast backup has to key off staleness (`solcast_last_success_timestamp` is already tracked at `solcast.py:226`), not off empty data. Two source-label facts that go with it: `self.active_forecast_source` keeps the source that actually served the fetch (`solcast.py:1810`), while the 7-day calibration-settling warning in `log_source_change()` is issued for the *configured* source (`solcast.py:1811`) - a backup flapping would not retrigger that warning unless deliberately included. **Per-minute `dp2()` rounding on the calibration sums inflates the dull-day calibration (GH#5690, bug, triaged 2026-10-22, still live on main **(re-verified at b37f25af; fix drafted in PR #5802)** — re-verified by reading the accumulation loop):** `pv_calibration()`'s per-day totals round **every per-minute accumulation** with `dp2()` (`days_forecast_total`/`days_forecast_total_scaled_slot`, solcast.py), so on a dull day (every `pv_value` < 0.01 kWh/min) both sums degenerate to `0.01 × count(minutes ≥ 0.005)` and `days_use_scaling = total_adjustment / scaling_applied` overshoots — measured 1.84× against a 0.92× adjustment, repro output matching the issue's numbers. Nothing downstream bounds it: the `PV_CALIBRATION_HIGHEST/LOWEST` clamps bound the adjustment terms, not their recomposed ratio, and the array ceiling binds only near the ceiling; log signature: day-0 scaling ≈ 1.0, later days inflated. Found by `git log -L` on the accumulation lines — the per-add `dp2()` arrived in a spelling-fix commit (`f27f40f5`, 2026-03-23), the sums were unrounded before it (`f774d2f9`); check cosmetic commits for numeric behaviour changes, `git log -L` finds these fast. No test covers a dull day (per-minute values below 0.01 kWh); `test_pv_calibration_power_conversion`/`test_pv_calibration_sparse_recent_history_no_crash` cover total≈1 and a no-crash case only. **A shape-agnostic property to test any calibration change against (from the PR #5802 investigation, 2026-10-27):** each future day's calibrated total must equal the raw day total × the day's `days_use_scaling` factor to ~1% — the per-slot adjustments exist precisely so that property holds whatever their shape, and the array ceiling is the only exception (it does not bind on dull days). It caught the dp2 bug both ways (dull bell inflated, flat day deflated), so unexpected per-day numbers in the `PV Calibration: Days forecast total ...` log line are worth checking against it first. Reusable harness: `calibrate()` (`tests/test_pv_calibration_clipping.py`) builds a synthetic week of history from kW-by-minute-of-day lambdas and runs the real `pv_calibration`, returning tomorrow's P50/PV10 and the total adjustment; `tests/test_pv_calibration_day_scaling.py` (#5802) imports it, so new calibration tests need no new fixture (`inverter_limit_kw=20.0` keeps the clipping exclusion out of the way). | `solcast` | +| Solcast (`solcast.py`) | `max_kwh` — the array-capacity ceiling used to sanity-check the forecast — is initialised to `9999` just before the `fetch_pv_forecast()` branch chain (`solcast.py:1718`) and is only ever reassigned on the Forecast.Solar and Open-Meteo branches. On the direct-API and HA-sensor Solcast paths it stays `9999`, so the "Raw forecast exceeds the array ceiling" warning (`solcast.py:1538`) can never fire for Solcast users — confirmed by reading the assignments (GH#4730). That warning is exactly the diagnostic an "impossible PV predicted" report needs, so its absence isn't evidence the ceiling wasn't exceeded. Branch order at `solcast.py:1368` also means a configured `solcast_api_key` always wins over `pv_forecast_*` HA sensors, so comparing Predbat's number against the HA entity compares against the wrong source when both are set. Two more. `solcast_poll_hours: 4.8` is silently truncated to 4: component args come from `COMPONENT_LIST`'s int defaults via `get_arg()`, which does `int(float(value))` (`userinterface.py:266`), and GH#4441's fix lives on the CONFIG_ITEMS route that component args bypass - the reporter's log showed real fetches at exactly 4h and 18x `code 429` against a 10/day hobbyist limit, while `docs/apps-yaml.md` recommends 4.8 for two-array accounts (GH#4925). And `publish_pv_stats()` reads the shared, briefly-rewound `midnight_utc` live (GH#4804) - see "The shared clock is rewound for ~0.8s every hour" above, which has since been confirmed as a real bug class by a separate merged fix. PV calibration self-reference (GH#5116, **fixed in PR #5121** — mechanism kept for older logs): `sensor._pv_forecast_h0` publishes the **calibrated** `power_nowCL` as its state whenever calibration is on, with the raw value only in the `now` attribute, so anything reading the state history gets calibrated output — and calibration itself used to read that history as its "past forecast" while applying its factors to the raw series, which settles the factor at **√(actual/raw)** and corrects only ~half the bias (logged 0.9073x against a measured 0.82). #5121 replaced the read with a dedicated `sensor._pv_forecast_h0_uncalibrated`, published unconditionally and never scaled by `pv_scaling`; `pv_forecast_history()` reads it (scaled by the *current* `pv_scaling`, so a change takes effect over the whole window at once), falls back per-point to the h0 `now` attribute and then the h0 state for points predating the sensor (`now` was added in the same commit that made the state calibrated, so a point without `now` recorded the raw state), and the web chart plots the uncalibrated series. The h0 state-vs-`now` distinction stays live for other consumers. Two general facts from the same PR's review: `history_attribute(attributes=True)` drops any point whose attributes lack the key unless `fallback_to_state=True` (the state path filters `unavailable`/`unknown`; the attribute path only skips them inside the fallback read — `utils.py`), and the DB mirror returns rows with `attributes = {}` on JSON decode failure (`db_engine.py` — the row is still appended), so an empty attribute read on a `db_primary` history does not prove the data predates the attribute. Anything comparing h0 attributes against Predbat's internal PV series must also account for `pv_scaling`, which sits on one side only (`now` is pre-scaling, the internal series post-scaling). Test-fidelity trap: a calibration test that patches `history_attribute_to_minute_data` cannot see which series calibration learned from — the real path needs a `get_history_wrapper` mock with HA-shaped entries wrapped in `patch_now_utc_exact()`, because `now_utc_exact` is real wall-clock while `minutes_now`/`midnight_utc` are frozen; `prune_today`'s default `group=15` also drops history points closer than 15 minutes apart. `pv_calibration()`'s past-forecast history additionally flows through the **module-global** `history_attribute_to_minute_data` (solcast.py imports it by name), so an instance-level override cannot intercept it — patch `solcast.history_attribute_to_minute_data` and restore it in a `finally`, and re-patch before a second call in the same test. **Open-Meteo shading is client-side (GH#5224):** the Open-Meteo `v1/forecast` API has no `horizon` parameter (closest solar-geometry options are `tilt`/`azimuth` for GTI), so any horizon feature — Predbat's or a user asking for one — must be applied client-side to the downloaded irradiance, which is exactly what the HA Open-Meteo Solar Forecast integration (rany2) does; Predbat's existing knob is the static per-array monthly `shading_factors` applied in `gti_hourly_to_period_kwh()` (`solar_model.py`), which cannot express geometric blocking. *Suspected, not verified:* that integration's published attribute names could not be confirmed compatible with Predbat's HA-sensor PV path (`detailedForecast`/`forecast` with `pv_estimate` entries), so do not recommend pointing Predbat at its sensors as a workaround without checking the entity shape. **Band built from the wrong series with calibration off (GH#5345, fixed in PR #5347 \[v9.3.4\]: `pv_calibration()` now takes `calibrate_band` and builds the band on the P50 it is returned with — the switch-off path swaps both p50 and the band back to raw, and Open-Meteo keeps its own ensemble band instead of a synthesised `create_pv10` one; keep the pre-#5347 mechanism for older logs):** on a `create_pv10` source (Open-Meteo, Forecast.Solar) with `metric_pv_calibration_enable` off, `pv_calibration()` built `pv_forecast_minute10`/`90` and the published `pv_estimate10`/`90` from the **calibrated** series and only swapped P50 back to raw at its final `return`, so P10 could exceed P50 and P90 fall below it, and `get_cloud_factor`'s (ΣP50 − ΣP10) gap was arbitrary - reported as "the saw tooth has gone". Signature in `sensor._pv_today` `detailedForecast`: `pv_estimate10 / pv_estimateCL` and `pv_estimate90 / pv_estimateCL` constant in every slot while `pv_estimateCL / pv_estimate` varies. Dead end: it is not Open-Meteo's ensemble P10 being "confident" - at the time that download was fetched and then overwritten by `pv_calibration()`, because every Open-Meteo branch set `create_pv10`; the same change makes `fetch_pv_forecast()` keep an ensemble band (`create_pv10` False, `calibrate_band` True) and fall back to the history-based band only when the ensemble download fails. The band is the ensemble's P10 and P90 **as ratios of the ensemble's own median**, applied to the deterministic P50, not the ensemble's absolute values: the P50 comes from the best-match deterministic call and the spread from `icon_seamless`, two different model runs that can disagree on a whole day's level - live on 2 Oct 2026 the absolute ensemble P10 sat above the deterministic P50 for a day three ahead (clamped, leaving a 2% downside) and at 0.28 of it elsewhere. Known weakness of the ratio: the deterministic forecast is re-issued between ensemble runs and moved one site's next-day total from 1635 to 3887 Wh/m2 in ten minutes, above the ensemble's own P90, and P50 x (P90/median) then overshoots anything the sky can deliver - only the `1.2 x kWp` power ceiling bounds it, there is no clear-sky cap. So an implausibly high `pv_estimate90` on an Open-Meteo site maps here. Test trap from that work: the solar test mock returns the first response whose key is a substring of the URL, and `api.open-meteo.com` is a substring of `ensemble-api.open-meteo.com`, so a test registering both in that order silently serves the forecast body to the ensemble call and exercises the no-ensemble path. The in-function `enabled_calibration` flag means "enough history", not the user switch, so the fixed 0.7/1.3 band does not apply with the switch off. Routine SolarAPI Info lines are not in shipped logs; read the `pv_today`/`pv_forecast_h0` attributes instead. A source that publishes a 0-PV day is not a safe fallback either — the counter-argument to any "just publish 0" suggestion: a 0-yield day is a `pv_calibration()` down-day (actual < 10% of forecast) and ≤ 2 valid days switches calibration off entirely, leaving the raw forecast (GH#5388 context, code-read on main; `solcast.py`). The AC-coupled netting case (GH#5552 — see the solar-optimism symptom row below) is this shape with `pv_today` bound but reading 0 every day: every valid day is a down-day and the log line to look for is `SolarAPI: PV Calibration: Not enough valid (non-down) days for calibration`. **PV source precedence and the missing Solcast fallback (GH#5545, re-verified on main 2026-10-15):** `fetch_pv_forecast()` picks the source by one elif chain, in this order: Forecast.Solar with `forecast_solar_open_meteo_first` set (Open-Meteo primary, Forecast.Solar fallback) → Forecast.Solar (the only source with an in-tree fallback, `forecast_solar_open_meteo_backup`, and it triggers on *empty data* only, `solcast.py:1742`) → `open_meteo_forecast` (`solcast.py:1749`) → Solcast direct (`solcast.py:1756`) → HA sensors. So configuring `open_meteo_forecast` makes Open-Meteo the *only* PV plan source even with `solcast_host`/`solcast_api_key` also set - Solcast is never consulted; route any "I configured Solcast but Open-Meteo feeds my plan" report here before suspecting anything else. Solcast direct has **no fallback at all**: on any failed HTTP call (429 included) `cache_get_url()` returns the stale cached payload rather than None (`solcast.py:221`), so after any prior success `pv_forecast_data` is non-empty and an empty-data trigger like the Forecast.Solar backup can never fire for Solcast - the plan then ages indefinitely on stale cache (`solcast_poll_hours` gates the refetch cadence, not staleness), which means any Solcast backup has to key off staleness (`solcast_last_success_timestamp` is already tracked at `solcast.py:226`), not off empty data. Two source-label facts that go with it: `self.active_forecast_source` keeps the source that actually served the fetch (`solcast.py:1810`), while the 7-day calibration-settling warning in `log_source_change()` is issued for the *configured* source (`solcast.py:1811`) - a backup flapping would not retrigger that warning unless deliberately included. **Per-minute `dp2()` rounding on the calibration sums inflates the dull-day calibration — fixed on main by PR #5802 (eb919801, 2026-10-31): the per-day totals accumulate unrounded and only the logged/published ratio is rounded. Keep the mechanism for pre-#5802 logs.** (GH#5690, triaged 2026-10-22, re-verified by reading the accumulation loop at b37f25af before the fix): `pv_calibration()`'s per-day totals round **every per-minute accumulation** with `dp2()` (`days_forecast_total`/`days_forecast_total_scaled_slot`, solcast.py), so on a dull day (every `pv_value` < 0.01 kWh/min) both sums degenerate to `0.01 × count(minutes ≥ 0.005)` and `days_use_scaling = total_adjustment / scaling_applied` overshoots — measured 1.84× against a 0.92× adjustment, repro output matching the issue's numbers. Nothing downstream bounds it: the `PV_CALIBRATION_HIGHEST/LOWEST` clamps bound the adjustment terms, not their recomposed ratio, and the array ceiling binds only near the ceiling; log signature: day-0 scaling ≈ 1.0, later days inflated. Found by `git log -L` on the accumulation lines — the per-add `dp2()` arrived in a spelling-fix commit (`f27f40f5`, 2026-03-23), the sums were unrounded before it (`f774d2f9`); check cosmetic commits for numeric behaviour changes, `git log -L` finds these fast. No test covers a dull day (per-minute values below 0.01 kWh); `test_pv_calibration_power_conversion`/`test_pv_calibration_sparse_recent_history_no_crash` cover total≈1 and a no-crash case only. **A shape-agnostic property to test any calibration change against (from the PR #5802 investigation, 2026-10-27):** each future day's calibrated total must equal the raw day total × the day's `days_use_scaling` factor to ~1% — the per-slot adjustments exist precisely so that property holds whatever their shape, and the array ceiling is the only exception (it does not bind on dull days). It caught the dp2 bug both ways (dull bell inflated, flat day deflated), so unexpected per-day numbers in the `PV Calibration: Days forecast total ...` log line are worth checking against it first. Reusable harness: `calibrate()` (`tests/test_pv_calibration_clipping.py`) builds a synthetic week of history from kW-by-minute-of-day lambdas and runs the real `pv_calibration`, returning tomorrow's P50/PV10 and the total adjustment; `tests/test_pv_calibration_day_scaling.py` (#5802) imports it, so new calibration tests need no new fixture (`inverter_limit_kw=20.0` keeps the clipping exclusion out of the way). The general check out of the #5802 review (candidate verified by an `apps/`-wide grep, 2026-10-27): on a "small values misbehaving" report, grep for `dp2(`/`dp4(` wrapped around an accumulation loop before anything else — the fix is accumulate unrounded, round only the log line or final ratio; the remaining deliberate sites are `fetch.py`'s gap-fills in load history at `dp4` (0.0001 kWh = 0.1 W — not degenerate for realistic per-minute loads). | `solcast` | | HA write/verify (`ha.py`, `inverter.py`) | `get_state(refresh=True)` is a no-op in a normal HA add-on install: it only re-reads when `not self.ha_key`, and `ha_key` is set in that case, so verification reads the websocket cache, never a fresh value (`ha.py:798`, since PR #2342). Separately, `write_and_poll_value()` treats `domain == "sensor"` as Predbat-owned and POSTs `/api/states/` directly (`inverter.py:2155`, `ha.py:1071-1077`) instead of calling the integration. Probed empirically across all four write-path/domain combinations (GH#4738): a control entity that resolves to a `sensor.*` domain by mistake gets a direct state overwrite that reads back as success, with zero corresponding lines in the real integration's log. `call_service_wrapper()`'s return value used to be discarded at every `inverter.py` write site, so a rejected HA service call (e.g. a Modbus "Illegal Function" error) never reached the verify logic. That is no longer true everywhere: PR #4878 made `call_service_template()` (`inverter.py`) check it and log "was not accepted, it will be retried next cycle". The other eleven `call_service_wrapper()` call sites in that file still discard it, so check the specific write path before repeating the general claim. Later triage extended this row rather than replacing it. `write_and_poll_switch()` builds its service name as `domain + "/turn_..."` straight from the entity's own domain with no validation (`write_and_poll_switch()`, `inverter.py`), and `adjust_inverter_mode()` routes every `has_ge_eco_toggle` inverter through it - so an `inverter_mode` pointed at a `select.*` entity produces `select.turn_on`, an HA-invalid service retried 10x at 10s per attempt, and `switch_state()` maps any state but `on`/`enable`/`true` to False, so the force-export direction reports success having written nothing (GH#4909, still live — though on 3-phase GEC the real problem is one stage deeper: no eco register exists at all, and the write path is skipped with `No entity_id for ECO Toggle`; see the GE Cloud row). **The same select-blindness reaches every scheduled-enable write (GH#5637, triaged 2026-10-19):** `adjust_charge_window()`/`adjust_discharge_window()` write `scheduled_charge_enable`/`scheduled_discharge_enable` through `write_and_poll_switch()` too, so an integration exposing period enables as Enabled/Disabled selects — the 0xAHA Growatt ModbusTCP integration, reporter entity dump; the integration source was unreachable so exact option strings are unconfirmed — sends `select/turn_on`, the `Enabled` read-back never matches, and the write warns and re-issues every cycle; `switch_state()` treats only `on`/`enable`/`true` as enabled. Workaround: a template-switch go-between (`turn_on` → `select.select_option` with the option string). `inverter_type: SA` is a control shape (timed windows + enable switch + % SoC targets + mode-service flips, `config.py`) - not a statement that Solar Assistant is in play; a direct-Modbus Growatt keeps it (GH#5637). `adjust_force_export`/`adjust_charge_window` format their times at plan precision with no snapping (`TIME_FORMAT_HMS`, `inverter.py:2608`/`:2615`), so against an integration whose select only offers 15-minute options (Solar Assistant/Deye) Predbat writes e.g. `20:55` and `write_and_poll_option` retries the impossible value 10x every cycle; nothing anywhere reads a select's `options` attribute, and `charge_time_entity_is_option` only decides *how* an entity is written, never which values are legal. The fix precedent is already in tree - AlphaESS's `snap_time_grid()` (`alphaess_const.py:215`), snap start forward and end backward with a collapse check (GH#4947). A second, independent way plan-precision times fail on the same select path: `write_and_poll_option()` only strips the seconds from an 8-char `HH:MM:SS` write when the *previous* state is a healthy 5-char `HH:MM:SS` read — the read feeding it returns `None` for an entity missing from the state cache (`ha.py:817`) or the literal `"unknown"`/`"unavailable"` when degraded (`ha.py:815`), either skips the strip and the raw `HH:MM:SS` goes to `select_option`, which HA rejects; all 10 retries re-read and fail identically, and the log reads `didn't complete got unknown` (GH#5009, probe-verified on main). That degraded-read shape can also be **permanent**: an SA slot select can report `unknown` for days — every write read-back `unknown`, zero verified writes, across an SA rebuild and both native-API and MQTT transports — so both symptoms (read path `unable to read Export window - ... returned no data` every cycle via `time_string_to_stamp("unknown")` → `None`, and the write path above) fire continuously; state reporting varies by SA backend (GH#5214). **A user edit of `config.py`'s INVERTER_DEF `charge_time_format` to anything ≠ exactly `"HH:MM:SS"` is a masking workaround, not a fix (GH#5214):** the `!= "HH:MM:SS"` branch (`inverter.py`) swaps apps.yaml entities for Predbat's own `sensor.predbat_{type}_{id}_*` dummies — reads parse Predbat's own echo and writes become direct `set_state` POSTs that never reach the inverter — so the log goes quiet while window control is silently severed. **For the four time entities this is fixed on main since PR #4745 (merged 2026-10-08, post-v9.3.6 — issue GH#4738; an earlier version of this row cited the PR as "#4738", which is the issue number):** `user_configured_entity()` (`inverter.py`) prefers a genuinely-wired real entity over the dummy in that branch — every other arg (`reserve`, `charge_limit`, rates) still has no such escape hatch (GH#5446). Tells, all observed in #5214's attachments: a `Creating dummy entity sensor.predbat_{TYPE}_{id}_charge_start_time` line in the log (`create_entity()` only logs when the entity is missing from HA state, so its presence proves the ≠ branch ran); the debug yaml's live `args` naming dummy ids while `args_from_apps_yaml` still lists the real `select.*` entities; and warnings stopping after a user restart then resuming after an addon update (which overwrites the edited `config.py`, wiping it). Also: pre-#3533 SA shipped `charge_time_format: "S"` (dummy time entities, no SA select wiring), so "SA time warnings started after updating" can mean the user crossed the #3533 template wiring rather than a format regression. The fix that serves both is reading the select's `options` attribute — nothing in the codebase does today. Six of the eight `adjust_*` writers discard the write helper's boolean and fire `call_notify()`/`mqtt_message()` regardless, and `rest_setReserve()` has the same gap (GH#4845). `call_service_template()` used to record its dedup hash *before* the call, so a silently failed `select_option` was skipped as "previously called" on every later cycle; fixed (it now records only on success and drops the record on failure), though it still deliberately returns True so callers cannot downgrade a freeze into a stop (GH#4876). From that same report, a false-alarm class worth recognising: a `didn't complete got X` where X is exactly the *previous* cycle's target, on an integration that republishes its entities slowly, is the verify window reading HA's cache - the write had already landed by the next cycle. That window is arithmetic, not a constant: up to `INVERTER_MAX_RETRY` (10) writes, each polled through one `inv_write_and_poll_sleep` budget with a doubling read interval - **~40s on GS, ~100s on GE/GEC/GEE** (`write_and_poll_sleep` is 10 for those types, 4 for GS). **Per-type since PR #5297 (merged 2026-09-29):** `INVERTER_DEF[type]["write_max_retry"]`/`["write_backoff"]` (consumed by `_write_attempts()`/`_write_backoff_result()`), and currently only `GWMQTT` deviates - 3 attempts, 10s apart - plus a per-control degraded state for those types: a write of the *same* target failing `INVERTER_WRITE_BACKOFF_FAILURES` (2) times in a row drops to one attempt per `INVERTER_WRITE_DEGRADED_INTERVAL` (300s) until a write verifies, the read-back matches or a different target arrives (full ladder restored at once); a degraded control still reads back, logs and records the failure every call - nothing is skipped silently. Every other type keeps 10 attempts and its existing sleep. A settling bounce that outlasts it is a second false-alarm shape (GH#5130): a HA `number.*` entity can step through intermediates (0 → a float → the settled int) for tens of seconds after a timed-slot write (~44s observed on solax_modbus), so a `didn't complete got ` whose value sits *between* the old and target values is a settling read-back, not a failed write - it self-heals next cycle when the initial read matches. The bounce reads feed only `value_matched()` (keep polling vs rewrite) and only the final read reaches the control ledger (`record_write` on match, `clear` on failure), so the worst case is a redundant same-value rewrite plus the false warning; the in-repo precedent for re-reading after settling is Solis Cloud's `verify_settle_seconds` re-read. And the discharge-stop fallback (GH#5094, still live): `adjust_charge_immediate()` issues a "stop discharge" service step before the charge/freeze step, and when `discharge_stop_service` is not configured it falls back to `charge_stop_service` with `domain="discharge"` - a documented fallback dating to #1614. On Tesla service-hook setups `charge_stop_service` maps to `self_consumption` + backup reserve 0, which on a Powerwall is **active discharge to load** (the EV charger counts as load), not a stop - so every freeze/hold cycle Predbat sends "discharge normally" and then re-commands "hold" ~2s later, and Tesla occasionally applies the first and drops the second, so the battery discharges into the car until the next 5-minute cycle. Verified from the reporter's log: the exact pair fires from the carHolding branch ("Disabling battery discharge whilst car 0 is charging" → `adjust_charge_immediate(soc_percent, freeze=True)`); the reporter had commented out `discharge_stop_service` (and `discharge_start_service`) when disabling export control, which is what exposed the fallback. Workaround: define `discharge_stop_service` in apps.yaml with commands that actually stop discharge (for a no-export setup, the same commands as `charge_freeze_service`). Caveat on the reporter's own `repeat: False` idea: enabling the service dedup means accepted calls are not re-sent (see the GH#4876 entry above - HA accepts the call but Tesla firmware can still drop it), so dropped freeze commands would never be retried. Both this and the fixed export clobber below stem from the same property of the Tesla template set: `charge_stop_service` and the freeze/discharge templates all write the same `operation_mode` select, and the templates mean opposite things on this hardware. **A sibling of the same family, over the reserve register rather than the mode selects (GH#5300, triaged 2026-09-29 against d951201e, reporter on a hand-built apps.yaml):** inside one 5-minute pass the hook charge (`adjust_charge_immediate()` issues `charge_freeze_service`/`charge_start_service` via `call_service_template`, inverter.py) and `execute.py`'s reserve reset (`if self.set_reserve_enable and resetReserve: inverter.adjust_reserve(0)`) both touch the Powerwall's reserve and the reset has **no isCharging guard** - `resetReserve` initialises True whenever `set_charge_window or set_export_window` and is cleared only by the freeze / hold-charging / car / iBoost hold branches - while `adjust_reserve()` floors at `reserve_percent` and writes through `write_and_poll_value()`, so the reset always ends up holding the register, against hook writes that are fire-and-forget. A service hook that uses the reserve register as its charge signal loses that race on every charge-window cycle. The shipped template is immune by two mechanisms, both worth checking before triaging any "Tesla reserve overwritten" report: `templates/tesla_powerwall.yaml` sets `has_reserve_soc: False` in the `inverter:` block (`fetch_inverter_data()` then force-disables `set_reserve_enable`/`set_reserve_hold`, logging `Note: Inverter does not support reserve - disabling reserve functions`), and with no `reserve:` arg wired Predbat dummies the arg (`create_missing_arg`/`create_entity`, inverter.py) so `adjust_reserve` writes land on a Predbat placeholder - the Sigenergy dummy-arg shape again. Discriminator for real-vs-dummy reserve wiring: the `Inverter N Current Reserve is X% ... and new target is Y%` and `Wrote X to reserve, successfully now Y` lines name the register, not the entity - a non-zero current read means the `reserve:` arg resolves to a real wired entity; a dummy reads 0 and at an equal target prints `already at target` instead. Dump-config tells from the same report: a `set_reserve_enable` switch showing `value: null` in a debug dump can still resolve True (expert-mode-switched item, hidden and entity not created while expert mode is off), and unknown keys in the dump's `args:` mean a hand-built config - do not assume the shipped template. **Flag-vs-wiring contradiction, and writes that echo themselves (GH#5446, dump-verified, Powerwall 2 on service hooks, 2026-10-08):** when a capability flag is set `false` in the `inverter:` block, Predbat discards the apps.yaml wiring for that arg and substitutes its own placeholder — the dummy-creation block (`create_missing_arg` + `create_entity`, `inverter.py`) overwrites the arg's `[self.id]` slot even though apps.yaml wired a real entity, and the placeholder-creation branch runs whenever `inv_output_charge_control != "power"`; only the four time entities check `user_configured_entity()` first. The in-tree TESLA def ships `has_target_soc`/`has_reserve_soc` true, so this shape is a user `inverter:` block overriding them — the very flags that would let Predbat write the user's wired entity are what silenced it; the config fix is re-enabling the flags (extending the escape hatch is a code candidate, unconfirmed as desired). Forensic tie-back: a `Wrote X to , successfully` line on a `sensor.*` placeholder is `write_and_poll_value()` POSTing `/api/states/` and reading back its own echo — check the dump's live `args` (placeholder ids) vs `args_from_apps_yaml` (real ids), then the `control_ledger`'s `owned_value`/`confirmed_at` ties the quoted log line to the placeholder, and any reporter theory about the hardware "interpreting" that register cannot act through the write at all. **Charging-target overshoot on service-controlled charging now holds instead of resuming discharging (PR #5541, v9.4.1):** with `inv_has_target_soc` False, when the charge target sits below the current SoC (BMS taper past the target mid-window) `adjust_charge_immediate()` used to send `charge_stop_service` — releasing charging back to house supply — and since #5541 it tries `charge_freeze_service` first and falls back to `charge_stop_service` only when no freeze service is configured. Version any "battery goes back to discharging after reaching its charge target" report on service hooks against this. **And since PR #5563 (v9.4.1) there is an in-tree detector for this row's whole class:** `self.control_monitor` (`control_monitor.py`) records charge/export/freeze commands the battery does not follow (Prometheus `control_failures_24h`/`_total`/events plus a web-dashboard slice), so a "battery is not following commands" report can first be read straight off `control_failures_24h`/`newest_events` before reconstructing write-vs-inverter behaviour from `write_and_poll` warnings alone; the same events publish to HA as `predbat.control_failures` (`publish_control_failures()`, `predbat.py`) — 24-hour count as the sensor state, lifetime total in `control_failures_total`, newest 20 events as attributes carrying epoch `slot_start`/`slot_end` (convert with the reporter's UTC offset) plus the requested/measured watts — which makes it the first read too on any "X didn't charge/hold" report, and 24h-state small against a large lifetime total is the chronicity tell (GH#5748: state 1 with `control_failures_total` 29 turned out chronic, not a one-off). | `inverter` | | GE Cloud (`gecloud.py`) | Gateway fields can come back null. `merge_non_null` stops nulls overwriting good values, and the publish path guards null containers — GH#4656 was a null crash in that area. `number_event` clamps an out-of-range write silently and does not report the clamped value back, while `write_and_poll_value()` keeps comparing against the original pre-clamp target - a permanent false `had_errors` and an unbounded retry (GH#4826). PR #4828 clamped inside `adjust_reserve()` only; the shared write helper still has no min/max awareness and the other `inverter.py` write sites still pass unclamped targets (GH#4831). The error-code path has since been reworked (`9560c61a`, `d6e5998c`) after GH#4896 showed `success: false` nulled `data` before the code branch could read it, so codes GivEnergy documents as never succeeding on a repeat (-3/-4/-7) were retried the full budget and `message` was never surfaced. Separately, **fixed in PR #4954 (merged 2026-09-06)** - keep the mechanism for anyone holding an older log: for `GE`/`GEC`/`GEE` the max battery rate was taken solely from the `charge_rate` entity's `max` attribute, and the `elif "battery_rate_max"` branch below it was unreachable for those types. Percentage-rated models (the 3-phase units) have no absolute charge power register, so `ge_cloud_automatic` left `charge_rate` unset and the attribute read returned the 2600 W default; both the correct rate GECloud writes into `battery_rate_max` and the user's own apps.yaml value went unread, and every rate was clamped to 2600 W. On those models it also corrupted the writes, since the percentage registers are set as `new_rate / battery_rate_max_raw * 100` against a denominator 3.8x too small. The fix falls back to `battery_rate_max` only when `charge_rate` resolves to nothing (GH#4908). GH#4198 is the same code shape on SolaX and is not covered by that fix. A model-string parser gap sits above that path (GH#5136): **the integer-rating half was fixed in PR #5293 (merged 2026-09-30, v9.3.3)** — `get_max_inverter_rate_from_model()` now parses an integer segment straight after the `3HY` token (`GIV-3HY-11` → 11 kW) *before* the decimal pass, so a later decimal segment cannot hide it; it also guards a null model, strips trailing punctuation (`GIV-HY-8.0-G3-HV.`) and warns readably on an unparseable rating ("using max charge rate instead - set inverter_limit in apps.yaml"); keep the pre-#5293 signature (decimal-only match, so an integer-rated `GIV-3HY-11` fell back to `max_charge_rate` — which the GE Cloud API can change independently, 11000 → 9984 W observed). **Still live:** `publish_info()` reads only `max_charge_rate`, never the `max_discharge_rate` in the same payload, and `battery_rate_max` is bound to the `_max_charge_rate` entity — a model whose discharge rating differs keeps the wrong rate. Distinct from GH#4908 (the absent-`charge_rate` 2600 W default). Start on any "GEC inverter rate is wrong" report by checking the model string for a decimal point; the tests now cover the integer-3HY cases too. `automatic_config()` binds `inverter_limit` to the resulting `_max_inverter_rate` sensors and `prediction.py` clips PV against `inverter_limit`, so the error reaches the plan. **Mixed fleets: the rate read/write gates test key existence, not per-slot state (GH#5359, probe-verified on main b161949d via `tools/triage_test.sh`):** `get_current_charge_rate()`/`get_current_discharge_rate()` (`inverter.py`, the `"charge_rate_percent" in self.base.args` branch) and `adjust_charge_rate()`/`adjust_discharge_rate()` (which write **both** keys, each gated only on key existence) interrogate whether the key exists **anywhere in the fleet's args**, not whether *this* inverter's slot is set — and `get_arg()` on a `None` slot applies the caller's default quietly (`userinterface.py`, float branch) — so in a fleet mixing GEC percent-controlled units (3-phase `GIV-3HY` has no `battery_charge_power` watts register; `automatic_config()` then sets `charge_rate_percent` and `build_entities()` leaves per-device `None` slots, deleting `charge_rate` when no device has the register) with watts-controlled units, a percent slot that is `None` reads quietly as 100% → `battery_rate_max_raw`, and every rate write for the power-mode sibling lands on a missing entity (`Warn: ... No entity_id for charge_rate to write ...` + `record_status(had_errors=True)`, so "Read-Only with Errors" too). The low-power rate search, which steps down relative to the read-back, then restarts from the maximum every cycle and never converges — #3311's fault extended to mixed fleets (the single-inverter shape is in the low-power symptom row). **Addressed with the GH#5082 fix:** `Inverter.rate_controls()` now asks this inverter's own entry which control it is bound to (falling back to key existence only when it is bound to neither or both), and GE Cloud auto-config binds `charge_rate_percent`/`discharge_rate_percent` per device - the percentage for a device with no power register, `None` for one that has it - instead of withholding them for the whole fleet when any sibling had a power register; keep the description above for pre-fix logs. PR #4645 (closed, for #3311) created its per-slot rate dummies but did not touch these four gates — the #4908 battery-sizing read (`get_arg("charge_rate", indirect=False, index=self.id)` before falling back, inverter.py:583) is the per-entry pattern the gates lack. One API-shape trap on the site endpoint (`GE_API_SITE`, `site/{uuid}`, added for PR #4978): the published OpenAPI spec types `limits.import`/`limits.export` as a string with a null example and never shows a populated one, so the shape had to be learned from live accounts. A populated limit is `{'enabled': bool, 'power': {'watts': int, 'amps': float}}`, and **`enabled` is the thing that matters** - a site describes its connection's declared capacity in exactly the same structure as a curtailment, marked disabled, so `power.watts` alone tells you nothing about whether anything is being restricted. Site 64744 gave `{'import': {'enabled': False, 'power': {'watts': 46000, 'amps': 200}}, 'export': {'enabled': True, 'power': {'watts': 4500, 'amps': 19.6}}}` - a 200A supply whose export really is curtailed to 4.5kW - while site 46714's disabled 6kW export is its declared capacity and no restriction at all. A fleet survey confirmed the flag across accounts, so only an enabled limit is applied; an enabled zero is a real zero-export connection. A site with no limit reports a null import/export. For a fleet survey use `GET /v1/site`, the list endpoint, which returns every site's `limits` and the inverters under it (with `info.max_discharge_rate`) in one response - no second call per site. Two GEC triage tools and one clobber trap (GH#5017). The component publishes an entity for every `/settings` entry with no name filter (`async_get_inverter_settings()`/`publish_registers()`, `regname_to_ha()` is plain lowercasing), so **absence of an entity in the reporter's debug yaml is proof the API never listed the register** — "the app can control it" does not imply the settings API exposes it, because the app/GivTCP write via local control paths rather than the `/settings` list (a GIV-3HY-20 had slot 1/2 lower-SoC registers absent while 3..10 existed). Caveat: the settings list is fetched once per process start (`register_list` cache) and only the parsed flags are logged, so the debug yaml is the only observable. To capture the raw register list, `python3 apps/predbat/gecloud.py --api-key --write-entity number.probe_nothing 0` makes `test_gecloud_direct()` print the full "Available entities/registers" list with raw cloud names and setting IDs and performs no write — but the harness's startup pass also runs `enable_default_options()` against the real inverter (floors reset, unused windows zeroed), so say so when asking a user to run it. Clobber trap: the missing-feature branch `set_arg("discharge_target_soc", None)` *deletes* the key, including an explicit apps.yaml entry the user wrote; `set_arg_auto(..., overwrite=False)` (component_base.py) is the in-repo pattern for letting an explicit value win — check the `has_*` detection branch on any "automatic config deleted my setting" report. The `inverter_mode` half of this class was fixed in PR #5059 (`885c637d`) — it now binds via `set_arg_auto(..., overwrite=False)` like `export_limit` — but the other missing-feature deletes are still plain `set_arg(..., None)` on main: `pause_mode`, `pause_start_time`, `pause_end_time`, `discharge_target_soc`, `charge_rate_percent`, `discharge_rate_percent`, `givtcp_rest`. A companion test-fidelity trap (GH#5056, verified on main): the component test mocks (`MockBase.set_arg` in `test_ge_cloud.py`; same shape in `test_ohme.py` and `test_alphaess_api.py`, whose mock `set_arg_auto` also writes unconditionally) store the value instead of mirroring the real `set_arg()`'s None-deletes, and their `args_from_apps_yaml` is empty so `set_arg_auto()` falls through to the plain path — so the "feature not detected" assertions (`config_args.get(...) is None`) pass identically whether the code stored None or deleted the key, and a green suite cannot distinguish fixed from unfixed. Any test for this class must populate `args_from_apps_yaml` and assert the manual value survives — #5059's Test 10 in `test_ge_cloud.py` is now the in-repo precedent. And the deeper half of GH#4909 (still live): the 3-phase GEC class exposes **no** eco/demand/mode register in `inverter/{sn}/settings` — verified by enumerating the `predbat_gecloud_*` entities in the reporter's debug dump — yet the `GEC` def sets `has_ge_eco_toggle: True` unconditionally (`config.py`) and auto-config maps `inverter_mode` via `build_entities("switch", ["enable_eco_mode"])` (gecloud.py), which emits nothing when the register is missing, so `adjust_inverter_mode()` logs `No entity_id for ECO Toggle` and returns without writing every plan cycle and freeze export silently no-ops (force-discharge paths work fine). Fix wrinkle for the maintainer: the flag is one per-inverter-type bool while `build_entities` works per-device. The freeze-export half of the same class (GH#5082, follow-up to GH#4909, code-verified on main): `inv_has_timed_pause` is probed at runtime (inverter.py flips it False when the `pause_mode` entity is absent/unavailable) but `inv_support_discharge_freeze` is read only from the static `INVERTER_DEF` entry (`config.py` sets it True for GEC), so `execute.py` never force-disables `set_export_freeze` for the eco-less/pause-less 3-phase class and a freeze-export plan can never be executed. Check both flags on any "freeze silently didn't work on GEC" report - and do not grep only for `No entity_id for ECO Toggle`: that warning comes from the eco branch, while freeze export on this class fails primarily through the pause/rate branch, so the eco warning being absent says nothing about the freeze path. Fix direction: mirror the `inv_has_timed_pause` presence-probe; the manual-freeze-export override path already degrades correctly when `set_export_freeze` is False (plan.py drops to demand). **The GH#5082 fix takes that shape through an entity attribute rather than the type row:** the component marks the charge rate entity `grid_charge_only` (GE Cloud on the percentage charge rate when the device lists neither `pause_battery` nor `battery_charge_power`; the hub on `number._charge_rate` when `inv.model` contains `3ph` - firmware names `Hybrid 3ph`/`AC 3ph`, and the hub carries a zero rate as Battery Pause only on models that have it, writing the 3-phase percentage limit HR1110 floored at 1% otherwise), `Inverter.refresh_config()` clears `inv_support_discharge_freeze` on the mark, and `fetch_inverter_data()` now turns `set_export_freeze` off when *any* inverter lacks it rather than only the first. So on a "freeze planned but battery charged" report from this class, check the attribute is present on the rate entity first - hub firmware that reports no model is not detected. The hub half is inferred from the firmware, not observed on a 3-phase unit. `set_freeze_export_during_demand` still takes the same no-op write on this class and still appends `[Freeze exporting]`. Hardware-reported on the GIV-3HY class: `charge_power_rate` limits AC (grid) charging only - `battery_power` stays at the full discharge figure while the charge register reads 1% - so the `adjust_charge_rate(0)` fallback in the freeze branch is a no-op for PV charging there; note `charge_discharge_with_rate` is False for GEC, so the first `adjust_charge_rate(0)` in each branch is skipped and the write only happens via the `has_timed_pause`-else fallback. Fix precedent for building a freeze from registers the device actually has: `inv_support_feedin_first` + Fox Cloud freeze export (PR #5038); the GIV-3HY exposes `enable_force_discharge` + `discharge_down_to_percent` + `battery_reserve_percent`, the raw material for the #4909/#5082 option-2 freeze. And since #5056 a manual `inverter_mode` apps.yaml override is silently deleted by automatic config, so "just map the eco toggle manually" is not currently viable either. The neighbouring **charge-side** gap (GH#5040: `scheduled_charge_enable` had no `enable_force_charge` candidate, so a 3-phase GEC that gates timed grid charge behind both charge switches logged real charge states while importing nothing) is **fixed in PR #5042** (`a7121135`, v9.0.2): auto-config now binds `scheduled_charge_enable` to `enable_force_charge` with `ac_charge_enable`/`enable_ac_charge` as fallbacks, and `enable_default_options()` holds `enable_ac_charge` on as a static enable when the force register exists. Keep the mechanism for pre-v9.0.2 logs, where the signature is a 3-phase GEC showing plan charge states against flat grid power with no warning anywhere. The #5042 gate itself had a second gap (**GH#5269, fixed in PR #5270, merged 2026-09-27** — keep the pre-#5270 signature): `enable_ac_charge` was written in exactly one place, `enable_default_options()` — first cycle after start-up, then once per 24h (`default_options_stamp`) — while Predbat's own `scheduled_charge_enable` write (`switch_event()`) checked nothing about the gate, so any external writer (an Axle VPP clean-up, the GE app, another integration) could clear `enable_ac_charge` and Predbat re-asserted it only on that 24h pass or a restart; "restarted and it worked" is part of the pre-fix signature, as is `enable_force_charge` on with `Charging target …%` for hours, SoC flat and no error. #5270 re-asserts the gate from `switch_event()` when a force-charge write succeeds (`ensure_ac_charge_gate`, with Axle's clean-up read as read-only for the 24h pass and a binding guard), so the "gate cleared between cache refreshes" residual window is the remaining maintainer call on that fix. So "3-phase GEC plans a charge, status says Charging, battery imports nothing" now has **two** signatures: pre-v9.0.2 = never bound (#5040), v9.0.2+ pre-#5270 = externally cleared and not re-asserted (#5269); on a post-#5270 system check whether the force switch Predbat drove is actually the `enable_force_charge` register. GE Cloud EMS plants (GH#5103, **fixed in PR #5109, merged 2026-09-24** — keep the mechanism for pre-#5109 logs): with an EMS discovered `polling_mode` is set False (`gecloud.py`), and the settings refresh used to re-read each battery inverter's `/settings` only on the first tick of the process — so the AC3 registers, including the DC-discharge slot windows, were read once and published stale for the rest of the run, while live status/meter polling kept looking normal. #5109 re-reads settings hourly (`SETTINGS_SLOW_REFRESH_SECONDS`, `gecloud.py`), refreshes the EMS and gateway devices every cycle, and runs `check_ems_inverter_slots()` on every snapshot — which now *warns* when a battery inverter's slot 1 is not the full-day window (the #3781 rule: `Inverter X slot 1 is not 00:00-23:59 ... it will override the EMS and can stop charging or discharging early`), once per episode — recorded in `ems_slot_warned` so a standing misconfiguration does not inflate the error counter on every refresh, so the non-00:00–23:59 slot 1 fault is a visible warning on current main and silent only pre-#5109 (pre-fix signature: plan/status look right but the batteries hold 0 W past a fixed wall-clock time every night). Under EMS auto-config Predbat still writes mode/schedule-enable/rates to the AC3s. Nuance: the startup read itself can still be skipped when the storage settings cache is under 10 minutes old (`settings_from_cache`), so even a restart is not guaranteed to re-snapshot the registers. **The option-validation parser used to crash-loop the whole component (GH#5217, fixed in PR #5218, merged 2026-09-26 — keep the signature for pre-#5218 logs):** `select_event()` and `publish_registers()` both `split("(")` a cloud `Value must be one of: (...)` string, so an option label containing `(` raised `ValueError: too many values to unpack (expected 2)` — the component does not die (`ComponentBase.start()` catches it), it *crash-loops*: `api_started` never set, automatic config never runs, no plan, `Error: GECloudDirect: too many values to unpack (expected 2)` every cycle. #5218 added the module-level `parse_validation_options()` (`gecloud.py`): split on the first `(` and strip only the final `)` (so inner brackets in labels survive), and `None` for a string with no `(` triggers a warning and falls back to the setting's `in:` validation-rule options instead of raising — the paren-less guard is required, not optional, because `split("(", 1)` alone fails the other direction. Which GE Cloud setting actually returns a multi-`(` validation string was never captured (the storage cache saved at the settings write would be the fixture to ask for). **`refresh_discovery()` is not device re-discovery, and GE Cloud re-discovers hourly since PR #5295 (GH#5294, merged 2026-09-29 - the symbols below were read against the pre-fix tree):** `ComponentBase.refresh_discovery()` only rebuilds the capability-catalogue *report* from data already in hand (a component opts in via `build_discovery()`) and never calls the component's API - the *similarly named* `refresh_devices()` is the thing that calls it. Pre-#5295 that device discovery (`async_get_devices()`, EV chargers, EMS/gateway selection, one-shot automatic config) ran exactly once inside `if first:` and `first` flips off permanently after the first successful run, so on any "GE Cloud didn't pick up my new inverter/charger" or "removed inverter still shows data" report a restart was the only mechanism - and a removed device kept its last good SoC/power feeding the plan (`merge_non_null()` hands back the previous reading on nulls and failed polls) and kept having registers written to. **Post-#5295:** `refresh_devices()` re-reads the device list hourly (`DEVICE_REFRESH_SECONDS`, 60*60, `gecloud.py`; a multiple of 60 because `run()` is called once a minute, and a cycle that finds a change polls and reads settings whatever else is due), `select_poll_devices()`/`apply_devices()` decide what is polled from the fresh list, and adopting a changed set drops every per-device store - `status`, `meter`, `info`, `settings`, `pending_writes`, `register_list`, the EV-charger stores, `ems_slot_warned` and `register_entity_map` - so a removed device stops publishing and being written to. The review round also: the change signature includes `battery_meters`, so a CT rewiring re-runs automatic config; a failed register-list fetch is retried on the next settings read (previously stored as `None` and never fetched again - every later read raised `TypeError`, newly reachable from rediscovery); a device read that would leave zero battery inverters is not adopted (the warning says restart if the hardware really was removed; charger-only sites stay quiet); `ge_cloud_data` returns to its pre-EMS value when the EMS leaves; the EMS slot-override warning re-arms when the EMS changes; and default options for a device discovered while read-only is set stay pending across cycles, applied once read-only ends. Caveats that survive the fix: the 5-day `last_updated` skip inside `async_get_devices()` treats a device silent over 5 days as non-functional wherever that runs - the hourly re-read included - and `merge_non_null()` still hands a *polled* device its last good SoC/power on nulls and failed polls. In-tree fix precedents (GE Cloud itself now among them): Fox re-fetches its device list every 24h (`FOX_REFRESH_STATIC`), SolaX gates plant/device-info re-reads with `data_is_due`, and `num_inverters` is re-read by the core every cycle so a re-run automatic config takes effect next plan. **The "disable" writes on the unused numbered slots leave them live (GH#5371, reporter field log from a GIV-3HY-11 Beta site, code-verified on main):** `enable_default_options()` - run at startup, once per 24h and on newly-found devices, gated only by `read_only_now()` so manual-config GEC sites get the resets too - writes every unused AC-charge and DC-discharge slot 2-10's **times** to `00:00` "to disable" (`gecloud.py`, the numbered-slot branch of the limit/time resets), and on 3-phase GIV-3HY hardware `00:00-00:00` is **live** 00:00:00-00:00:59 (minute bounds), so every "disabled" unused slot is live for one minute past midnight; with force charge on at that minute (a planned charge window spanning midnight, or the v9.1.0 stuck-on case) the unused slots fire at full rate toward their 100% upper limit (discharge mirror: full rate toward the 4% lower floor). The same pass overwrites user-set spare-slot times (the 03:00 workaround) once per pass, per the reporter's inverter-settings history log. Fix direction (maintainer's call): have the **limits** carry the disable instead (unused slots' upper→4%/reserve floor, lower→100%); the constraint is that the two generic limit branches (`*_lower_soc_percent_limit`→4%, `_upper_soc_percent_limit`/`ac_charge_upper_percent_limit`→100%) also match the numbered slots and would write straight back on the next pass, so the fix must special-case slots 2-10 inside those branches - and #5017's outcome could later drive exports through slot 3 on GIV-3HY, so the "unused" set needs a guard there. `test_ge_cloud.py`'s 00:00-reset tests stay valid under this; the fix needs numbered-slot limit assertions added. **Two separate retry layers, and the generic wrapper never retries a device code (GH#5777, read + unit test, 2026-10-27):** `async_get_inverter_data()` treats a 200 whose body carries a retryable device code (`-1`/`-2`/`-5`/`-6`, `GE_SETTING_RETRY_CODES`) as data and **returns the body**, so `async_get_inverter_data_retry()`'s `range(RETRIES)` loop only re-runs on `None` (connection error, 429, 5xx) — a retryable device code breaks after one attempt without ever logging `Failed to get data from ...`; terminal codes raise `GECloudTerminalError` (logged by the wrapper as "not retrying"). The per-code retry with request-spreading jitter for settings lives in the setting read/write functions' own `range(RETRIES)` loops (they treat `data_value in GE_SETTING_RETRY_CODES` as the retry), whose exhaustion lines are `Device Failed to read inverter setting id ...` — so absence of that line means every failing read recovered on a retry, and a failed read keeps the device's previous value, so control is unaffected either way. Burst tell: with an EMS discovered the EMS device's entire readable settings list is POST-read on **every** settings block (`device == self.ems_device` in the settings-walk gate) with `MAX_THREADS = 2` and up to 10 jittered retries per read, while battery inverters join the full poll only hourly (`SETTINGS_SLOW_REFRESH_SECONDS`) — so bursts of 4-5 `code -1` warns within seconds are the device timing out *server-side* (GivEnergy's `-1` = its forwarded read timed out waiting for the device — the user's local wifi is not the variable; real rate limiting arrives as HTTP 429), and reads of a setting just written short-circuit on `pending_writes`. Pre-#5800 logs print the endpoint **template** with literal `{inverter_serial_number}`/`{setting_id}` braces — Predbat's own unformatted output (the defect fixed in PR #5800, merged 2026-10-27, which now names device and setting), not reporter redaction. Triage-test trap: a test that pushes a `-1` body through `async_get_inverter_data_retry()` expecting a `Failed to get data` line will fail — use a 500 response to exercise the wrapper's retry path. | `ge_cloud` | | Teslemetry / Powerwall (`teslemetry.py`) | Battery model is inferred from site `nameplate_power / battery_count`. A nameplate fallback combined with `inverter_hybrid: True` once produced a false 5 kW inverter limit and spurious morning export. Tariff writes push a whole TOU schedule every cycle, so a setting changed by hand in the Tesla app is reverted on the next cycle (GH#4600, GH#4610). Three later findings. `build_tariff()`/`_render_side` carve a *single* ON_PEAK interval priced with one scalar (`teslemetry.py:1117`/`:1036`/`:1074`), so no intra-window price gradient can exist and Tesla's own TBC is free to defer the whole export to the end of the window; the no-rate-data fallback branch also skips the boost entirely (GH#4887). The charge path sends no rate at all - `evaluate_schedule` (`teslemetry.py:539`) asserts mode `backup` plus reserve = charge target plus grid charging - so a slow charge ramp is Tesla firmware, not a Predbat write bug (GH#4892); Tesla now snaps a backup reserve of 81-99% down to 80% while Predbat still forwards any 0-100 target. The site_info limit mapping was reworked in PR #5276 (GH#5275, merged 2026-09-28): `inverter_limit` comes from `nameplate_power` (the Powerwall's own AC rating; `max_site_meter_power_ac` is the site's supply limit at the meter, not the inverter's), `export_limit` from `min_site_meter_power_ac` (kW, possibly fractional, with the ±1e9 "no limit" sentinel skipped and 0 published as a real 0 W limit), `inverter_limit_charge` at **5 kW per battery unit** capped at nameplate (Tesla reports no usable charge rating — a Powerwall 3 lists only expansion packs with every rating zero, and fleet data fits the rule), `soc_max` from the gateway's `nameplate_energy_watts` before the `battery_count` estimate, and `inverter_hybrid` now defaults from the Powerwall model (Powerwall 3 on, every other model off) with a `teslemetry_hybrid` override for a PW3 beside an existing string inverter. All of those are wired with `set_arg_auto(overwrite=False)`, so **an apps.yaml value wins** — on a pre-#5276 version `automatic_config()` overwrote a manually set `battery_rate_max` whenever `teslemetry_automatic` was on, which was the standing "my override does nothing" answer on this component. Since PR #4976 there is a Predbat-side lever for exactly that slow ramp: `teslemetry_tbc_control` — **on by default since PR #5188** (GH#5186; `DEFAULT_TBC_CONTROL = True` in `teslemetry.py`, mirrored in `COMPONENT_LIST`, with `teslemetry_tbc_control: False` as the opt-out) — switches `evaluate_schedule()` to `evaluate_schedule_tbc()`, which pushes a **signal tariff** (`build_signal_tariff()` - fixed 0/50/100p bands over the committed charge and export windows) so Tesla's own optimiser runs the charge and reaches the full rate reserve-driven charging cannot; mode goes to `autonomous` in every state, reserve becomes an actual reserve rather than a charge signal, and `_settable_reserve()` maps requests onto reserves the Powerwall honours - an 81-99% request now rounds **up** to 100 rather than being forwarded raw into the snap-to-80 band. The same PR stopped `plan.py` planning a manual freeze export on inverters that cannot do it. **Consequences of the default flip:** a Teslemetry user who never set the key is on the signal tariff with autonomous mode, so "the Tesla app shows 0p/50p/100p instead of my rates" or "my charge target isn't honoured" is the default path working, not a bug; and the 81-99% `set_reserve_min` limitation becomes default-on behaviour with it. (`MockTeslemetryAPI` still defaults `tbc_control = False` on purpose, so a green teslemetry test run exercises the real-rate path unless a test opts in.) And a separate scoping fact from the GH#5186 triage: `teslemetry_automatic` gates only `automatic_config()` — the scheduler emulator (`sync_tariff()` + `assert_device_state(evaluate_schedule(...))`) runs for every non-read-only user with no `automatic` check, so "Predbat changed my Tesla tariff/mode but I never turned on automatic" is that scoping, not a bug; `set_read_only` is the only switch that stops the writes. A related pricing bug in the same `build_tariff()` family was fixed in PR #4977: an export window ending at midnight priced the whole of tomorrow at peak. And `optimization_strategy: "economics"` *is* pushed with `tariff_content_v2` on every `set_tariff()`, unconditionally, since v8.49.0 / PR #4603 - a request to "add" it is asking for something already shipped (GH#4918). **GH#5157** (reporter's evidence, not independently probed — Powerwall 2, fw 26.26.4): the unit sat in the idle branch of `evaluate_schedule` and simply stopped acting on a standing device tuple for ~4h while `site_info` read back the *correct* configuration — drift invisible to every field the API exposes, with only a Predbat restart recovering it; the stall state is the one branch Predbat legitimately holds for hours, which is why transition-based self-heal never fires. A "Powerwall plateaued / stopped discharging until I restarted Predbat" report maps here first. **Implemented on main** (2026-09-19): `run()` re-asserts the whole device tuple — export rule, grid charging, reserve, mode, not the tariff — every `FORCED_ASSERT_SECONDS` (2h) with the write-on-change dedupe bypassed (`force=True`), the timer advancing only on a fully successful forced assert; the Info line `Teslemetry control drift-correction is transition-based ..., backed by a forced re-assert of the full device tuple every 120 minutes` names it, so on current main the stall is bounded at ~2h. **Freeze export is fully implemented in the planner and disabled for TESLA at exactly one point (GH#5225, enhancement):** `INVERTER_DEF["TESLA"]` declares `support_discharge_freeze: False` (`config.py`), read into `inv_support_discharge_freeze` (`inverter.py`), whose only consumer is the first-inverter lockstep block in `execute.py` that force-disables `set_export_freeze`/`set_export_freeze_only` (`Note: Inverter does not support discharge freeze - disabled`) — `EXPORT_MODE_FREEZE` never enters the export ladder, and PR #4976 additionally drops manual freeze-export windows to demand with a Warn. **Flipping the flag alone is not enough:** the component must also map the freeze-target discharge window to a device-side hold, or the plan's freeze assumption fails on the device — the non-TBC `evaluate_schedule()` writes the *raw* discharge target as the reserve, so a 99 target lands in the 81-99 band Tesla silently snaps to 80 (`_settable_reserve()` exists for exactly that and the non-TBC path doesn't route through it), while the default-TBC `evaluate_schedule_tbc()` discharge branch yields `pv_only` with the standing reserve but no hold — the battery still serves house load and drifts down. The device primitive exists in-tree: the TBC charge-hold tuple (`pv_only` + reserve 100 + grid charging off + autonomous) holds the battery while PV surplus exports, but a freeze *export* hold must sit at the current SoC (reserve at/above SoC through `_settable_reserve()`), not 100 — reserve 100 lets solar recharge the battery instead of exporting the surplus. Every `INVERTER_DEF` entry with `support_discharge_freeze: False` (the cloud-emulator types: SunsynkCloud, AlphaESSCloud, DeyeCloud, SolaxCloud, SolisCloud…) shares this two-part requirement — capability flag **plus** device-side freeze mapping — so enabling freeze export on any of them is a two-file change, not a one-line flag flip; each component's schedule emulator needs its own hold tuple designed against what its hardware honours (*suspected*, not verified per component). **Export-permission detection (GH#5710, fixed on main by PR #5710, b37f25af, 2026-10-27):** `update_battery_export_permitted()` reads `components.net_meter_mode` from site_info — `battery_ok` means battery export allowed, anything else (or the key missing) means installer-level Solar Only — publishes `binary_sensor.predbat_teslemetry_battery_export_permitted`, warns once per boot when blocked, wires a per-inverter `battery_export_permitted` arg that turns export-window planning off fleet-wide while it reads off and replans on any change; only blocked sites re-read site_info hourly (`EXPORT_PERMISSION_RECHECK_SECONDS`, `recheck_battery_export_permitted()`) since `fetch_site_info()` itself stays once per process; `teslemetry_battery_export: true/false` overrides (same unset-becomes-None convention as `teslemetry_hybrid`. The battery still covers load and spare solar is still exported. **Midnight-commit clip and TBC log signatures (GH#5748, live log verified 2026-10-25, ticket waiting_for_user):** `TESLA` declares `can_span_midnight: False` (`config.py`, also EnphaseCloud), so `execute.py`'s commit cap (the two `inv_can_span_midnight` branches) turns a 23:30→05:30 cheap band into a **23:30–23:59 commit that self-heals at 00:00** — the post-midnight remainder re-commits on the first post-midnight cycle — and the pushed 0p signal band (`build_signal_tariff()`) is carved from that committed window, so the first push of the night covers a fraction of the band until the midnight recommit (plan-vs-commit gap on non-spanning types; `plan.py` has no midnight-splitting logic — worth checking whether anything should). Live-log decoder: `Replay input: inverter changed {...}` (`log_replay_inverter`, fetch.py) = the first inverter's held window/isCharging/reserve signature changing; `Teslemetry API POST ..._time_of_use_settings` immediately followed by `pressed toggle button switch.predbat_teslemetry_schedule_write` = an `apply_schedule()` commit; TOU pushes fire only on committed-window changes, so an **external cloud overwrite of the pushed tariff is invisible to the write-on-change dedup** — `evaluate_schedule_tbc()` asserts mode/reserve but never reads the tariff back (the GH#4600 blind spot). TBC device behaviour observed under the signal-tariff hand-off (one Powerwall 3): steady ~1.67 kW charge against a 5 kW `inverter_limit_charge` (3x overestimate; briefly full rate ~4 min after each forced re-assert), served house load from the battery at the cheapest import hour, drained to exactly the asserted reserve floor and held — so under TBC a "charge" window can end below its starting SoC and the only Predbat-side witness is the `predbat.control_failures` sensor — nothing rewrites. Read that sensor first on any "Teslemetry didn't charge" report: the event on this dump carried the committed slot window and requested-w-5000 against a measured-246-W average, while the replan showed the same plan shape (Chrg to target, then hold) — and the plan display's `HoldChrg` there is the *predicted* fill-then-hold, not what was executed (the monitor event had execution still commanding the charge mid-window), so "my forced charge slots keep flipping back to HoldChrg" is the prediction, not a stop command. Suspected, not verified: Tesla's cloud overwrote the pushed PREDBAT tariff with its own cached utility tariff during the night; pending the reporter's Tesla app TOU screen, and do not conflate with GH#4600 (the reverse direction). **Service-hook (user-wired rest_command) Tesla installs: the car-hold freeze can grid-fill the Powerwall (GH#5775, reporter-log verified 2026-10-27, still open):** on that setup the plan's hold expands into service calls the user wires in apps.yaml — the shipped `templates/tesla_powerwall.yaml` maps `charge_freeze_service` to the real `switch._allow_charging_from_grid` (verified in the template), but a wrong-domain wiring such as GH#5775's (a `select_option` of the operation-mode select to `backup`) turns the hold into a grid charge toward the cloud-side backup reserve: Predbat never lowers that reserve during a hold (with `has_reserve_soc: False` the hold's `adjust_reserve(soc+1)` pin is simulated on Predbat's own dummy entity, never reaching the device) and the freeze target is silently dropped — the report's fill was ~17 kWh overnight at tariff prices with the plan-side correct all night, and every write "verification" was self-echo against Predbat's own dummy sensors (GH#4738/#5446 family). Start on any "Powerwall filled overnight when the plan said no charging (Tesla service-hook)" report with the user's actual `charge_freeze_service`/`discharge_stop_service` wiring. Related hold-reserve fix on `TESLA` proper (not the template path): since PR #5823 (merged 2026-10-28, v9.6.2) Tesla opts into `reserve_above_soc_charges_from_grid`, so the hold family's reserve = rounded-SoC + 1 stays at the live SoC instead of ratcheting the battery up 1% per cycle at day rate (pre-v9.6.2 signature: 62→63→64→… across one afternoon). | `teslemetry` | @@ -125,9 +125,10 @@ Grep for the named symbol rather than trusting a line number. | myenergi (`myenergi.py`) | `myenergi_automatic_zappi` (PR #4997) gates the Zappi half of automatic config; with it off, Zappis stay monitor-only and `charger_control_active` is never set. `charger_control_release()` (shared with the other chargers via `CarChargerControl` in `car_charger_control.py`) has exactly one caller — `charger_control_tick()` — reached only under `if self.charger_control_active:` in `run()`, and `charger_control_active` is latched at the first tick: every `enable_control()` refusal (zappi_control → automatic → automatic_zappi → enable_controls) returns *before* setting it, and the gate re-runs only when a fresh instance starts. So after a component restart with any prerequisite off, a Zappi already held in 'Stopped' stayed Stopped and the `switch.*_myenergi_zappi_control` entity was not even republished (it is gated on `charger_control_active` too) — "car won't charge after I turned off Predbat" with a Zappi. **The stranding half is fixed on main (PR #5793, merged 2026-10-28, folded with the #5788 round):** the held set is persisted to Storage and restored (`charger_control_load_enabled()`), ticks while control is off release what is owed (`charger_control_release_inactive()`), and `load_control_modes()` now keeps the saved per-Zappi mode of every still-held charger through a stop (the release-restore fell back to Eco+ before that — the method's docstring cites #5788) — keep the pre-#5793 shape for older logs. Not re-verified since: whether the control switch entity is still unpublished before the gate latches. (Mechanical reading predating PR #5448 — `c000b53a`, 2026-10-12, folded the shared `CarChargerControl` mixin rework with the rule for when Octopus drives a charger or car itself, hand-over, guest-charging switches and the `_octopus_intelligent_charger_follows_car` expert switch, and `charger_control_release()` is no longer tick-only — `ohme.py` now calls it too.) Note `charger_control_tick()` itself *does* release on read-only mode and on the control switch being turned off; it was the config-gate half that stranded. Since PR #5150 (merged 2026-09-19) sunsynk/deye instead persist `control_active` across a restart (and re-infer it from a pre-upgrade cache), so a restart cannot strand an already-armed inverter there; car_charger_control's held-charger persistence (#5793) closes the myenergi direction the entry above describes. Two adjacent lifecycle facts: published entities are **never removed** — `dashboard_item()`/`set_state()` are upsert-only (`output.py`, `ha.py` POST `/api/states`), so when a gate stops `publish_data()` publishing a switch the old entity lingers frozen at its last state until HA restarts, and there is no entity-removal path anywhere in the codebase; and `set_arg`/`set_arg_auto` writes survive a component-only restart, because `Components.restart()` stops and re-creates only the instance and never resets the shared `base.args` from apps.yaml — auto-wired values (e.g. myenergi's `car_charging_*`) persist until a full process restart. Distinguish the two restarts when checking arg lifecycle. | `myenergi` | | Wallbox (`wallbox.py`) | Component landed on main in PR #5410 (merged 2026-10-05, unreleased at the time of writing). Cloud API reimplemented from the Home Assistant `wallbox` integration and the `wallbox` PyPI library, over aiohttp. Findings from the first live runs (5 Oct 2026, a Pulsar Plus on firmware 6.7.43): sign in works with `User-Agent: Predbat`. **A charger run by an OCPP backend** (here Octopus, for Intelligent Octopus Go) reports `config_data.operation_mode: "ocpp"`, sits in status 209 Locked, and an API unlock (`PUT v2/charger/` `{"locked": 0}`) is accepted but has no effect - so "the lock switch flips back" on such a charger is the backend, not a bug. On that locked charger a pause returned **HTTP 403** and a resume **HTTP 409**, from an account whose profile is super-admin: 403 on a control does *not* prove missing admin rights, whatever the HA integration assumes. `held_by_lock()` therefore sends neither while locked, and `held_by_ocpp()` keeps plan-led control off such a charger. `GET v3/chargers//ocpp-configuration` returns the backend address and the charge point credentials - **its reply contains a password, so never paste `--get` output unredacted**; no OCPP on/off write call is known. `locked` arrives as `1`/`0`, not a boolean, and `state_of_charge` is always null (a Type 2 connector cannot report it). Charger N is car N through `car_order`, which is numeric and append-only, so a status failure or a charger added later cannot shift it. Not yet verified on hardware when this was written: pause/resume on an unlocked, charging, non-OCPP charger; the real status ids for charging and paused; whether a 120s poll stays clear of HTTP 429. `python3 wallbox.py --username --raw` is the capture tool (it prompts for the password). **Status ids against the cable, from three weeks of HA history on that OCPP Pulsar Plus (5-22 Oct 2026, checked for PR #5678's `binary_sensor._plugged`):** 209 Locked = no car (every gap between unplugging in the morning and plugging in in the evening); 210 Locked, car connected = just plugged in, before the session starts; 164 Waiting and 181 Waiting for car demand = plugged in, including full overnight until unplugged; 161 Ready = 2-minute blips with no car, usually just after a reconnect; **0 Disconnected = the charger off Wallbox's cloud, not an unplug** - a 2-minute blip around 16:4x every day, 2-4 minutes in the middle of charging sessions, once 134 minutes - so treating 0 as unplugged resets a charging car. A 2-minute 209 can also appear right after 210 while the car is plugged in. 163 was never seen. Replaying the history through `plugged_state()` with the 10-minute unplug wait gave exactly one reset per real unplug (11 in 17 days) and none otherwise. Release bookkeeping: `paused_by_predbat` and `schedule_pending` are stored through Storage *before* a pause is sent, and a record is dropped only on a fresh status that settles it. **Ported onto the shared CarChargerControl loop (PR #5798, landed with the #5793 stack squash `02f869f7`, 2026-10-28):** per-charger isolation is `CarChargerControl.charger_control_each()` (one charger's failure is raised after every charger has had its turn; the component's `charger_control_fatal_errors` list covers account-wide refusals such as rate limits/auth) and the component keeps its own `paused_by_predbat`/`schedule_pending` stores; the record-drop rule now keys on `EMPTY_STATUS_IDS` (161/162/165/209) — **status 0 "Disconnected" no longer settles a record**, because it is also what a charger reports while dropped off Wallbox's cloud mid-charge (the older `UNPLUGGED_STATUS_IDS` = 0/161/162/163/165/209 shape is what pre-#5798 logs used). If "a charger stayed paused after control was turned off" is reported, read `CarChargerControl`'s release path (and, below PR #5793, the wallbox-local `release_one()`) first. | | Hypervolt (`hypervolt.py`) | A V3 charger's `get.session` pushes carry no `session` key, and `watt_hours` drops to 0 when charging stops (seen on a Home 3 Pro, firmware 4009). `apply_session` therefore resets `session_energy_kwh` on a lower `watt_hours` when a message on the V3 API has no session id; with only the id check the sensor froze at the highest total since Predbat started and `car_manual_soc_track` missed later charges. | `./run_all --test hypervolt` | +| Charger control (`car_charger_control.py`, shared mixin — Hypervolt, Wallbox and Ohme-class components) | **With `_control: true` the shared loop reads the RAW `octopus_intelligent_slot` sensor, bypassing `octopus_intelligent_planned_slot`** (`charger_control_dispatch_active()` ORs the raw sensor into `charger_control_should_charge()`, via `charger_control_dispatch_sensor()` — GH#5807, triaged 2026-10-28): the planned-slot arbitration is consumed only by the planning path (`Fetch.car_planned_slot_entity()`), so with charger control on, a raw dispatch beats a filtered plan. The pre-#5791 Hypervolt loop drove only inside Predbat's own planned windows (the `binary_sensor._car_charging_slot` `planned` attribute, built from the filtered dispatches); migration onto the shared mixin is commit `6ef9a5e1` (#5791) — a "charger charges outside the plan" report starting from the Hypervolt migration is this, not a #5791 fixture bug. The raw-sensor follow is deliberate for the `octopus_intelligent_charger_follows_car` expert mode ("following the dispatch sensor directly"), so a fix must keep that path and reroute only planned dispatches where set; no test covers planned_slot together with charger control (`test_car_charger_control.py` / `test_hypervolt.py`). `is_charger` is published only by Predbat's own Octopus/Kraken components onto their dispatch sensors (`octopus.py`, `kraken.py`) — the Octopus Energy integration's and Ohme's dispatch sensors never carry it, so `charger_control_dispatch_is_charger()` answers None ("cannot tell") for them, and `_control: true` means "drive even when cannot tell" = the user asserting the charger is **not** the Octopus device; `drives is True` leaves the charger alone entirely, and a stop-only veto (Octopus starts, Predbat stops outside its plan) does not exist on any charger family — proposed in #5807 as `octopus_intelligent_device: charger | car`, which needs a new mode, not a flag flip. First question on any "Predbat fights/interferes with my Octopus-controlled charger" ticket: which sensor`octopus_intelligent_slot` points at. **The planned-slot rule lives in several places that must move together (PR #5816, open at its 2026-10-28 review — that review verified the fetch side on main and the PR's new mixin side):** fetch-side `car_planned_slot_entity()` (fetch.py) and the mixin-side `charger_control_planned_sensor()` (+ `charger_control_dispatch_active()` / `charger_control_drive_one()`'s filtered arm), with tests pinning each side — shared rule: arg not set / list shorter than the car / falsy-or-non-string entry /`re:`-prefixed entry / entry equal to the slot sensor itself /`octopus_intelligent_slot_action_config` in use ⇒ fall back to the raw `octopus_intelligent_slot` sensor as the plan. Matched `re:` patterns are resolved into entity ids by auto-config before either side reads the arg, so an unresolved `re:`string always means "matched nothing"; the mixin's components DO see root-level apps.yaml args (`ComponentBase.args = base.args`,`get_arg()` delegates to the base). A one-sided rule edit makes the car plan and the charger filter silently read different dispatch sets. | `./run_all --test car_charger_control` | | Hanchu Cloud (`hanchu.py`, `hanchu_const.py`) | Merged in PR #5305 (explicitly unverified against most hardware); the issue family #5664/#5665/#5667/#5668 is one reporter on live hardware — search it before re-deriving anything. PR #5684 (merged 2026-10-21) settled three threads: power limits derive as **user override (`hanchu_battery_rate_max`/`hanchu_inverter_limit`) > devModel rating (`HANCHU_MODELS`, keyed on the `getDeviceStatus` `devModel` code — a lookup, the codes are not in size order and unknown codes fall back with a once-per-device "please report the model" Info) > highest-ever-seen held power (`power_ceiling` ratchet, #5672 — a held value above the menu's max is kept so Predbat's own 0-for-hold writes can't lower it, then capped at the model's battery limit) > menu range > default** (ranges_for(); GH#5664 closed out by this shape); **freeze export is never requested** — `INVERTER_DEF` sets `support_discharge_freeze: False` because `CHG_PWR_LMT=0` was the pre-#5684 no-op (GH#5665); and a hold now caps the grid-charge target `DTU_AC_CHG_SOC_LMT` at the current SoC (`_hold_grid_target()`), closing GH#5667's "slot-3 hold charges to a future window's 100% target if the 0 W write is refused". Durable register facts: `CHG_PWR_LMT` limits **grid** charging only (surplus solar charges regardless); `CHG_BAT_SOC_LMT` would cap all charging but Predbat reads it and never writes it, and its clamp floor is 50 with `DTU_AC_CHG_SOC_LMT` floored at 20 and `DSCHG_BAT_SOC_LMT` capped at 45 — so a freeze hold below 50% or a discharge target above 45% cannot be expressed on this API; holds are a charge slot at 0 W (a zero discharge rate alone does nothing outside a slot); writes are one batched `iotSet` per change, a partial accept is never cached as applied, two overlapping control writes collide with cloud error 300004, and the rolling one-hour hold slot is deliberate (a dead Predbat returns the inverter to self-use within the hour). The menu parser ignores `productModel`, and HC-HY-SL-*-G2 appears in the menu's model list but not in the console `devModel`/`pcsEnMap` table — it always takes the derivation fallback. | | Growatt Cloud OpenAPI (PR #5666 — open at writing, 2026-10-24; no component on main) | The PR adds `apps/predbat/growatt.py` + `growatt_const.py`, experimental and unverified against hardware — re-check against the merged shape before citing anything here. Vendor assumptions flagged at review (code-read only, no API probe): `etoUserToday` is mapped as **grid import** and feeds `load_today` — if the field means load, load_today inflates; dispatch slots are sent as UTC `HH:MM` and treated as daily-recurring with "23:59" as end-of-day, and a window ending exactly at UTC midnight emits a degenerate `{"00:00","00:00"}` second slot; SoC limits are a **software gate** on one-minute telemetry (`_gate_reason()`), not a writable register — the public dispatch API has no SoC field; `tier_expired`/`mark_refreshed` mark only on success, so stale-telemetry steady state is silent; `read_dispatch()` had no caller at review time (dead code). | -| Gateway MQTT (`gateway.py`) | Control writes are MQTT commands the hub acknowledges. **The ack design arrived with PR #5220 and was refined by PR #5231 (both merged 2026-09-26)** — both postdate every earlier gateway log, so keep a publish-per-call reading for pre-#5220 logs: `_subscribe_acks()` subscribes to `predbat/devices//ack/+`, tolerating a broker that refuses it (a single warn via `_ack_subscribe_warned`; without the subscription or before any ack, `_send_control()` publishes exactly as before); once acks are seen, an identical command (same entity, command, payload) is published once per `_COMMAND_ACK_WINDOW` (30s), re-sent once after the unanswered window, and if that re-send is also unanswered `_acks_seen` drops so writes fall back to publish-every-call until telemetry confirms; `_process_ack()` matches any tracked id of the current value, a refusal outranks an ok (a multi-unit dispatch acks once per unit), and replay errors are handled; ids come from a clock-seeded monotonic counter (`_next_command_id()`, `PBAT`), so they never restart at `PBAT1` after a restart, and the kept-id list (`_COMMAND_ACK_IDS_KEPT`) is pruned only after the new send is out, with an ack that arrives during a failing publish still counting. **PR #5172 is a separate, still-open implementation of the same feature** (`_subscribe_command_acks`, `uuid4().hex` ids, typed outcomes threaded through service dispatch/HTTP/inverter verifier) — its symbols are not on main until it rebases, so do not start a gateway-ack triage from its names. **Two gaps around serial-less and empty status, probed on main 2026-09-25 (GH#5227, enhancement — probed with temporary tests in `test_gateway.py`, reverted after):** (1) a sole slot publishing `serial=""` (shipped firmware 1.0.0 publishes every slot, including a GivEnergy slot whose serial discovery failed) is bound as the control target: `_needs_reconfigure()` treats `""` as a newly discovered inverter, `_needs_reconfigure()` treats `""` as a newly discovered inverter and auto-config binds it — note the last-resort branch that used to fall back to `candidate_aios or list(all_inverters)` was removed in `eaef6e61` (2026-10-04), which now defers auto-config entirely with a warn when no battery-capable telemetry has arrived (`_auto_configured` stays False so `_needs_reconfigure()` retries); an empty-serial slot that does report battery telemetry is still bound, so the trap survives on that shape, and the result is empty-suffix entities (`select.predbat_gateway__charge_slot1_start`) and commands addressed to `""`, which the firmware rejects (`dongle_serial required`) — a real fleet incident on 2026-09-16 (~22 min of failed commands); an empty-serial guard in `_needs_reconfigure()`/`automatic_config()` would close it, and #5227's proposed `dongle_count` deferral does *not* cover this state (`dongle_count == len(inverters)` when the empty slot is the only one). (2) `if len(status.inverters) == 0: return` (`gateway.py`) fires **before** `_inject_entities()` (EV chargers, gateway-online) and before `_last_telemetry_time`/`update_success_timestamp()` — on a hub where all GivEnergy slots are withheld (post-predbat-gateway#335, e.g. a single-inverter hub), every status message is dropped: EV data freezes and the component fails the 60-minute staleness test (`components.py`). Symptom pointer: "gateway EV sensors froze / gateway component unhealthy while the hub is up" → this early return. Removals staying bound and reappearance triggering re-config are already the behaviour (probed). **Probe trap:** the topology branch in `automatic_config()` depends on the *whole* visible set — a probe that adds a Gateway alongside the `""` slot drops the `""` entry via the battery-presence filter (`aios` requires `battery.ByteSize() > 0`) so it never reaches the last-resort branch; construct the exact visible set the scenario implies, and note the filter silently hides data-less slots from the count in several branches (the same mechanism can make a Gateway+2-AIO fleet collapse to AIO-direct control). Existing precedent for topology probes: `TestGatewayUnitControlBinding` (`test_gateway.py`). **GH#5471, fixed in PR #5475 (merged 2026-10-11, post-v9.3.7) - keep the mechanism for pre-#5475 logs.** An inverter the hub could not read at the discovery pass stayed out of auto-config until Predbat restarted: auto-config proceeded with the readable subset, but success recorded every serial in the status message (`_configured_inverter_serials`, including the filtered-out ones) and `_needs_reconfigure()` only re-ran for serials outside that set, so a listed-but-unusable inverter was never "new" again - no error anywhere, the component reported healthy (`_auto_configured` True), and capacity/plan ran on fewer inverters. The fix keys the site on `gateway_inverter_serial` when it is set and keeps a per-inverter discovery record in the Storage component, updated only while the hub is reading that inverter: a listed inverter with a record keeps its slot while the hub cannot read it - including across a restart - one never read yet is left out with a warning until it is, records for serials no longer listed are not used, and re-runs are gated on a device becoming usable rather than on serial-set membership (the trap written below-merge code must still respect). Partial-outage tests now cover the scenario (`test_gateway.py`). #5227's dongle-count deferral covers "missing from status", not "listed but unusable" - pre-#5475 reading. **GH#5478 (triaged 2026-10-10, maintainer report quoting a real site log):** missing-field fallbacks fabricate limits during a telemetry gap (e.g. right after a hub firmware update): `battery_rate_max = bat.rate_max_w or 6000` and `inverter_rate_max = inv.inverter.rate_max_w or battery_rate_max` make an unpopulated proto field a hard 6000 W on both published sensors, proto-0 `control.export_limit_w` publishes as 99999 (deliberate sentinel - proto-0 cannot be told apart from an explicit 0) which `inverter.py` reads back as 100.0 kW, and unpopulated `control.reserve_soc` publishes literal 0 (only `reserve_soc_max` gets an assumption) so Predbat rewrote its reserve against a wrong current value. The wired args feed `battery_rate_max_charge/discharge = min(inverter_limit_*, battery_rate_max_raw)`, so the plan maximum doubles during the gap and the executor writes the fabricated rates - and `_check_rate_caps()` sends `set_rate_cap` with the fabricated cap, which the hub persists ("The hub stores it"; self-corrects on the next good telemetry since differing caps are re-sent). `or 6000` dates from the component's first commits (`9f7fc558`, 2026-03-23) - not a regression. Fix precedent: `merge_non_null()` (`gecloud.py`); gateway.py has no last-good cache for the rate/limit fields. A green `gateway` suite proves nothing here - no test covers a missing rating. **Slot windows stage in the gateway and are written by the schedule write switch (PR #5559 rework, 2026-10-16) - keep the old reading for earlier logs.** `select_event()` holds a slot start/end in `_staged` (keyed serial suffix + side) and publishes it at once; telemetry (`_inject_inverter_entities()`) shows the staged value until it is cleared or `_STAGED_EXPIRY_SECONDS` (600s) passes. GWMQTT is `time_button_press`: `press_and_poll_button()` turns on `switch.predbat_gateway__schedule_write`, and `_commit_side()` sends a staged disable first, then the complete start/end pair, then a staged enable; success or failure the staging is dropped, so a refused window shows the Hub's schedule again and the next cycle rewrites it. EMS firmware semantics (Hub v1.0.38 `ems_plan_update`, per the maintainer's review of the firmware source on #5559): an enabled slot refuses a start-only update whose start equals the old end (zero-length), and a disabled slot only records a full pair (ack `"recorded": true`) and keeps publishing the recorded window while off - so matching slot selects do not prove an EMS slot is armed. Pre-rework logs: #5531/#5532 sent direct batteries a pair from `inverter.py` (`write_and_poll_gateway_*_window`, now gone) while coordinators sent `{"start": ...}` and `{"end": ...}` separately - a lone start command in an EMS log is that path. Symptom pointer: "Hub window never lands / selects flip back" → the `not written to the Hub` warnings from `_commit_failed()`. Hub inverters no longer bind `idle_*_time`: on an EMS they pointed at the export slot selects, so `adjust_idle_time()` overwrote the export window. **Where "Predbat stopped planning" comes from on a Hub site (open PR #5620, unmerged at writing — `GatewayMQTT.inverter_data_error()` and `Execute.check_inverter_data_freshness()` are **not** on main, verified by grep on 697c44ca; re-check at merge before citing):** the PR gates `update_pred`, `fetch_inverter_data` and `execute_plan` on one data-freshness gate whose `Error: ; cannot plan or control the battery` status reason identifies which check to read — `Hub broker connection is offline` (`_mqtt_connected`), `Hub is offline` (LWT), `Hub battery telemetry is stale or missing` (no message ≥120 s), `... source timestamp is stale or invalid` (Hub timestamp absent/>2 min behind **Predbat's** clock — a Hub clock skew >2 min blocks planning while telemetry keeps arriving, and the string never says "check the Hub clock"), per-inverter missing/`has no battery readings`/coordinator-no-readings checks, and `Hub has no configured battery inverter data` — the last is also returned pre-auto-config, i.e. through the whole startup window, not a fault by itself. Two PR-side edges the field has not confirmed: `inverter_data_error()` judges `not connected` for **all** watched serials while `_check_configured_inverters()` (gateway.py) judges it only for slot-bound serials ("only relied on for an inverter with a slot"), so a non-slot member still reporting live telemetry while `connected=False` would flip from warning-only into a whole-site planning block (whether that state occurs is unconfirmed — suspect #5471 narrowed `connected` for a reason); and while stale, `publish_plan`/`_republish_plan_if_stale` discard pending/cached schedules each cycle and re-publish only after a fresh `execute_plan()` re-queues the plan — verified on the PR tree, not field-confirmed. During an outage the 60s quick poll fires the gate too, so `record_status(had_errors=True)` — and the status sensor's `error_count` — increments about once a minute, not once per 5-min cycle (cosmetic, verified while reading the PR). With `gateway_evc_automatic` the **plan half only re-plans a car while its plug evidence reads on**: `get_car_charging_planned()` clears `car_charging_slots` every fetch cycle and `fetch_sensor_data_car_planning()` refills only when `car_charging_planned`/`car_charging_now` read on, and `_register_ev_car()` wires `car_charging_planned` to `binary_sensor._gateway_ev__connected` — so a hub that flips its charger status to `Available` on the stop transaction (PR #5670's firmware premise, unverified by the bot) reads unplugged after window 1's stop, so no later window exists for the plan to pick up: expect "works the first window after plugging in, not after" reports; the levers are the planning-side wiring in `_register_ev_car()`, not control. On main (read 2026-10-26, PR #5670 unmerged) the plug/plan evidence is `ev.connected and ev.status in {"Preparing", "Charging", "SuspendedEV", "SuspendedEVSE", "Finishing"}` (gateway.py), with `_plugged` reading the same set but staying "unavailable" while the charger itself is offline — the same status also drives the #5678 manual-SoC unplug reset through `car_charging_plugged`, and `Car N charging is not planned as it is not plugged in` (fetch.py) is the log line marking the refill gate. PR #5670 (still open; the reworked PR #5739 merged 2026-10-27, f04e6d63) reworks the control half to `/command` plus a reconcile against the charger's session while arguing that same hub status cannot be trusted. **PR #5699 (still open, but superseded by the merged #5739 — bot flagged it 2026-10-28; the confirm/retry/latch controller it describes never merged)** — its symbols (`charging session ended part-way through the window; not restarting it`, the `predbat.status` "did not start/stop after 3 attempts" latch, `_EV_MAX_STARTS_PER_WINDOW`) are PR-branch reading only; do not start a gateway-EVC triage from them. **What main does instead (verified on main 2026-10-28, post-#5739; gateway.py unchanged since):** `gateway_evc_control` runs a *stateless* reconcile each pass — inside a planned window with no session it sends `SetChargingProfile` then `RemoteStartTransaction` (status in `_EV_START_BLOCKED_STATUSES` = Unavailable/Faulted/Offline blocks; plug status is not consulted), and outside every window with a session active — **including one the user started by hand or the charger's own schedule** — it sends `RemoteStopTransaction`, deliberate per the `_apply_ev_charging_state()` docstring. Each direction gets `_EV_COMMAND_ATTEMPTS` (3) attempts at least `_EV_COMMAND_RETRY_SECONDS` (120s) apart; a start that runs out is a `Warn:` only, a stop that runs out also records `had_errors=True`; only `_ev_control_cp_id` (the charger `_register_ev_car()` bound as car 1) is driven, so with more than one charger the others are never touched; unusable telemetry (missing/stale/not connected) sends nothing and warns once per window state; read-only is checked before reconciling and again at publish, and leaving read-only resets the retry budget; commands go over `{base}/command` with `command: "ev"` (the old `{base}/ev/command` topic is gone). Symptom mapping: "the charger stops a few minutes after I start it from the app" (no window active) and "I stopped it from the app mid-window and it started again" are this reconcile working as designed; a `Warn ... not taken by the charger after 3 attempts` with no car plugged in is expected, only the stop direction is an error. From #5739's body only, unverified: older hub firmware reports `Available` for a car still plugged in, and firmware #501 (Finishing status) is needed for reliable plugged-through operation. **Online flag and health semantics reworked (PR #5713, merged 2026-10-24):** the hub firmware publishes `online` (retained) / `offline` (LWT payload) where the reader only accepted `"1"` — pre-#5713 logs never log `Gateway is online/offline`, never set `_gateway_online`, never send `set_rate_cap`, while `binary_sensor._gateway_online` still read `on`; post-merge the flag accepts both payloads, a reconnect clears `_rate_caps_sent`/`_commanded_serials_sent` (so `set_rate_cap` newly appearing in a log after a hub reconnect is expected), and the telemetry status path *still* republishes the online sensor as True on every status (`_inject_entities()`) while `_handle_message()` publishes the real flag only on transitions — the sensor tracks "statuses arriving" more than the flag. Health: only a status with a readable inverter slot stamps component success (`_process_telemetry()` — a status with none is acknowledged as "not nothing to do" under a serial list #5471 but does not count as fresh), so an all-slots-unread hub is unhealthy after the 60-minute staleness check while statuses keep flowing; display-only mode stamps success unconditionally. Consequence through `is_all_alive()`→`is_running()`→`/api/ping`: an unplugged or all-slots-unread hub restarts a SaaS pod roughly every 8h (the PR body discloses the unplugged case; the all-slots-unread case is the reviewed-in nuance). The firmware payload claim is cross-repo (`predbat-gateway` `mqtt_transport_conn.cpp`) and unverified from this checkout. | `gateway` | +| Gateway MQTT (`gateway.py`) | Control writes are MQTT commands the hub acknowledges. **The ack design arrived with PR #5220 and was refined by PR #5231 (both merged 2026-09-26)** — both postdate every earlier gateway log, so keep a publish-per-call reading for pre-#5220 logs: `_subscribe_acks()` subscribes to `predbat/devices//ack/+`, tolerating a broker that refuses it (a single warn via `_ack_subscribe_warned`; without the subscription or before any ack, `_send_control()` publishes exactly as before); once acks are seen, an identical command (same entity, command, payload) is published once per `_COMMAND_ACK_WINDOW` (30s), re-sent once after the unanswered window, and if that re-send is also unanswered `_acks_seen` drops so writes fall back to publish-every-call until telemetry confirms; `_process_ack()` matches any tracked id of the current value, a refusal outranks an ok (a multi-unit dispatch acks once per unit), and replay errors are handled; ids come from a clock-seeded monotonic counter (`_next_command_id()`, `PBAT`), so they never restart at `PBAT1` after a restart, and the kept-id list (`_COMMAND_ACK_IDS_KEPT`) is pruned only after the new send is out, with an ack that arrives during a failing publish still counting. **PR #5172 is a separate, still-open implementation of the same feature** (`_subscribe_command_acks`, `uuid4().hex` ids, typed outcomes threaded through service dispatch/HTTP/inverter verifier) — its symbols are not on main until it rebases, so do not start a gateway-ack triage from its names. **Two gaps around serial-less and empty status, probed on main 2026-09-25 (GH#5227, enhancement — probed with temporary tests in `test_gateway.py`, reverted after):** (1) a sole slot publishing `serial=""` (shipped firmware 1.0.0 publishes every slot, including a GivEnergy slot whose serial discovery failed) is bound as the control target: `_needs_reconfigure()` treats `""` as a newly discovered inverter, `_needs_reconfigure()` treats `""` as a newly discovered inverter and auto-config binds it — note the last-resort branch that used to fall back to `candidate_aios or list(all_inverters)` was removed in `eaef6e61` (2026-10-04), which now defers auto-config entirely with a warn when no battery-capable telemetry has arrived (`_auto_configured` stays False so `_needs_reconfigure()` retries); an empty-serial slot that does report battery telemetry is still bound, so the trap survives on that shape, and the result is empty-suffix entities (`select.predbat_gateway__charge_slot1_start`) and commands addressed to `""`, which the firmware rejects (`dongle_serial required`) — a real fleet incident on 2026-09-16 (~22 min of failed commands); an empty-serial guard in `_needs_reconfigure()`/`automatic_config()` would close it, and #5227's proposed `dongle_count` deferral does *not* cover this state (`dongle_count == len(inverters)` when the empty slot is the only one). (2) `if len(status.inverters) == 0: return` (`gateway.py`) fires **before** `_inject_entities()` (EV chargers, gateway-online) and before `_last_telemetry_time`/`update_success_timestamp()` — on a hub where all GivEnergy slots are withheld (post-predbat-gateway#335, e.g. a single-inverter hub), every status message is dropped: EV data freezes and the component fails the 60-minute staleness test (`components.py`). Symptom pointer: "gateway EV sensors froze / gateway component unhealthy while the hub is up" → this early return. Removals staying bound and reappearance triggering re-config are already the behaviour (probed). **Probe trap:** the topology branch in `automatic_config()` depends on the *whole* visible set — a probe that adds a Gateway alongside the `""` slot drops the `""` entry via the battery-presence filter (`aios` requires `battery.ByteSize() > 0`) so it never reaches the last-resort branch; construct the exact visible set the scenario implies, and note the filter silently hides data-less slots from the count in several branches (the same mechanism can make a Gateway+2-AIO fleet collapse to AIO-direct control). Existing precedent for topology probes: `TestGatewayUnitControlBinding` (`test_gateway.py`). **GH#5471, fixed in PR #5475 (merged 2026-10-11, post-v9.3.7) - keep the mechanism for pre-#5475 logs.** An inverter the hub could not read at the discovery pass stayed out of auto-config until Predbat restarted: auto-config proceeded with the readable subset, but success recorded every serial in the status message (`_configured_inverter_serials`, including the filtered-out ones) and `_needs_reconfigure()` only re-ran for serials outside that set, so a listed-but-unusable inverter was never "new" again - no error anywhere, the component reported healthy (`_auto_configured` True), and capacity/plan ran on fewer inverters. The fix keys the site on `gateway_inverter_serial` when it is set and keeps a per-inverter discovery record in the Storage component, updated only while the hub is reading that inverter: a listed inverter with a record keeps its slot while the hub cannot read it - including across a restart - one never read yet is left out with a warning until it is, records for serials no longer listed are not used, and re-runs are gated on a device becoming usable rather than on serial-set membership (the trap written below-merge code must still respect). Partial-outage tests now cover the scenario (`test_gateway.py`). #5227's dongle-count deferral covers "missing from status", not "listed but unusable" - pre-#5475 reading. **GH#5478 (triaged 2026-10-10, maintainer report quoting a real site log):** missing-field fallbacks fabricate limits during a telemetry gap (e.g. right after a hub firmware update): `battery_rate_max = bat.rate_max_w or 6000` and `inverter_rate_max = inv.inverter.rate_max_w or battery_rate_max` make an unpopulated proto field a hard 6000 W on both published sensors, proto-0 `control.export_limit_w` publishes as 99999 (deliberate sentinel - proto-0 cannot be told apart from an explicit 0) which `inverter.py` reads back as 100.0 kW, and unpopulated `control.reserve_soc` publishes literal 0 (only `reserve_soc_max` gets an assumption) so Predbat rewrote its reserve against a wrong current value. The wired args feed `battery_rate_max_charge/discharge = min(inverter_limit_*, battery_rate_max_raw)`, so the plan maximum doubles during the gap and the executor writes the fabricated rates - and `_check_rate_caps()` sends `set_rate_cap` with the fabricated cap, which the hub persists ("The hub stores it"; self-corrects on the next good telemetry since differing caps are re-sent). `or 6000` dates from the component's first commits (`9f7fc558`, 2026-03-23) - not a regression. Fix precedent: `merge_non_null()` (`gecloud.py`); gateway.py has no last-good cache for the rate/limit fields. A green `gateway` suite proves nothing here - no test covers a missing rating. **Slot windows stage in the gateway and are written by the schedule write switch (PR #5559 rework, 2026-10-16) - keep the old reading for earlier logs.** `select_event()` holds a slot start/end in `_staged` (keyed serial suffix + side) and publishes it at once; telemetry (`_inject_inverter_entities()`) shows the staged value until it is cleared or `_STAGED_EXPIRY_SECONDS` (600s) passes. GWMQTT is `time_button_press`: `press_and_poll_button()` turns on `switch.predbat_gateway__schedule_write`, and `_commit_side()` sends a staged disable first, then the complete start/end pair, then a staged enable; success or failure the staging is dropped, so a refused window shows the Hub's schedule again and the next cycle rewrites it. EMS firmware semantics (Hub v1.0.38 `ems_plan_update`, per the maintainer's review of the firmware source on #5559): an enabled slot refuses a start-only update whose start equals the old end (zero-length), and a disabled slot only records a full pair (ack `"recorded": true`) and keeps publishing the recorded window while off - so matching slot selects do not prove an EMS slot is armed. Pre-rework logs: #5531/#5532 sent direct batteries a pair from `inverter.py` (`write_and_poll_gateway_*_window`, now gone) while coordinators sent `{"start": ...}` and `{"end": ...}` separately - a lone start command in an EMS log is that path. Symptom pointer: "Hub window never lands / selects flip back" → the `not written to the Hub` warnings from `_commit_failed()`. Hub inverters no longer bind `idle_*_time`: on an EMS they pointed at the export slot selects, so `adjust_idle_time()` overwrote the export window. **Where "Predbat stopped planning" comes from on a Hub site (open PR #5620, unmerged at writing — `GatewayMQTT.inverter_data_error()` and `Execute.check_inverter_data_freshness()` are **not** on main, verified by grep on 697c44ca; re-check at merge before citing):** the PR gates `update_pred`, `fetch_inverter_data` and `execute_plan` on one data-freshness gate whose `Error: ; cannot plan or control the battery` status reason identifies which check to read — `Hub broker connection is offline` (`_mqtt_connected`), `Hub is offline` (LWT), `Hub battery telemetry is stale or missing` (no message ≥120 s), `... source timestamp is stale or invalid` (Hub timestamp absent/>2 min behind **Predbat's** clock — a Hub clock skew >2 min blocks planning while telemetry keeps arriving, and the string never says "check the Hub clock"), per-inverter missing/`has no battery readings`/coordinator-no-readings checks, and `Hub has no configured battery inverter data` — the last is also returned pre-auto-config, i.e. through the whole startup window, not a fault by itself. Two PR-side edges the field has not confirmed: `inverter_data_error()` judges `not connected` for **all** watched serials while `_check_configured_inverters()` (gateway.py) judges it only for slot-bound serials ("only relied on for an inverter with a slot"), so a non-slot member still reporting live telemetry while `connected=False` would flip from warning-only into a whole-site planning block (whether that state occurs is unconfirmed — suspect #5471 narrowed `connected` for a reason); and while stale, `publish_plan`/`_republish_plan_if_stale` discard pending/cached schedules each cycle and re-publish only after a fresh `execute_plan()` re-queues the plan — verified on the PR tree, not field-confirmed. During an outage the 60s quick poll fires the gate too, so `record_status(had_errors=True)` — and the status sensor's `error_count` — increments about once a minute, not once per 5-min cycle (cosmetic, verified while reading the PR). With `gateway_evc_automatic` the **plan half only re-plans a car while its plug evidence reads on**: `get_car_charging_planned()` clears `car_charging_slots` every fetch cycle and `fetch_sensor_data_car_planning()` refills only when `car_charging_planned`/`car_charging_now` read on, and `_register_ev_car()` wires `car_charging_planned` to `binary_sensor._gateway_ev__connected` — so a hub that flips its charger status to `Available` on the stop transaction (PR #5670's firmware premise, unverified by the bot) reads unplugged after window 1's stop, so no later window exists for the plan to pick up: expect "works the first window after plugging in, not after" reports; the levers are the planning-side wiring in `_register_ev_car()`, not control. On main (read 2026-10-26, PR #5670 unmerged) the plug/plan evidence is `ev.connected and ev.status in {"Preparing", "Charging", "SuspendedEV", "SuspendedEVSE", "Finishing"}` (gateway.py), with `_plugged` reading the same set but staying "unavailable" while the charger itself is offline — the same status also drives the #5678 manual-SoC unplug reset through `car_charging_plugged`, and `Car N charging is not planned as it is not plugged in` (fetch.py) is the log line marking the refill gate. PR #5670 (still open; the reworked PR #5739 merged 2026-10-27, f04e6d63) reworks the control half to `/command` plus a reconcile against the charger's session while arguing that same hub status cannot be trusted. **PR #5699 (still open, but superseded by the merged #5739 — bot flagged it 2026-10-28; the confirm/retry/latch controller it describes never merged)** — its symbols (`charging session ended part-way through the window; not restarting it`, the `predbat.status` "did not start/stop after 3 attempts" latch, `_EV_MAX_STARTS_PER_WINDOW`) are PR-branch reading only; do not start a gateway-EVC triage from them. **What main does instead (verified on main 2026-10-28, post-#5739; gateway.py unchanged since):** `gateway_evc_control` runs a *stateless* reconcile each pass — inside a planned window with no session it sends `SetChargingProfile` then `RemoteStartTransaction` (status in `_EV_START_BLOCKED_STATUSES` = Unavailable/Faulted/Offline blocks; plug status is not consulted), and outside every window with a session active — **including one the user started by hand or the charger's own schedule** — it sends `RemoteStopTransaction`, deliberate per the `_apply_ev_charging_state()` docstring. Each direction gets `_EV_COMMAND_ATTEMPTS` (3) attempts at least `_EV_COMMAND_RETRY_SECONDS` (120s) apart; a start that runs out is a `Warn:` only, a stop that runs out also records `had_errors=True`; only `_ev_control_cp_id` (the charger `_register_ev_car()` bound as car 1) is driven, so with more than one charger the others are never touched; unusable telemetry (missing/stale/not connected) sends nothing and warns once per window state; read-only is checked before reconciling and again at publish, and leaving read-only resets the retry budget; commands go over `{base}/command` with `command: "ev"` (the old `{base}/ev/command` topic is gone). Symptom mapping: "the charger stops a few minutes after I start it from the app" (no window active) and "I stopped it from the app mid-window and it started again" are this reconcile working as designed; a `Warn ... not taken by the charger after 3 attempts` with no car plugged in is expected, only the stop direction is an error. From #5739's body only, unverified: older hub firmware reports `Available` for a car still plugged in, and firmware #501 (Finishing status) is needed for reliable plugged-through operation. **Online flag and health semantics reworked (PR #5713, merged 2026-10-24):** the hub firmware publishes `online` (retained) / `offline` (LWT payload) where the reader only accepted `"1"` — pre-#5713 logs never log `Gateway is online/offline`, never set `_gateway_online`, never send `set_rate_cap`, while `binary_sensor._gateway_online` still read `on`; post-merge the flag accepts both payloads, a reconnect clears `_rate_caps_sent`/`_commanded_serials_sent` (so `set_rate_cap` newly appearing in a log after a hub reconnect is expected), and the telemetry status path *still* republishes the online sensor as True on every status (`_inject_entities()`) while `_handle_message()` publishes the real flag only on transitions — the sensor tracks "statuses arriving" more than the flag. Health: only a status with a readable inverter slot stamps component success (`_process_telemetry()` — a status with none is acknowledged as "not nothing to do" under a serial list #5471 but does not count as fresh), so an all-slots-unread hub is unhealthy after the 60-minute staleness check while statuses keep flowing; display-only mode stamps success unconditionally. Consequence through `is_all_alive()`→`is_running()`→`/api/ping`: an unplugged or all-slots-unread hub restarts a SaaS pod roughly every 8h (the PR body discloses the unplugged case; the all-slots-unread case is the reviewed-in nuance). The firmware payload claim is cross-repo (`predbat-gateway` `mqtt_transport_conn.cpp`) and unverified from this checkout. **Unlisted PV-only inverters are auto-configured and their generation counted (PR #5805, merged `14af9bbb`, 2026-10-31):** with no `gateway_inverter_serial` and no Gateway/Plant EMS on the site, a battery-less inverter with a discovery record is auto-configured PV-only (`_auto_pv_only()`); its `pv_power` counts through the extra entries past `num_inverters` (execute.py sums them) but its `pv_today` **does not** (counted only for listed-path records, `_pv_only_counters`) — deliberate, because on some sites the battery inverter's own counter already includes the PV inverter's generation, so a site whose battery counter misses the PV inverter still needs `gateway_inverter_serial`. Symptom split for old reports: "the plan's PV-now misses the PV inverter" is what this PR fixed; "day's PV / PV calibration still miss it" is the counter remainder, not the pv_power drop. Failure state to check on a "gateway PV sensor stuck at 0 while clearly generating" report: `connected=False` on a unit the hub is fact still reading (live, not frozen readings) — `_publish_inverter()` now zeroes a PV-only unit's published powers while disconnected, **including on the listed path** (the PR's declared listed-site behaviour change; the same unconfirmed-firmware state #5620 flagged for slot serials); gateway.py's "The connected flag is only relied on for an inverter with a slot" comment (`_check_configured_inverters()`) is still true only of that function — do not read it as file-wide trust. An inverter dark at startup (no readings → no record) is picked up without a restart via the `:pv` keys in `_usable_serials` vs `_configured_inverter_serials`. | `gateway` | | Octopus (`octopus.py`, `fetch.py`) | Intelligent Go tariffs are detected via `is_intelligent_go_tariff()`, and IOG-prefixed tariffs must be skipped when updating intelligent devices. Saving-session auto-join rebinding regressed when `joined_events` was empty (GH#4573). `octopus_slots_signature()` deliberately omits the time-drifting fields of active dispatch slots so a replan is not forced every cycle. `car_charging_threshold` is a strict fallback gated on `not self.car_charging_energy` (`fetch.py:228`, and `load_ml_component.py:348-361`) — it never runs as a second filter alongside a real `car_charging_energy` sensor (GH#4717). Saving-session reporting credits the full saving rate to every minute of the session on both rate tables (`load_saving_slot()` — the line this entry used to cite at `octopus.py:2786` has moved; grep the symbol) and Octopus pays the reward only on export above the user's baseline (their typical export at that hour), so for a plan that already exports in the event hour the modelled session value is fiction and the real reward can be zero (GH#5458); the slot dict has no baseline field to subtract (GH#2090) — a complaint that a saving session's reported total looks inflated starts here, not in a rate-fetch bug. Split the reports three ways: an inflated session total is the per-minute crediting (#2090); "I exported but got no reward" is the baseline eating it — check whether the user's plan already exported in the typical event hour before suspecting event pickup or rate propagation (#5458); a low-value session the plan books into is what `octopus_saving_session_min_octopoints_per_kwh` is for (#4893's workaround, closed NOT_PLANNED - it skips low-value sessions entirely and does not help baseline mechanics). Baseline-aware valuation needs past-event persistence Predbat does not have (events are re-read each cycle from the integration's `joined_events`/`available_events` attributes), so that ask needs Storage-backed persistence or user-configured keep-clear hours; the BottlecapDave integration exposes a joined session's per-half-hour baselines ahead of time via the `octoplus_power_down_baseline` sensors' `Baselines` attribute (reporter-thread evidence; not probed from Predbat's tree, so verify before building a baseline-aware prediction on it). A tariff with no `standard_unit_rates` link (IOG-TOU, GO) goes down `async_get_day_night_rates()`, which infers the off-peak window from 7 days of measurement TOU labels by plurality vote. On IOG those labels include ad-hoc dispatch slots, so a bonus slot recurring on 4+ of 7 nights became a permanent nightly cheap window and Predbat charged into it at the day rate (PR #4854 skips the inference for IOG). A "cheap slot Octopus has never heard of" report where the dispatch feeds are *empty* is this, not phantom dispatches — check the log for `Using off-peak windows [...] from measurement TOU labels`. TOU labels are UTC instants, so windows derived from them must be re-anchored for a local wall-clock tariff or they drift an hour at DST. Free-session slots have their own family of gates, separate from the saving-session ones and each found the hard way. `octopus_free_session` events used to be dropped when `code` was null, which is exactly how Octopus publishes auto-joined Weekend Happy Hours - fixed, the gate is now `start and end` and the log falls back to the event id (GH#4835). The free/saving-session args name **event** entities (`attribute="events"`/`"joined_events"`, `octopus.py`), and the BottlecapDave integration exposes Octoplus sessions as calendar + event pairs of which only the event entity carries those state attributes - the calendars have none at all, and both sides ship **disabled by default** in the integration. "The documented sensor name does not exist" plus a proposal to point at the `calendar.` twin is almost always the disabled-default trap, not a rename (GH#5370, verified against the integration's source): enable the event entity; the calendar twin cannot back these args. Matching calendar/event names differ by the `_events` suffix, so a pattern built from one domain's names mistranslates, and the deprecated pre-v17 names are scheduled for removal in January 2027. `load_free_slot()` bounded itself with `start_minutes < self.forecast_minutes` while rate minutes are indexed from `midnight_utc`, so any event more than `forecast_minutes` past midnight was dropped with no log line at all - fixed in `3bacc6e8`, the gate and the end clamp now both use `forecast_minutes + minutes_now` like `load_saving_slot()` (GH#4931). In the same function the start/end range was only updated on a successful decode while the apply block ran unconditionally, so an undecodable slot re-applied its rate over the *previous* slot's minute range (PR #4935). The join side has its own: the `joined_events` guard still ends in `saving_rate > 0` (`octopus.py:3542`), so `octopoints_per_kwh: 0` - a genuine free hour - yields no slot of any kind; probe-verified (0 gives nothing, 500 gives a saving slot, null gives nothing), and `git blame` puts that guard in `1b8c9136`, the fix for null-rate sessions (GH#3079), so it is an oversight rather than a deliberate exclusion (GH#4851). On dispatches, `rate_add_io_slots()`'s `location` check used to apply to *completed* dispatches too, and `rate_import` is rebuilt every cycle, so a retroactive AT_HOME to AWAY relabel silently un-stamped the cheap rate and `today_cost()` re-priced the whole day at the day rate (GH#4946) - **fixed in PR #4957**, which added `dispatch_billed_off_peak()` (`octopus.py:2977`): a completed dispatch is billed off-peak regardless of location, a straddling one keeps the location test, and the midday budget cap still applies. Keep the mechanism in mind when reading a log from before that merge, where the whole day reprices at the day rate. A neighbouring cap bug had no entry here at all: the daily low-rate slot budget was keyed on the *loop* minute rather than the slot start, so a window straddling noon drew a fresh 12-slot budget at 12:00 and stamped the afternoon cheap (GH#4950, **fixed in PR #4951**). The midday boundary itself is deliberate (`337db867`); only the keying was wrong. Worth knowing because "a cheap slot at an hour Octopus never offered" has at least three distinct causes in this row alone. Compare has its own rate-fetch gap: `download_octopus_rates_func()` (`octopus.py:2725`) reads only `standard-unit-rates`, and the newer IOG-SMB-FIX products are `four_rate_ev` - that endpoint answers 200 with empty results and the rates live on `day-unit-rates`/`night-unit-rates`. The main OctopusAPI component already auto-detects that product shape; compare never got the same treatment (GH#4921, probed against the live API). Lastly, `{dno_region}` in a tariff URL is substituted by `resolve_arg`'s `.format(**self.args)` (`userinterface.py:106-116`), so a missing `-` before the placeholder glues the region letter onto the product code and yields a plausible-looking 404 - check the literal URL in apps.yaml before believing a tariff has been withdrawn. Two later additions to the free/saving-session picture, one of them a correction. **eventType is carried only by the legacy `savingSessions` query path — the flexibility feed drops it (GH#4548, re-verified on main 2026-09-29 by reading `async_get_flexibility_events()`):** that function extracts only `code`/`startAt`/`endAt` from `customerFlexibilityCampaignEvents` and maps every saving event into `joinedEvents` with **no eventType**, so on the Direct path with an MPAN the joined-event loop's free-slot branch (`event_type == "WEEKEND_HAPPY_HOUR"`) can never fire and a joined Happy Hour falls through to the rewarded-saving-slot branch whenever `octopus_saving_session_rate` is set above 0. The legacy query carries eventType (the `savingSessions` GraphQL request names it and its map stores it) and is reached on the Direct path only as the flexibility path's own fallback (no MPAN, or the flexibility API returned no saving events). eventType remains the only sound discriminator between a Power Down saving session and a free Power Up/Happy Hour — the field GH#4851's `saving_rate > 0` problem needed and did not have — but *which query path served the events* decides whether you have it: "free Power Up priced as a paid saving session" on the flexibility path is first a question of provenance, and waiting for the BottlecapDave API before building on the newer feed is deliberate, not an oversight. The Direct join mutation is likewise still the legacy `joinSavingSessionsEvent`. And a genuinely counter-intuitive ordering constraint, worth reading before touching that function: Weekend Happy Hours are now skipped from `available_events` (they cannot be joined through the API - Octopus allocates them or the user books on the website), but **the skip has to sit after the reward/code/type maps are populated**, because those maps are built from the same events list and a joined Happy Hour looks its own type up there. Skip too early and the joined event has no type, takes the injected default reward, and the planner prices a free hour as an **80p/kWh saving session** (`c0fb4e9c`; the test fails if the skip is moved above the maps). **The eventType discrimination for saving sessions is implemented three times over three shapes of the same data (GH#5615, verified on main 063549db/697c44ca 2026-10-18/-19):** (1) the available-events filter reads the raw `eventType` field (`octopus.py`, withholding Happy Hours from the join selector); (2) `binary_sensor.saving_session`'s active check in `get_saving_session_data()` reads the time window only — **the #5615 bug: a joined Happy Hour turns the sensor on** — with the fix merged as PR #5617 (merged 2026-10-24; it skips only events resolving to `WEEKEND_HAPPY_HOUR` via the event-type map, never gating on type presence, because the legacy fall-through for a type-less joined event is deliberate and pinned by Test 6 in `test_octopus_url.py`); (3) the planner's joined-event loop reads the **published** `event_type` attribute (`octopus.py`, the free-slot branch before any saving-slot logic) — a fix at one site does not cover the others. Underpinning shape — pre-PR #5727 the raw `joinedEvents` GraphQL selection carried only `eventId`/`startAt`/`endAt`/`rewardGivenInOctoPoints` (no type field on the joined side), so a joined event's type could only be resolved by looking its `eventId` up in the `event_type`/`code`/`reward` maps built from the **available** `events` list, and a joined event absent from that list had `event_type: None` and was treated as an ordinary saving session. **Since PR #5727 (merged 2026-10-24) the selection carries `eventType` and every consumer reads `event.get("eventType") or event_type.get(eventId)`** — the map lookup is now the fallback (for joined events whose own record carries no eventType — older cached responses), the #5615 sensor-half skip uses the same joined-event-first read, and pre-#5727 logs resolve types only through the maps. On the flexibility-API path the query returns no available list at all (`events: []` in the mapped result) and `eventId` is set to the event **code**, so a Happy Hour arriving only through that path is *suspected, not tested*, to stay priced as a paid session. Plan impact is limited to one branch: the synthetic 30-minute saving slot fires only when `state` is on **and** `joined_events` is empty (octopus.py), pricing the current half hour at the session rate by `load_saving_slot()`'s in-place `+=`; Happy-Hour-only `joined_events` never reach it — if a reporter ever shows Predbat itself mispricing a free hour rather than just the sensor, look there. Two rate-provenance reports from mid-September. **GH#5012** (car unplugged, plan still charged the house battery in the phantom cheap window): `octopus_intelligent_ignore_unplugged` correctly removed the planned dispatches, but the cheap price came from the integration's own rate sensor, not Predbat's stamping — parse the debug yaml and compare, per suspect minute, `rate_import_base` vs `rate_import_no_io` vs `io_adjusted`: a cheap price present in base and no_io with `io_adjusted` empty is the integration's rate sensor; present only after no_io is Predbat's `rate_add_io_slots()` stamping (#4516/#4950 family); `io_adjusted` populated means the minutes were flagged as adjusted — but **since PR #5304 (v9.3.3) Predbat's own `rate_add_io_slots()` flags the minutes it lowers too** (it used to write no marker at all; it mirrors the integration's `is_intelligent_adjusted`, never the fixed off-peak, time over the daily cap, or a cancelled car), so a populated `io_adjusted` no longer discriminates the integration's stamp from Predbat's own; the base-vs-`no_io` comparison still does, and `rate_replicate()` still refuses to copy `io_adjusted`-flagged minutes into future days. Since PR #5396 (merged 2026-10-05, unreleased at the time of writing) a minute is not marked `io_adjusted` at all when the dispatch price is within `IO_RATE_TOLERANCE` (0.01p) of what it replaced - the unrounded tariff's 5.2314p off-peak receiving a 5.23p dispatch is dp2 rounding, not a dispatch (GH#5392). This attributes "integration feeds the wrong price" vs "Predbat stamps the wrong price" in one step. Nothing reverts `io_adjusted`-flagged minutes when the car is unplugged + ignore_unplugged is on — that fix would be an enhancement, blocked in practice by the integration not flagging stale adjusted entries (`io_adjusted` was empty in this dump). **The plan-output provenance channel cannot express "dispatch" (GH#5567, enhancement, 2026-10-16, code-read on main):** the JSON plan's `import_rate_adjust_type`/`export_rate_adjust_type` are built in `output.py` from the `rate_import_replicated`/`rate_export_replicated` maps, which `Output.adjust_symbol()` maps to offset/future/user/manual/increment/saving and no dispatch value — `rate_add_io_slots()` stamps `self.io_adjusted` and never the replicated maps, and dispatch minutes sit inside the fetched-rate horizon so `rate_replicate()` does not tag them either, while saving/free and Axle sessions do tag `"saving"` there (octopus.py/axle.py) — that asymmetry is the #5567 ask, not missing stamping. Two traps for any fix: `io_adjusted` has **two producers** — the integration feed fills it via `minute_data(adjust_key=...)` as well as Predbat's overlay in `rate_add_io_slots()` — so a placement after the overlay loop in fetch.py is what covers both; and a dispatch overlapping the fixed IOG off-peak band is not marked on either path (the stamp only marks minutes whose rate actually dropped), so a "dispatch" tag must pick its semantics ("this rate came from a dispatch" vs "a dispatch covers this minute") — maintainer call, and `tests/test_rate_add_io_slots.py` pins the stamp contract. **`io_adjusted` itself was for a while wiped by the export/gas fetch (GH#5286, fixed in PR #5290, merged 2026-09-28):** `fetch_octopus_rates()` replaced `self.io_adjusted` on every call, so the export and gas fetches that follow the import fetch reset it to `{}` whenever `metric_octopus_export`/`metric_octopus_gas` were set — regression from #2826 dropping the old "only when adjust_key is set" guard — and with no markers left, `dynamic_load_car_strip_feed_rates()` had nothing to strip, so a car cancelled out of a dispatch still left it priced cheap and the house battery planned into it. The fix makes `self.io_adjusted` replaced only when the fetch carries an `adjust_key`; keep the mechanism for pre-#5290 logs. A companion fix (same PR) stops a compared tariff inheriting the live tariff's dispatch markers — each compared tariff now starts with none, and one left on the live import rates gets a copy. A user who instead wants the house battery limited to minutes the car actually charges has no clean knob (GH#5065): `octopus_intelligent_charging` off does **not** stop the stamping — the switch gates only car planning and vehicle prefs, planned slots are collected into `self.octopus_slots` regardless (gated only by `octopus_intelligent_ignore_unplugged`, which covers unplugged, not plugged-in-but-deferred) and are consumed unconditionally by `rate_add_io_slots()`. `octopus_slot_max: 0` is not selective either — the cap is applied in `load_octopus_slots()` as well as `rate_add_io_slots()`, so it removes the car's charging slots too. The only complete workaround is unsetting `octopus_intelligent_slot`, which loses completed-slot tracking and Octopus car planning with it. **GH#5018** (tariff switched mid-day; tomorrow's export rates stayed on the old tariff and Nordpool estimates never appeared): Predbat re-reads Octopus rate events from HA every fetch cycle (`fetch_octopus_rates`), so stale export rates are the HA integration still serving the old contract — reload the integration. Two Predbat-side traps in the same report: `futurerate` only fills *missing* minutes (the `if minute not in rates` gate in fetch.py), so stale-but-present rates always win over Nordpool estimates; and `futurerate_adjust_auto` re-runs at every FutureRate init (one per fetch cycle) and persists via `set_arg`, so mid-switch it can persist `False` over the user's manual `futurerate_adjust_export: true` — log signature `FutureRate: No futurerate adjustment enabled, skipping futurerate analysis` repeating every cycle. The debug yaml does **not** contain the Octopus rate events (grep for `day_rates` comes up empty), so replays can't reproduce integration-served rate data; use the log's `Export rates: min/max/average` lines as the provenance check (identical min/max across days = static served data, and a fixed tariff has a fixed shape while a variable one doesn't). **A tariff-switch staleness class beneath that, with the event to blame and why it self-heals (GH#5503, 2026-10-12, code-read on main 40b9ce28):** `fetch_octopus_rates()` concatenates the previous-event, current-event then next-event rate slices in that order (`data_all += ...`, octopus.py) and `minute_data()` is last-write-wins, so a **next_day_rates event still carrying a slice priced by the old tariff shadows the current-day event** wherever they overlap — the integration resolves the agreement for each day's feed independently, so the mixed feed (yesterday = new tariff, today+ = old) self-heals hours later on the integration's own refresh: the #5018 pattern of "suddenly correct with nothing changed" after a switch. The next-day read is also the only one of the three that **warns nowhere on empty** (the previous and current reads log `No Octopus data in event ...`), so a next-day event that never refreshes is invisible until prices move. Attribution sequence that settles one without HA access: (1) `rate_import_base` from the debug yaml — if base and final `rate_import` share the bad shape, every Predbat overlay is innocent; (2) timeline the per-cycle `Import rates: min/max/average` lines to pin the flip (or prove it never flips); (3) query the public Octopus API (`/v1/products/{product}/electricity-tariffs/{tariff}/standard-unit-rates/?period_from=...`, no auth) for the tariff the logs say is wired — and remember a `compare_list` entry's `rates_import_octopus_url` is never the live rate source (the top-level key is), and `FutureRate: Detected import tariff ...` only reads `tariff_code` off the sensor for Agile detection. Product-code trap, probe-verified in that run: a fixed product can **renew under the same code** (COSY-FIX-12M-25-09-24 still publishing current-window rates at the old prices), so never conclude "a 2025-dated product can't hold this month's rates" without the API check. `self.mpan` is the **import** MPAN only — `async_find_tariffs()` sets it once from the first active import agreement's `meterPoint` and never overwrites it; an account with export has import and export as separate agreements with different MPANs, and the export one is retained nowhere (PR #4972 review). The saving-session/free-electricity GraphQL queries use `self.mpan` deliberately because those campaigns are import-side; any feature that needs to identify a *meter* cannot take `self.mpan` (PR #4972, merged 2026-09-19, adds `self.tariffs[direction]["mpan"]`). Symptom: two things that should describe different supply points coming out identical — that is this, not a deduplication bug. **GH#5144** (fixed in PR #5145): the REST tariff endpoints return overlapping `DIRECT_DEBIT`/`NON_DIRECT_DEBIT` rows for the same validity window and `minute_data()` writes each row over its range, so whichever row came last in the response won — and the order is not stable across periods, so the displayed rate could flip between variants from one period to the next ("always the higher rate" was an artefact of that ordering, not a property of the bug). `filter_payment_method()` (`utils.py`) now keeps one variant at the parse point on the component, day/night, annual and minute-data paths — preferring `DIRECT_DEBIT`, keeping rows with no `payment_method` (Agile) untouched, and leaving single-variant tariffs unchanged; null `payment_method` is the common case, so any future filter must keep nulls. **The daily cheap-slot cap is derived per account but enforced per car (GH#5215, semantics unresolved):** `get_octopus_slot_max()` (`octopus.py`) takes no `car_n` — it resolves the cap from the *account's* import tariff code via `has_six_hour_cap()` (matches `IOG-SMB` → 12) or a single apps.yaml integer — while both enforcement counters are locals (`slots_per_day` in `rate_add_io_slots()` and in `load_octopus_slots()`), and both callers run once per car, so each car draws a fresh budget: up to `octopus_slot_max × num_cars` cheap half-hours priced per day. Do **not** assume the docs' per-car sentence is simply wrong: the derivation is account-level but Octopus's own blog says "*Your car gets up to 6 hours of off-peak charging per day*" (quoted in GH#4830, the multi-car confusion thread), so the code is internally inconsistent and the intended semantics is genuinely open. Exposure is invisible outside IOG-SMB — uncapped tariffs default `octopus_slot_max` to 48 — so only capped multi-car installs can see the doubling; existing tests encode the per-car behaviour, and `octopus_slot_max` is read without `index=` so per-car configuration does not exist either way. **The IOG slot-confirmation strip removes the house's cheap rate too when a car's dispatch is cancelled (GH#5335, with the #5317 family - code chain on main 57ec7bf1):** with `octopus_intelligent_dynamic` on (default), `dynamic_load_car_check()` (`plan.py`) cancels every slot of a car that sits inside a started dispatch but is not seen charging after the confirmation grace (log: `car 0 is in a dispatch but not charging, cancelling its slots`), and `dynamic_load_car_strip_feed_rates()` (`octopus.py`) re-prices the house's view of those minutes back to `rate_max_base` when the cheapness came from the integration feed, **exempting the fixed IOG band** (`OCTOPUS_NIGHT_RATE_WINDOWS["iog"]` = 23:30–05:30) — so a house battery that had planned into the dispatch loses its cheap stamp as well, and PV10 re-prices the minutes at `rate_max` outright (prediction.py's `dispatch_gone` line, `minute > 30`). Version tell: the strip is v9.3.2+ code — a reporter's deliberate mid-log downgrade left the A/B in one `predbat.log`: v9.3.3 logged `Octopus Intelligent: removed the dispatch rate from 355 minutes of cars [0] which are not charging` while v9.3.1 kept the 6.57p dispatch rate (`Charging target 2%-100%`); workaround (semantics read, not live-tested): `octopus_intelligent_dynamic` off = no confirmation and no strip, ≈9.3.1 behaviour at the cost of #5229's low-load protection. Check the car side first, though: Predbat must *see* the car charging to confirm the slot, and a `plug_status` string (`eco`/`boost`) that never equals `car_charging_now_response: charging` leaves the car "not charging" through a real charge — check the sensor's own history before blaming the planner. Since PR #5725 (merged 2026-10-24) the confirm evidence is **"any car charging"** — `dynamic_load_any_car_charging_now()` (plan.py) — so on a multi-car site a car's charging-now sighting confirms a half hour even when the dispatch under test belongs to a different car (tests in `test_dynamic_load_car.py` pin it). **#5316 is the mid-dispatch variant, fixed in PR #5319 (merged 2026-10-03) — keep the pre-#5319 signature:** a car that stops part-way through a running dispatch half hour used to have the rest of that half hour re-priced at the day rate; the strip paths (`rate_add_io_slots()`, `dynamic_load_car_strip_feed_rates()`) now start from `dynamic_load_car_strip_from()` (`plan.py`) — the end of the half hour the car was last seen charging in, which is billed off-peak in full by Octopus — and the confirmation is never cleared, only outlived. Review-round refinements ride along: a sensor reading confirms a half hour only from 2 minutes into it, and the grace clock is not kept across a restart (saved state is judged on the skewed clock). The bounce symptom itself — the battery flipping Charge↔Demand while a car charges in bursts — is the supervision working as coded (GH#5390, log-verified): a non-"charging" reading counts after `DYNAMIC_LOAD_CAR_START_MINUTES` (3 min) inside the dispatch, the cheap dispatch rate is stripped from the car's still-future slots (house plan re-prices those minutes) and it resumes on the next "charging" reading — ground-truth with the hourly `Last hour: ... car X kWh` log lines against Octopus's own per-slot amounts before calling it a bug. **The low-load test path (no `car_charging_now` sensor).** A cancel via the load test needs two consecutive low 5-minute windows - the first sets `dynamic_load_car_since`, the next satisfies `timed_at − since ≥ DYNAMIC_LOAD_CAR_LOAD_MINUTES` (5 min) - and the evidence guard requires the whole trailing window to lie inside the dispatch, so the dispatch's own ramp window is eligible and starts the clock: one lagged/under-read window beyond the ramp cancels (GH#5461, verified by `git log -L` on plan.py plus the reporter's log). **A genuine cancel was fixed in PR #5462 (v9.3.7):** the live `load_power` total must now also be under the cut-off - with `load_power` unset the 5-minute figure alone decides; live load that is not low or has no reading makes a low window no evidence either way (it neither cancels nor resumes) - and the cut-off factor dropped 0.9 → 0.85 (`DYNAMIC_LOAD_CAR_LOW_FACTOR`, `const.py`) for a load sensor that under-reads while the battery grid-charges. Pre-#5462 signature: a 4.80kW 5-minute read against a 5.4kW (0.9 × 6.0) cut-off at 22:40 while the inverter reported 7410W of live car charging. The confirm/cancel band is asymmetric by design: the cheap-rate confirmation needs load at the full `car_charging_threshold` while the low/cancel classification uses the 0.85 factor of it, so the in-between band keeps the slot trusted but never confirms it. `car_charging_threshold`'s history-strip heuristic is skipped when a real `car_charging_energy` sensor is configured (fetch.py, GH#4717), so "lowering car_charging_threshold corrupts the load forecast" only holds without that sensor. **The completed-dispatch cheap stamp lives only as long as the integration's dispatch feed carries the session (GH#5413, reporter log + yaml, 2026-10-05):** `rate_add_io_slots()` stamps completed dispatches deliberately (`dispatch_billed_off_peak()` exempts `end_minutes <= minutes_now`, and the fetch merges `completed_dispatches` unconditionally), but the integration withdrawing the dispatches when a session closes removes the stamp retroactively (`io_adjusted` reads empty, `rate_import`/`rate_max` all back at the day rate hours later) and the plan-History re-render derives past minutes from the **current** rate tables (`history_to_future_rates(self.rate_import, ...)`, and `today_cost()` re-prices today-so-far), so the flip is the display of the un-stamped arrays - no persistence of applied rates exists (open GH#2785, PR #3340 parked); the narrower fix is persisting the stamped/completed minutes. A tell from the same log worth keeping: those midday dispatches were visible only from their own start minute, so a "cheap slot Octopus never offered" question on an *ad-hoc* dispatch is different from the overnight band, which is visible hours ahead. **A second in-family trigger — elapsed half hours of a live dispatch priced at base until the completed feed lists them (GH#5520, code-read on main 40b9ce28, 2026-10-12):** nothing promotes `flexPlannedDispatches` into `completed_dispatches` (#4114/#4115, deliberate — phantom cheap slots), `trim_started_dispatch()` (octopus.py) advances an in-progress dispatch's start to now each cycle and a cached planned dispatch fully ended is dropped outright, and the merge into `octopus_slots` takes completed (supplier feed only) + planned (fetch.py), so for the observed 15–60 min between a half hour ending and `completedDispatches` listing it those minutes sit in **neither** list — `today_cost()` re-prices them at base mid-day, then falls back (`dispatch_billed_off_peak()` bills ended dispatches off-peak regardless of location once the feed confirms). **Fixed in PR #5533 (merged 2026-10-14, v9.4.0) — keep the mechanism for pre-#5533 logs:** `octopus_held_update()`/`octopus_held_dispatches()` (`octopus.py`) now remember the half hour a planned dispatch was *seen running* in and re-inject it as a finished dispatch until a completed dispatch overlaps it or `OCTOPUS_DISPATCH_HOLD_MINUTES` (90) expires — a dispatch still to start is never held, neither is a cancelled one; the held record used to be memory-only — held half hours are now saved to Storage when they change and restored at startup (PR #5581, 2026-10-17), so a restart inside the hold no longer loses them. The GH#5520 row in the symptom table below carries the log tell and the test (`octopus_dispatch_hold`). **Poll-trim mutates the stored boundaries of a running dispatch (GH#5702, triaged 2026-10-23, still live — trim re-verified on main ef1432be):** `trim_started_dispatch()` (octopus.py) advances a running planned dispatch's `start` to the poll time and scales `charge_in_kwh` to the remainder, and the mutation travels: it is published as the `binary_sensor._intelligent_dispatch` attributes, read back by fetch.py and merged into the per-car `octopus_slots`, so `decode_octopus_slot(raw=True)` returns the boundaries only *modulo the last poll* — the last <5 minutes of a long dispatch read as a fresh short dispatch and re-price at the day rate (`dispatch_too_short()`), the tail minutes leave the cap accounting (`take_cap_minutes()`), `octopus_planned_running()` rejects the tail so the held half hour is not refreshed, and `octopus_held_dispatches()` leaves the held half hour out while a planned entry still reaches it; it self-heals the cycle after the dispatch ends. Dynamic-load confirmation is trim-invariant (the confirm key is the `round_out_to_period()` half hour), so a `car_charging_now` sighting in the half hour rescues the tail — the visible effect needs the half hour unconfirmed (no `car_charging_now` sensor, or the car genuinely stopped). The HA-integration path (`octopus_intelligent_slot` fed by the BottlecapDave integration) does not trim — only the built-in component does. Test-module gap: `test_octopus_dispatch_hold.py` never runs a cycle on the last <5-minute tail of a long dispatch. **The same trim starves the post-dispatch dynamic-load baseline (GH#5762, triaged 2026-10-26, reproduced exactly with a triage-probe on the reporter's logged floors):** `dynamic_load()` (`plan.py`) subtracts car energy only via `in_car_slot()` over `car_charging_slots`, rebuilt every cycle from the trimmed dispatches, so a running dispatch's trim-tracked start covers only 1–2 of the 5 lookback minutes, and on the first cycle after the dispatch ends `load_octopus_slots()` drops the ended slot (`end > minutes_now`) so nothing is subtracted at all — car-scale load sits in the baseline and the plan drains the battery until the next 5-minute recompute. Symptom line is `Dynamic load adjust is setting load minimum` on the plan's "Home" load right after an Intelligent dispatch ends. Impact is bounded: with a `car_charging_energy` sensor `max(sensor, planned)` covers it, and the full-rate fill fires only when a `car_charging_now` entity is configured — so it needs a site with neither. The existing dynamic-load tests cover only car slots with full lookback coverage; a repro must build the slot list exactly as the trim leaves it (start = poll time, kwh scaled to remainder). #5702 above is the tail side of the same trim; #5602's "car energy lands in house load" is the yesterday-reconstruction path — a third mechanism again. **Account-dependent (GH#5544, 2026-10-13):** on some accounts `completedDispatches` stays `[]` all day, clean status-200s included, so that 15-60 min #5520 gap is unbounded there; and because planned slots are deliberately never promoted and per-device `completed_dispatches` is the only retained record (cached in `async_get_intelligent_devices()`, merged back each cycle by `fetch_previous_dispatch()`, pruned >5 days), a finished slot the feed no longer lists re-prices permanently for the day and is baked into yesterday (`calculate_yesterday()` reads the recorded `predbat.cost_today` sensor history, not re-pricing). A parsing trap in the same family: that account's planned entries carry a negative raw kwh figure, which `decode_octopus_slot()` abs()es (`octopus.py:3398`) - exactly what keeps them past the past-slot `kwh <= 0` skip in `rate_add_io_slots()`; do not "fix" the abs(). The current half hour stays covered because `rate_add_io_slots()` round-outs the trimmed start (`round_out_to_period`, octopus.py) — so the step is at past half-hour boundaries, not at the running one. The built-in component auto-wires only `octopus_intelligent_slot`: there is no second planned-slot sensor to cover the gap the way `octopus_intelligent_planned_slot` does on the Ohme/external path (PR #5443's shape). Log-comment trap: the `Elapsed minutes keep theirs - they record what the tariff charged` comment inside `rate_add_io_slots()` is written for the dynamic-load *cancellation* path and holds for the half hour in progress only — a reporter quoting it correctly does not make it mean elapsed minutes in general stay cheap; a future #5520 fix is pricing-only, never planned→completed resurrection (+ precedent: #5443 covering the end→feed-confirmation gap; #4917's trust gate overlaps the "keep cheap only where the car was seen charging" idea). `test_rate_add_io_slots` passed at triage but covers cap/eligibility/io_adjusted only — no trimmed-or-dropped-dispatch scenario. `calculate_yesterday()` rebuilds the previous day from the *recorded* `predbat.cost_today` sensor history, not by re-pricing, so any confirmation arriving after midnight can never correct a finished day's totals. **Octopus Intelligent devices freeze in place once the account leaves an Intelligent tariff (GH#5412, probe-verified on main 2026-10-05, still live):** `async_update_intelligent_devices()` returns before polling when the import tariffCode is not Intelligent, so the live-set pruning never runs off-IOG and everything built while on the Intelligent tariff persists - `automatic_config()` wires from `self.intelligent_devices` tariff-blind, the storage cache round-trips the devices, `fetch_sensor_data_car_planning()` keeps taking the Intelligent branch and rebuilding `self.octopus_slots` from the frozen entities' dispatch attributes every cycle, and `rate_add_io_slots()` keeps stamping completed dispatches (with the ~96h look-back) - the Ohme half flips `octopus_intelligent_wanted()` false on the new tariff but `charger_slots_wanted()` refuses while `octopus_intelligent_slot` still points at the frozen Octopus entity, so the #5401 charger-schedule mode stays blocked until the wiring is cleared by hand. #5405's owner re-wire (`car_slots_released_to_us()`) treats the not-refreshed device list as a live constraint on purpose - it refuses to re-wire off an Intelligent tariff, which is the same freeze acknowledged, not removed. **A related clobber to read before any "my manual octopus_intelligent_slot keeps reverting" report:** with `octopus_automatic: true`, `set_arg()` overwrites unconditionally and `automatic_config()` re-wires whenever the device dict is non-empty, so a user's own apps.yaml entity is replaced on the first run after every restart; since #5405 only the *empty-set clearing* respects foreign wiring (it checks the wiring is still what Octopus itself last wrote) - "the user is not affected" holds only under `octopus_automatic: false`. **Weekend Happy Hour / Power Up booking is not implemented (GH#5404, enhancement, 2026-10-05):** Predbat reads only the booked/allocated side (the free-session `events` attribute and `joined_events` with `event_type` WEEKEND_HAPPY_HOUR → `octopus_free_slots`); `available_events` is consumed only by the Power Down auto-join loop (`join_octoplus_power_down_session_event` plus the deprecated saving-session fallback, #4593) and WHH entries never reach it - they are skipped at the source (cannot be joined through the API - Octopus allocates them or the user books on the website) and Power Up entries ride in `available_events` at 0 octopoints, skipped by the min-octopoints guard; no WHH join service exists anywhere. If a join half is ever built, the saving-session auto-join block is the template and Power Up needs a slot *choice* among 2-3 candidates, with an explicit rule for weekend slots released Thursday that partly sit beyond the 48h horizon; the `events` attribute carries both available (code set) and auto-joined (`code` null) entries and the free-session path zero-rates them all regardless of booking state. **A moved (or cancelled-then-rebooked) Happy Hour booking keeps the old slot priced free (GH#5778, triaged 2026-10-27, blocked on a live-API experiment):** the joined-events loop prices an event free on **presence alone** and the query requests only eventId/startAt/endAt/reward/eventType — the marking that would expose a moved booking (`eventStatus`/`resultsStatus`) is neither requested anywhere nor logged, and the joinedEvents response body is **not in the debug dump**, so no reporter attachment can show what the account was actually marked; the cheap interim telemetry is adding `eventStatus`/`resultsStatus` to the `octoplus_saving_session_query` selection and logging the raw values for joined Happy Hours. Whether a moved and its replacement booking share one eventId is unknown (the id-keyed reward/code/type maps would conflate them). Verified nuance: Happy Hour cannot be priced on the flexibility-campaign path — `async_get_flexibility_events()` maps campaign events into `joinedEvents` with no `eventType`, where they fall through to the rewarded-session branch and are skipped — Happy Hour is legacy-query only, so "Happy Hour never prices free while other saving sessions do" can mean the account is served by the campaign path. **Free electricity has exactly one source, and past events are plan-inert (GH#5614, verified on main 063549db, 2026-10-18 — start `async_get_flexibility_events()` (octopus.py) on any "free_electricity (or saving_session) sensor stale/off" report):** the `customerFlexibilityCampaignEvents(campaignSlug="free_electricity", last: 50)` query (octopus.py) stores to `self.free_electricity_events` and the sensor's `events` attribute and on/off state mirror that list verbatim — the attribute has **no** end>now filter (the available-events half of saving sessions does filter, `get_saving_session_data()`), so a frozen attribute means a frozen upstream list, not a Predbat filter. **Saving sessions has a designed legacy fallback, free electricity does not:** "No saving session events from flexibility API, falling back to legacy query" is the designed path (no-MPAN or empty flexibility answer) and is itself diagnostic — the campaign endpoint is not populated for that account. The count line = API content: "Found N … via flexibility API" logs the decoded edges for `last: 50`, so N < 50 means the API holds no more than N events for that campaign+supply point; in #5614 the count (15, all 2025) proved the campaign data itself was frozen at 2025-10-25 while the legacy feed and the Octopus integration showed 2026 sessions — staleness upstream, not a Predbat filter. `totalCount`/`pageInfo` are decoded but pagination is never followed, so a campaign exceeding 50 events truncates silently (which end survives depends on the API's edge ordering — unverified). Past events are plan-inert: `load_free_slot()` bounds every slot (`start_minutes >= 0`, end clipped, and import slots apply `min(rate, rate_dict[minute])` so a stale event can never *raise* an import price, octopus.py), so a frozen historical list just means the plan misses current sessions. `self.mpan` (first active import meter's MPAN) is the query's supply point; a supply-point mismatch is the alternative explanation for 2026 events assumed missing (unverified lead). The API's response body is already in the user's log — `async_graphql_query()`'s log gate records it in full when it changes — read those lines before asking for new evidence (a long-frozen response's body may have rotated out of an older log). Poll cadences (octopus.py, verified): account/tariff 30 min, flexibility events (both slugs) 10 min, dispatch sensors 2 min — don't diagnose "never updated" from sub-10-minute gaps. Version-field trap: the issue template's "1.7.1" was the HA addon packaging version, not the Predbat release — place a reporter by matching main's exact log-wording instead. Companion #5615 (saving_session sensor on for a joined Happy Hour) is the other published-sensor problem in this area — separate feeds, separate paths. **The vehicle-catalogue lookups match by make+model *name*, last match wins (GH#5438, code-read on v9.3.6):** `async_get_intelligent_devices()` matches account devices against the global GraphQL catalogue (`intelligent_catalogue_query`) by name only — both the charge-point and vehicle loops assign on every match and keep the last, so when a model name lists several variants (zappi "(all models)" is listed at 7.4 and 22.0 — three-phase variants share a name) the last list entry wins and the order is the API's, not Predbat's. The device dict (`charge_point_power_in_kw` / `vehicle_battery_size_in_kwh`) spreads into the component's own `intelligent_dispatch` entity attributes, `automatic_config()` wires `octopus_intelligent_slot` to that entity, and `fetch_sensor_data_car_planning()` reads them back — battery size **replaced outright** when truthy (recalculating the car SoC), and rate via `max(rate, configured)` (the "Take the max as Octopus over reports" comment is an #2855-era line predating the catalogue) — so when the catalogue figure is too high, both the rate and the battery size are unreachable from apps.yaml while the component runs. Symptom: `Car 0 rate from Octopus is 22.0kW and configured rate 7.4` repeating every cycle; on an IOG-wired car `plan_car_charging()` is skipped entirely, so the bad rate skews charging-now modelling and battery-size-derived limits rather than the slot list. Cosmetic but reliable marker for this path: the catalogue returns `powerInKw`/`batterySize` as **strings**, `_clean_number()` refuses strings, so the coordinator drops both car `ratings` entries every poll with `value does not fit the container's type - dropped`. Test gap: `test_octopus_catalogue_cache.py`/`test_octopus_intelligent_devices.py` fixtures have a single variant per name, so ambiguity is never exercised. **Fixed in PR #5439 (b88cbd8d, 2026-10-12):** `catalogue_value()` (`octopus.py`) now chooses deliberately between disagreeing matches — `min` for a charge point's power (the most every variant can do), `max` for a vehicle's battery size — instead of last-match-wins, warns once per make+model+field (`catalogue_ambiguity_logged`), and the component hands on the **lowest** of differing power figures (`fetch.py`'s "Car N rate from Octopus" path notes the choice). **A partial GraphQL response wipes the planned dispatches for a poll cycle (GH#5492, maintained-filed with a full log, verified on main d6985b6d 2026-10-11 by code read):** `async_get_intelligent_devices()` runs the per-device dispatch query with `ignore_errors=True`, and `async_graphql_query()` returns `body["data"]` whenever the body has one - the auth-retry and full-error bail live in front of that return, so a 200-with-`errors` "partial" response comes back *as data* and its `errors` array never reaches the caller. Octopus's KT-CT-4340 blip ("Unable to fetch planned dispatches") is exactly that shape: `flexPlannedDispatches: null` inside truthy data, which `dispatch_result.get("flexPlannedDispatches") or []` turns into a real `[]` that is parsed and stored over the cache - so the car's slots + cheap dispatch rate vanish for one ~2-min poll cycle, `intelligent_dispatch_replan_check()` sees a signature change and requests a replan (two extra replans per blip; the reporter measured 7/230 dispatch polls failing in a day), and with no `car_charging_now` sensor the battery hold releases while the car charges. PR #5250's fallback ("reusing the last known planned dispatches") covers only the fully-failed query (`dispatch_result is None`) and already prunes ended dispatches and re-trims the in-progress one, so the fix is to route the null/absent value into that same branch - the value being `null` rather than `[]` is the practical failure signal, because the `errors` array is not visible to the caller. **Fixed in PR #5493 (0bca948b, 2026-10-12):** `flexPlannedDispatches is None` now routes into that same keep-last-known branch (prunes ended dispatches, re-trims the in-progress one, warns `Dispatch fetch failed for intelligent device ..., reusing the last known planned dispatches`) — keep the pre-#5493 signature (one-vanishing-planned-poll, silent) for older logs. Completed dispatches are unaffected either way (the parse merges into the cached list seeded per device). **Kraken contrast:** Kraken's `async_graphql_query` treats any `errors` in the body as a full failure and returns None regardless of `data`, so its dispatch cache survives partial responses - the check for any future octopus-vs-kraken discrepancy question. The partial-response shape is covered in `test_octopus_intelligent_devices.py` since #5493 (the KT-CT-4340 null case). **The same null-is-not-empty shape hits other `ignore_errors=True` Octopus queries (PR #5750, 2026-10-25, seen in a live log and a production log, pinned by tests):** the devices list can answer `{"devices": null}` with KT-CT-4360 ("Device status could not be fetched") on one device's `status`. `status` is non-null in the schema, so one device's error nulls the whole list, and the identical query worked 3 s earlier. `savingSessions.account` can come back `null` with OE-0003 ("Temporary service error"), which dropped a joined Weekend Happy Hour mid-session (GH#5745). In each case `null` means that part failed, and the real "none" is `[]` (an account with nothing joined has `joinedEvents: []`). Pre-#5750 signatures, for older logs: a failed devices list is silent and the dispatches go stale until the list answers again; OE-0003 shows as `User has not joined Octopus saving sessions campaign` followed by `Octopus free slots changed`; and any single 504 on `get-flexibility-free-electricity` dropped the free electricity events. From #5750 each logs a `Warn:` line saying it is keeping the last known data or refreshing the known devices. **Still exposed after #5750 (review follow-up; code shape re-verified on main 2026-10-29):** `events` or `joinedEvents` nulled beside an error on `octoplus_saving_session_query` still flows unguarded through `get_saving_session_data()` (`octopus.py`) — `.get("events", [])` returns `None` when the key exists with a null value and the per-event iteration raises TypeError — unverified whether Octopus actually nulls these two, the same likelihood class as the `account` null that was only discovered by happening. **Pre-#5750 poisoning nuance (GH#5745):** the wipe was sticky — the caller assignments were unconditional, so after one partial-error wipe later plain failures returned the emptied cache and the post-incident log looked healthy while the day's remaining free windows were already gone; a 504 in the log *after* an OE-0003 wipe was the poisoning mechanism, not recovery. Separately, the SmartFlex device `provider` field is deprecated (2026-10-15, removal on or after 2027-04-15) — as of 2026-10-25 **neither** query asks for it: the Octopus one via PR #5750 and the Kraken one via the #5754 follow-up (`KRAKEN_DEVICES_QUERY` now fills the stored provider from make, per its comment). Log-reading note since PR #5428 (0dbcce38, 2026-10-12): repeated GraphQL requests/responses (and skipped Happy Hours) are logged **briefly** between full logs (`RepeatLogGate`, `REPEAT_FULL_LOG_SECONDS`, octopus.py) — "no response lines in a window" can be the gate summarising rather than the poll stopping; a failure logs the request in full. **Meterless export (GH#5595, fixed in PR #5597, merged 2026-10-18) — keep the pre-#5597 signature for older logs:** `async_find_tariffs()` used to gate on `(isActiveMeter and isActiveAgreement)` with `isActiveMeter` set only inside the meters loop, so an active export agreement on a meterPoint with `meters: []` skipped the whole block including the #3505 OUTGOING/EXPORT fallback and export rates vanished silently (log tell: `Adding import tariff` but never `Adding export tariff`). #5597 adds `isUnmeteredExport = not meters and isActiveAgreement and isExportTariffCode` (octopus.py) alongside the old gate, warns that Octopus may not be metering/paying export until the meter is linked, and its tests cover the shape (Tests 8-10, `test_octopus_url.py`); rates themselves need no deviceID (`fetch_tariffs()` works off productCode/tariffCode alone). Trade-off the fix accepted (reporter risk note): Predbat may plan export before Octopus meters it — a future report of unpaid export while the meter is unlinked is the accepted trade-off, not a new bug. Test-name trap: `test_async_find_tariffs` (test_octopus_url.py) tests `async_find_tariffs()` (account-data discovery — the #5595 surface), `test_octopus_fetch_tariffs` (test_octopus_misc.py) tests `fetch_tariffs()` (the rates fetching half) — the name overlap has cost time. **A withdrawn dispatch leaves the feed-published discount in place (GH#5663, log+yaml verified on main 2026-10-20):** every discount-removal path keys on the car's **current** dispatch list — `rate_add_io_slots()` stamps only slots that exist, and `dynamic_load_car_strip_feed_rates()` builds its minutes from `self.octopus_slots[car_n]` (plus the `octopus_intelligent_consider_full`-gated `octopus_surplus`) — so once Octopus withdrew a dispatch (with no completed record) the feed's cheap price survives everywhere: the feed rows carry both the price and the `is_intelligent_adjusted` mark, the strip has nothing to key on, and a zero strip never logs (the gate is `if stripped and stripped != ...`). Signature: the `removed the dispatch rate` lines fall silent exactly when the charge begins. Diagnose in the debug yaml: `rate_import_no_io` still cheap at the phantom minutes with no matching dispatch in `octopus_slots`, and `io_adjusted` marked with no backing dispatch entry. Predbat's `today_cost()` re-uses the same stale table, so it cannot settle the true billed rate — ask the reporter to confirm from their half-hourly usage data; and under the window billing rule (`dispatch_billing_window()`) the feed discount *is* the billing truth for the whole planned window and must not be stripped. Family: #5012 (ignore_unplugged survivorship), #5080, the #4516/#4946/#5316 trust/stamp family. **Since PR #5657 (merged 2026-10-20) a short dispatch is cheap only where the car was seen charging:** a dispatch under `OCTOPUS_SLOT_MIN_MINUTES` (5) is off-peak only in a half hour `dynamic_load_car_confirmed_periods` recorded (`dispatch_too_short()`), and the confirmed-set records a half hour only from `DYNAMIC_LOAD_CAR_CONFIRM_MINUTES` (2) minutes into it (`minute % 30 >= 2` in `dynamic_load_car_target()`), so a blip starting on or just after a half-hour boundary is never confirmed even though Octopus bills the half hour off-peak — the report shape is "a 14:00/00:00 one-minute dispatch's half hour shows the day rate although the car charged in it; a :13 one works" — and the 5-minute load average cannot rescue a one-minute draw (a 7 kW minute averages to 1.4 kW, under the confirm threshold). The new `{int: set(datetime)}` state serialises as `!!set` in the debug dump without a `DEBUG_EXCLUDE_LIST` entry (checked against the #5569 unhashable-key class). **A slow-charging car reads as "not charging" through the load-test path, and Predbat cancels real dispatches (GH#5706, triaged 2026-10-23 against 333c358c, all-default config verified from their dump):** with no `car_charging_now` sensor the load test needs load ≥ `dynamic_load_car_low_kw()` = `DYNAMIC_LOAD_CAR_LOW_FACTOR` 0.85 × `car_charging_threshold` for the whole trailing `DYNAMIC_LOAD_CAR_LOAD_MINUTES` (5 min) window — a 1-2.4 kW smart charge under the threshold's 4 kW config-UI minimum (3.4 kW cutoff) reads "low" the whole time and cancels (the live-load-must-also-be-low #5462 guard covers telemetry lag, not genuinely slow cars — tests 60-67 in `test_dynamic_load_car.py` codify low+low→cancel and pass on main). Unit trap: `car_charging_threshold` is held in **kWh per minute** (`car_charging_threshold_kw()`, plan.py) — a dump's `car_charging_threshold: 0.1` is the 6.0 kW default, not a misconfiguration. Lead for a fix: #5318 (use `car_charging_energy` as dispatch evidence); workarounds: a real `car_charging_now` entity (the sensor path bypasses the load test) or `octopus_intelligent_dynamic` off. And the plan-table car kWh `?` marker is deliberate — `car_charge_slot_kwh_cancelled()`/`kwh_cancelled` (output.py): it marks a slot *Predbat itself cancelled*, so have the reporter find the `Octopus Intelligent: car N ...` lines before treating it as slot uncertainty (the cancelled kWh sit in `slot["kwh_cancelled"]`). **Day/night DST is fixed (PR #5655, merged 2026-10-20) — keep the mechanism for older logs:** the recurring late-October/March `octopus_url`::`day_night_rates` failure (`Expected 16 rate entries (8 days), got 15`) was a product bug, not a test-only one — `async_get_day_night_rates()` built each day's anchor with `local_midnight + timedelta(days=…)` and re-normalised the pytz-localised result, so on the GMT day after the autumn change `26 Oct 00:00+01:00` normalised to `25 Oct 23:00` and `replace(hour=0)` pulled the anchor back a day, duplicating a night date and collapsing the 16 windows to 15 (the dropped-window day-gap check then skips because the final pair overlaps). The fix builds local windows naive and localises each end (`_localise_wall_clock()`), keeping 16 contiguous windows; the same bug was what ran `octopus_url` red at every PR for ~6 days each autumn/spring (it clears by itself after the change). pytz technique for any future DST work here: a localised pytz tzinfo is a specific-offset instance that **still carries the zone's full transition table**, so `tz.localize()` on a datetime holding a specific-offset tzinfo still honours DST rules (raises Ambiguous/NonExistent, and `is_dst=True` on an ambiguous wall time returns the earliest-by-UTC occurrence) — do not "simplify" it to `replace(tzinfo=…)`, which is the wrong-era-offset bug for pytz zones (only zoneinfo-style zones want `replace()`). **Since PR #5639 (merged 2026-10-24) the cap is enforced on one shared per-account budget in clock time** (`octopus_account_slots()`, octopus.py — re-verified on main), flipping the GH#5215 enforcement: `octopus_account_slots()` builds the day budget from *every* configured car's slots in both `rate_add_io_slots()` and `load_octopus_slots()` (rebuilt from scratch on each call, order-matched so the two grant the same cheap minutes), deliberately leaving the plan side counting a cancelled car's (`dynamic_load_car_strip_from()`) and surplus minutes while the rates side withholds them — so a multi-car "car plan shows a slot where the rates aren't cheap (or vice versa)" report has a cross-car cap cause in addition to the per-car period-stamping one; keep the pre-#5639 per-car reading for older logs (the 6-hour cap's per-account semantics remains an Octopus-unconfirmed assumption — if per-car, the shared-budget switch counts a shared minute once per car in both counters). **Third-party free-hours feed shapes (GH#5707, triaged 2026-10-24, configuration):** the two free-hours args and the saving-session arg read different attributes — `octopus_free_session`/`octopus_free_electricity` read `attribute="events"`, `octopus_saving_session` reads `joined_events`/`available_events` — so pointing `octopus_saving_session` at a free-hours feed (the third-party stevekirtley EDF integration publishes free sessions under `events`, deliberately shaped so Octopus tooling works unchanged) silently finds nothing: log shows `Regular expression argument octopus_saving_session matched ...` but the dump's `octopus_free_slots`/`octopus_saving_slots` stay empty, and external (non-Predbat) entity states are not in the dump — read the integration's source. One-pass log checks that localise the class: `Octopus: free events code ...` (decoded) → `Setting Octopus free session in range ...` (rate array written); collect-sans-apply ⇒ the horizon gate (fixed since #4931); neither ⇒ shape mismatch. Native free-hours support on the Kraken/EDF component arrived with PR #5730 (2026-10-25): EDF Flextras booked free hours (only `SELECTED` slots count as booked) published as a free electricity sensor wired to `octopus_free_electricity` — EDF-only, E.ON Next has no Flextras; Octopus-shaped saving-session support on Kraken remains enhancement #5291. **A saving-session state without slots is dead by construction (verified 2026-10-27):** in `get_saving_session_data()` the "In saving session that's not reported" phantom-slot block and the `Octopus Saving session is active!` log sit nested **inside** the `if joined_events:` block — `not joined_events` can never be true under it, so `octopus_saving_session` alone (state on, no events) can never produce a slot or log "active"; plan-inert, and a cleanup PR would fold them to the sibling level the comment assumes. **"Octopus rates/GraphQL stopped working" can be the domain, not Predbat (GH#5786, enhancement/priority_medium, live-probed 2026-10-27):** Octopus is migrating to `api.oegb-kraken.energy` — live-probed serving the identical public REST v1 API and GraphQL (products list byte-identical, the Agile rates set set-equal) while the **old domain is fully alive with no redirect**, so this is forward-compat work, not a regression: probe both domains with a plain curl before diagnosing code. The hardcoded scope (non-test) is `base_url`/`backend_url` (octopus.py, ~`:529-530`) plus the four literal REST URLs in it, `tariff_catalogue.py` (`_OCTOPUS`) and `annual_load.py` (`OCTOPUS_API_BASE`), plus doc/config examples; the new name fits the in-tree Kraken family (`api.edfgb-kraken.energy`/`api.eonnext-kraken.energy`, kraken.py). Unsettled and unknowable from outside: the switch-off date (the forum announcement thread is members-only) and the **backend host's successor** — `api.backend.oegb-kraken.energy` did not resolve in DNS at probing and `api.backend.octopus.energy` (base for saving-sessions GraphQL without a JWT prefix) has no visible destination; settle from the forum before patching. | `octopus_*`, `saving_session*` | | Kraken / EDF (`kraken.py`) | EDF Kraken answers a day/night-structured tariff with **HTTP 400** on `standard-unit-rates/` (`{"detail": "This tariff has day and night rates, not standard."}`) while `day-unit-rates`/`night-unit-rates` return 200 and standing charges 200 — where Octopus four-rate products (GH#4921) answer the same-shaped URL **200 with empty results**. So the "empty results, then data empty" signature belongs to `octopus.py` and a hard 400 to `kraken.py`; do not carry the expectation across (GH#5166, probed against the live API). A nonexistent product still 404s, so 404 and 400 are both live "REST can't serve this tariff" signals on EDF — probe the exact URL from the reporter's log before assuming either. **Fixed in PR #5167** (`async_fetch_rates()`): the GraphQL `applicableRates` fallback now gates on `KRAKEN_REST_RATES_UNAVAILABLE_STATUSES` = (400, 404, 410), per direction (404 covers both a private product and one retired from the REST API; the authenticated retry stays 404/410 because auth cannot change a 400), and only counts a failure when the fallback comes back empty without counting one — `async_graphql_query()` counts its own failures, so a caller that also counts scores 2 per down cycle; snapshot the counter around the call. The standing-charge fallback stays deliberately 404/410-only (`kraken.py` — "400 is a rates-endpoint-only answer"). Two traps from the fix's review: `_fetch_rates_rest()` returns `(None, None)` on a network error, so `err is None` does **not** mean success — success is `(results, None)`; the merged code stashes the public attempt's status and restores it when the authenticated retry hits a network error (pre-fix symptom: a private-product tariff's rates vanish for one cycle with no fallback log line, while an identical 404 one cycle later recovers). The day/night endpoints' rows carry the same `payment_method` variant overlap as GH#5144 — now **probe-confirmed on EDF too (GH#5502, triaged 2026-10-12)**: `async_fetch_standing_charges()` (`kraken.py`) reads `results[0].value_inc_vat` of the public `/standing-charges/` response with no payment-method filter, and live EDF returned overlapping current-period rows with `NON_DIRECT_DEBIT 61.186` at index 0 against `DIRECT_DEBIT 52.317` — so the published standing charge is the non-Direct-Debit figure (the reported 61.186p vs the EDF-confirmed 52.317p), while the unit rate survived only because the DIRECT row happened to sort later and `minute_data()`'s last-write-wins merge keeps it; flip the row order and the unit rate breaks the same way. `filter_payment_method()` (`utils.py`, PR #5145) replays correct on the live EDF rows unchanged — it is the reusable fix — and the GraphQL fallback `async_fetch_standing_charges_graphql()` reads `applicable_charges[0]` with its query requesting no payment-method field (whether the account-scoped endpoint can return overlapping methods was not probed). Suspect this first on any E.ON standing-charge-too-high report; not probed on E.ON's base URL. **Fixed in PR #5568 (4845a227, 2026-10-17):** the REST standing-charge response is now run through `filter_payment_method()` — keeping the DIRECT_DEBIT row, leaving no-`payment_method` rows (Agile) untouched and single-variant tariffs unchanged — so the wrong-variant pick is gone on current main. Also benign: `Warn: Kraken: Auth not available for find-tariffs` repeating on early restarts before the first `Tariff discovered` line is setup-phase, not a second bug. **SmartFlex dispatches ride the Octopus rule machinery with no provider distinction anywhere in the path (GH#5521, code-read on main 40b9ce28, 2026-10-12):** `_publish_dispatch_sensors()` (`kraken.py`) publishes `octopus_intelligent_slot` from SmartFlex planned/completed dispatches "exactly like Octopus IOG", so every Octopus rule applies to Kraken dispatches — `dispatch_billed_off_peak()`'s location test for in-force ones, `trim_started_dispatch()` advancing an in-progress start to now (the GH#5520 elapsed-half-hour mechanism), the finished-`kwh<=0` drop, and the not-charging cancel + strip under `octopus_intelligent_dynamic`. `has_six_hour_cap()` (`octopus.py`) still keys on "IOG-SMB" only, so a provider's own dispatch cap is not modelled. The `kraken_provider` apps.yaml arg itself only feeds the component's constructor (the registry's `"config": "kraken_provider"`, `components.py`) — the instance attribute `self.provider` stayed invisible to Predbat's plan-side rules until PR #5581 read it through `self.components.get_component("kraken").provider` inside `dispatch_billing_window()` (octopus.py). Kraken dispatches refresh on a 2-minute cycle (`KRAKEN_DISPATCH_REFRESH_MINUTES`), so an "observed in force" record is never more than ~2 min stale. Any E.ON/EDF "cost or plan looks wrong around EV smart charging" report starts here. **Fixed in PR #5581 (3ef4eccb, 2026-10-17):** new apps.yaml setting `intelligent_dispatch_billing` (`dispatch_billing_window()` in `octopus.py`) — `auto` (default) takes the window rule when the Kraken component runs on provider eon; under the window rule every half hour a planned dispatch was in force is billed off-peak whether the car charged in it or not (a zero-kWh completed entry no longer takes back a held half hour), slot confirmation never cancels (plan.py's `dynamic_load_car_active()` gained `and not self.dispatch_billing_window()`), `octopus_intelligent_consider_full` no longer withholds surplus dispatch minutes, and the held half hours are saved to Storage and restored at startup. **The rate sensors' published attributes are unbounded (GH#5534, enhancement, 2026-10-13):** `_publish_rate_sensors()` (`kraken.py`) writes the whole `self.import_rates`/`export_rates` list into the `rates` attribute, state = `len(...)`, no time window, and on a fixed multi-month tariff the REST fetch returns the entire active contract period (the 3-page REST cap is the only limit; `_normalize_rate_timestamps()` only normalises), which then **stops growing at the cap (GH#5572 correction, 2026-10-16):** `run()` reassigns `self.import_rates` on every refresh, so once capped the in-memory list, the 7-day storage cache and the sensor hold the newest ~page_size×3 rows and no more — the post-cap harm is the capped warning on every refresh (`KRAKEN_RATES_REFRESH_MINUTES` = 30) plus 3 wasted page requests, not contract-life growth (the reported 255 rows / 37.8 KB arrived through ≤3 capped pages). **Fixed in PR #5571 (61108741, 2026-10-17):** the published `rates` attribute is now window-trimmed by `_published_rates()`/`_rates_in_window()` to roughly −(forecast_days+1)d→+(forecast_days+2)d around `midnight_utc` — the full list stays only in memory/storage and the state is the number of periods published — so the recorder glob below is the pre-#5571 workaround. The FAQ's recorder section covers only the `predbat`/`predheat` domains plus named entities - provider-component entities follow `sensor.predbat___` (`get_entity_name()`) and none are covered, so any future `State attributes ... exceed maximum size` warning on one of them maps here (the Octopus component's own rate sensor, stamped −24h→+48h, can also exceed 16 KB at fine plan intervals - code-read only, do not assert it from a log alone). `recorder: exclude: entity_globs: [sensor.predbat_kraken_*, binary_sensor.predbat_kraken_*]` is the workaround; exclusion wins over include in HA's recorder filters. Predbat itself is unaffected (it reads these entities live via `get_state_wrapper()`), and a publish-side window is safe for the consumer only while it keeps roughly ±(forecast_days+1) days: `fetch_octopus_rates()` → `minute_data()` bounds writes to that band around midnight_utc (`utils.py:1414`) rather than dropping past rows, so the Octopus rate sensor's −24h→+48h stamp (`octopus.py:2166`) is the in-repo precedent shape. Do not recommend the global `recorder: exclude: attributes: [rates]` variant - it strips the attribute from Predbat's own recorded-by-design sensors too. **Kraken REST facts (GH#5572, 2026-10-16):** rate rows arrive **newest-first** (confirmed from a real reporter paste in GH#5534) — a capped/truncated fetch keeps every future rate and silently drops the *oldest* history; plan-safe, because the sole consumer `fetch_octopus_rates()` → `minute_data(..., backwards=False)` bounds every write to a band around `midnight_utc` (`utils.py`), so an "X rate missing from the plan" report on Kraken should not start at the page cap. The REST fetch's page size is never set by Predbat (`build_rates_url()` returns the bare `standard-unit-rates` URL — `KRAKEN_RATES_PAGE_SIZE` serves only the GraphQL fallback), so the cap is 3 × whatever page size the provider defaults to; derive it from a real response or a live probe, never assume 100. **GH#5573 (standing charge, remainder carved from PR #5568 — which fixed only the payment-method half — 2026-10-16; still live on current main, re-verified 2026-10-18):** both standing-charge fetchers pick a bare first row — REST `results[0].get("value_inc_vat")` (first page only) and GraphQL `applicable_charges[0]` from a −1d→+2d window — with **no `valid_from`/`valid_to` coverage check** either way; the Octopus component's `_get_rate_for_time()` (`octopus.py`) is the in-tree fix pattern (skips future-`valid_from` rows, latest `valid_from` wins). Wrong standing charge is cost-reporting only — it enters the prediction metric only for the final saved plan (`prediction.py`) — so priority_low; REST and GraphQL standing-charge row ordering is unverified (do not assume newest-first from the unit-rate fact), and `./run_all --test kraken` passes with nothing pinning covering-row selection (GH#5584's point 3 is the same gap — fix together rather than opening a new ticket). **Fixed in PR #5737 (`_standing_charge_covering()`, kraken.py, merged 2026-10-24):** a row applies when `valid_from <= now < valid_to`, a null or unparseable bound is open, and the latest covering `valid_from` wins (non-dict rows ignored) — same rule as `OctopusAPI._get_rate_for_time()`; keep the bare-first-row mechanism (REST first page, GraphQL `applicable_charges[0]`) for pre-#5737 logs. The earlier in-flight covering pick, PR #5636, was still open alongside it at the 2026-10-26 flush — check its state before opening a duplicate. The contract any validity-window helper depends on is unchanged: `str2time()` returns tz-aware values only — the naive-string `ValueError` that `strptime_aware()` (`utils.py`, from PR #5653) now guarantees on every Python version — so a validity-window helper must compare against `datetime.now(timezone.utc)`, because comparing a naive `datetime.now()` against an aware stamp raises `TypeError` outside the parse `try`, and the skip-the-bad-row handler never fires. **Kraken auth/liveness (GH#5580/#5582 — the silent half fixed in PR #5583, c028cd4f, 2026-10-17; re-verified on main 2026-10-18):** `oauth_failed` latches on a genuine credential rejection and clears only on component re-init; a CDN/WAF block on the mint sets `token_mint_edge_blocked` and backs off instead — the latch is never set by rate limiting (GH#4850). Since #5583 `is_alive()` is `api_started and not oauth_failed` and `health_message()` names the login (E.ON Next began rejecting the email/password mint with HTTP 400 around 16 Oct 2026; the E.ON message points at `kraken_auth_method: api_key`), so a mid-session token death now surfaces in predbat.status. Previously the mid-session latch was invisible to every health signal: `update_success_timestamp()` ran on cache-only cycles (`had_success or self.current_tariff`, including republishing the tariff sensor from cache), so the 60-minute is-alive staleness gate never expired, `oauth_failed` fed only the account_status sensor and run() returned True mid-session. The fresh-restart path was always visible — run() returns False while `first` when the mint is refused or no tariff is known (`if first and (self.oauth_failed or not self.current_tariff)`) — that is the +10-min `wait_api_started` block, see the Component-health row. Log-reading signatures: a repeating `Warn: Kraken: Auth not available for ` with no mint attempt in the same window is the latch short-circuiting every refresh, not "auth works, token not needed"; `Token request failed with HTTP 400` appears only at start/re-init (the latch suppresses the rest); a 403 carrying a CDN-block body is rate limiting (backoff, no latch); and the failed mint's GraphQL error body is logged redacted (`summarise_token_errors()`, since #5583 — pre-#5583 never logged, so a reporter quoting a 400 body could not be confirmed from the log). KT-CT-1124 (expired JWT) is in `KRAKEN_AUTH_ERROR_CODES` now (it was missing, so an expired-JWT error used to self-heal only via the next refresh cycle) — read it as "refreshed and retried in-cycle" on current main. The public REST rate fetch is unauthenticated and kept working hourly through the GH#5580 E.ON auth outage — an "E.ON stopped working" report with continued `Fetched ... rate periods` lines is auth-side only; check for rate-fetch lines before believing the whole API is down. **Failure accounting (GH#5584):** `failures_total` is diagnostic-only — an `account_status` attribute, not a liveness input; the count-once guard for an expected-status GraphQL fallback is the rates path (`failures_before` snapshot, `kraken.py`); `async_fetch_standing_charges()` counts the REST error even on an expected 404/410 before falling back, so "standing-charge failure counts climbing every cycle on a TOU tariff" maps here (counts-once fixed in PR #5641, merged 2026-10-24 — keep the pre-#5641 climbing-count signature for older logs). Also **fixed in PR #5641 (merged 2026-10-24):** a 200 whose JSON body is not an object — an array, null or a bare string, which would have raised `AttributeError` at `data.get("results", ...)` outside the `(aiohttp.ClientError, asyncio.TimeoutError)` except clause — is now treated as a failed fetch with `Warn: Kraken: Invalid response fetching rates: expected a JSON object, got ` (the in-tree precedent for the class is #5619's non-object-200-on-GivTCP failed read); keep the pre-#5641 AttributeError signature for older logs. **EDF Flextras booked free hours (PR #5730, merged 2026-10-27, a4f2f408) — symptom → module for any "EDF plan wrong around their free hours" report:** endpoint `GET https://www.edfenergy.com/support/energyhub/api/weekend-saver/v1/{account_id}/{property_id}/ui/hours` with `Authorization: ` (no Bearer prefix) and a `Accept: application/json` request; the property id comes from a root-level Kraken GraphQL `properties(accountNumber:)` query cached in the component's storage blob, and the fetch refreshes every 30 min (`KRAKEN_FLEXTRAS_REFRESH_MINUTES`) with every attempt stamped, so an off-Flextras account costs one request per period. Payload: `components[] → type == "BOOKED_HOURS_LIST" → props.items[].rawTimeSlots[] {date, startTime, endTime, status}`; times are **UK wall-clock despite being labelled UTC** (converted with `ZoneInfo("Europe/London")`), and only `status == "SELECTED"` (or no status) counts as a booking on main (`parse_flextras_booked_hours()`, kraken.py — the review's "presence == booked" concern was fixed before merge, so a non-SELECTED slot logs a Warn naming it; check that filter first on a "Predbat plans a handed-back hour as free" report). Future hours the screen stops listing are dropped — the screen is authoritative, customers move/hand back hours until the Thursday before — while an already-started session is kept until the day after it ends (`keep_after = midnight_utc − 1 day`; `ComponentBase.midnight_utc` is the **local** midnight, so the timezone-frame trap above applies) so today's history is not re-priced, and an active hour survives an empty/failed screen read because it is kept from `flextras_sessions`. Wire-out rides the existing free-slot path (`octopus_free_electricity` arg; the events attribute carries `{start, end, code: "flextras_…", rate: 0}` handed to `load_free_slot()`, which clamps to the forecast horizon): Predbat's free-session 3-day lookback does **not** apply on this feed. Replay CLI: `python3 kraken.py --flextras [--property-id X]` with `--config apps.yaml` prints property id, HTTP status, raw screen and parsed hours. Platform fact reached while reviewing it: the predbat addon builds all five architectures from `ghcr.io/hassio-addons/ubuntu-base:10.0.5`, so the system `/usr/share/zoneinfo` database is present and runtime `ZoneInfo` needs **no `tzdata` in requirements.txt** (the Kraken component is the app's first runtime ZoneInfo user; the standalone Dockerfile was not inspected — re-check before raising "addon lacks tzdata"). | `kraken` | | Kraken VAT basis (`kraken.py`) | The two rate sources are on different VAT bases. REST `standard-unit-rates/` carries `value_inc_vat`; GraphQL `applicableRates` has a single undocumented `value` (live introspection on EDF, E.ON and Octopus shows `ApplicableRate` = `value`/`validFrom`/`validTo`, no descriptions) which the BottlecapDave-derived EDF integration (`stevekirtley/HomeAssistant-EDFEnergy`, `api_client/agreement_tariffs.py`) treats as **exc-VAT**. That is that integration's assertion — nobody has yet posted a raw `applicableRates` value beside a bill, so a "rates are 5% out on the fallback path" report is the chance to confirm it. Predbat labelled the value inc-VAT until the fix that scales it by the import agreement's `standingCharge / preVatStandingCharge` (both on the `TariffType` interface on EDF and E.ON). Dead end to skip: the Octopus public GraphQL reference says nothing on VAT for this query. GB domestic electricity is zero-rated 1 Oct 2026 - 31 Mar 2027, so inc and exc are equal in that window and a wrong basis cannot show; the GraphQL `applicableStandingCharges` fallback is still assumed inc-VAT and is unverified either way. | @@ -155,14 +156,14 @@ Grep for the named symbol rather than trusting a line number. | Load forecast & scenario hedging (`fetch.py`, `plan.py`) | Two forecast facts from the "battery empties before evening ends" family (GH#5198). With `days_previous_auto` (the default) the forward load is `compute_load_forecast_history()` — a per-5-minute-slot weighted **mean** using built-in weights (weekday-match 1.0/0.7/0.5 × recency 0.9→0.1 over the window, verified against the docstring on main); the user-tuned `days_previous_weight` list only drives the legacy per-day path that shapes the in-day comparison chart and the 8-hour load-divergence metric, not the forecast — start there on "my weights don't change anything" or "the forecast targets the mean" reports. The downside hedge is the PV10 scenario: its load series is stepped with `load_scaling10` (clamped in `fetch_config_options()` so `load_scaling90 <= load_scaling <= load_scaling10`), and `compute_metric()` blends the scenarios as a **signed weighted average** — `pv_metric10_weight` (default 0.15) plus the expert `pv_metric90_weight` (default 0.15, only when PV90 was simulated) — so a reporter who raised `load_scaling` alone has zero extra load in the PV10 scenario and the 0.15 weight hedges PV risk only; `load_scaling10` is the concrete lever. Load ML publishes a point forecast, no percentile band, and the scenario machinery is source-independent — switching to ML adds rate-awareness, not variance budgeting. Enhancement flagged on GH#5198, not built: size the pessimistic load from the 8-hour σ the divergence metric already computes. **New-install first-days gap fixed in PR #5553 (merged 2026-10-15, v9.4.0; GH#5548) — keep the mechanism for pre-#5553 logs:** under `days_previous_auto` `compute_load_forecast_history()` sampled only whole calendar days before today, so a fresh install's not-yet-recorded times of day had no sample at all (base load, previously 0) and the forecast was skipped entirely under a day of history; a slot with no previous-day sample now takes today's sample at that time-of-day once reached, then the recorded average of everything so far, then base load. Today never contributes where a previous day has data, so an established install is unaffected, and elapsed today-slots predating the install stay at base load (they used to read the recorded average and could push the in-day adjustment to its floor). | none | | iBoost (`plan.py`) | `plan_iboost_smart()`'s inner rate-averaging loop indexed the *outer* loop's `minute` instead of the inner `slot_start`, so the "average" always collapsed to the rate at the window's start minute (GH#4817, fixed in PR #4821). Two things worth carrying forward: the `iboost_smart2`/`iboost_smart3` golden scenarios in `test_model.py` were pinned to the buggy output and had their expected values regenerated by the fix, and the `iboost_smart` unit test passed throughout because its fixture uses a flat rate that cannot expose an averaging bug. A sibling defect in the same function - a duplicate-slot guard that checks a stale loop variable and so never fires - was found and deliberately left unfixed. **GH#5454 (enhancement, verified by reading main):** the docs contradict the code on combining the modes - `docs/customisation.md` says iboost_smart "only applies when iboost_solar and iboost battery are both Off" while `fetch.py`'s gate is `((not iboost_solar) and (not iboost_charging)) or iboost_smart`, so the smart plan is built whatever iboost_solar says and `prediction.py` consumes `iboost_plan` without checking `iboost_solar` (the solar branch is additive on top) - quoting the docs as "the modes are exclusive" is the wrong answer to a "why did rates+iBoost both run" report. **The combination is grid-first:** `plan_iboost_smart()` fills each day's budget to `iboost_max_energy` with cheap-rate slots and has no PV input at all, the budget is consumed in time order in the prediction, so an overnight cheap slot spends the budget before midday solar and solar diverts only what no cheap-enough slot claimed - with the default `iboost_rate_threshold` the planner books the entire daily cap and solar gets nothing. `iboost_rate_threshold` min is -10 (`config.py`), so a ≤0p-only boost is already configurable in rates-only mode. Adjacent work: open PR #4756 (demand-forecast planning on `plan_iboost_smart()`) is where planner solar-awareness would build; mirror-image car ticket #5384; the `test_iboost.py` smart tests use a flat rate, so a solar-vs-rate priority bug cannot show. | `iboost_smart` | | Component auto-config gate (`components.py`) | `components.py:705-708` decides whether to print a `Warn: Skipping interface, missing required configuration` by checking whether *any* of the component's declared args appear anywhere in `args_from_apps_yaml` — not whether that component's own identifying args are set. `gecloud_data` lists `days_previous` among its constructor args, a core scheduling setting that ships uncommented in the default `config/apps.yaml`, so the gate is truthy and the warning fires on installs with no GE Cloud configuration at all (GH#4786). **That half is fixed** - `950dda36` / PR #4813, released in v8.54.0, made the gate skip args flagged `shared_config` (`components.py:781`) and flagged `days_previous` in the `gecloud_data` definition; re-driven through `Components.initialize(only="gecloud_data")` on 2026-08-31 with the reporter's exact config, no warning. The `solar` sibling **was** then reproduced and still fires: `pv_forecast_today/tomorrow/d3/d4` ship uncommented as `re:` regexes in `apps/predbat/config/apps.yaml:291-294`, so on a battery-only install their raw strings sit in `args_from_apps_yaml` while matching nothing, and the component warns it "needs at least one of" four args the user never wrote. `shared_config` alone cannot fix that one, because `pv_forecast_today` is itself in the component's `required_or`. A "component seems half-configured" report is worth checking against this gate before trusting the warning at face value. | none | -| Component health (`components.py`, `component_base.py`) | Three different signals, only one of which means "answering now". `count_errors` (`get_error_count()`) is a **lifetime counter** - incremented only when `run()` returns False or raises, never reset on success, and startup backoff books its expected retries through it - so "in error, N errors so far" can describe a long-recovered component. `api_started` means "run() returned truthy once", not "serving data": the Gateway component's `run()` deliberately returns True while `_auto_configured` is False so an offline device cannot stall startup (`gateway.py`), so a broker-less gateway flips `api_started=True` with zero data delivered. The current-health accessors are `is_alive()`/`last_updated_time()` (`components.py`), with a 60-minute staleness test. Separately, `record_status()` writes the raw message as the literal HA state of `sensor.predbat.status` (`dashboard_item()`) with nothing truncating on the path, and HA rejects states over 255 chars - long user-facing text belongs in an attribute (no limit) with a truncated state. Test trap: `update_status()` can call `record_status()` twice per cycle (charge window, then export window) and every call overwrites `self.current_status`, so a test that runs a full `update_status()` and asserts on `current_status` only ever sees the export-window message - capture between calls or assert on log output (found reviewing PR #4992). And the `run_timeout` watchdog is inert against blocking compute: `ComponentBase.start()` awaits `asyncio.wait_for(asyncio.shield(task), timeout=self.run_timeout)` on the component's **own** loop, which can only time out if that loop regains control — blocking compute never yields, so the watchdog never fires (GH#5075: `LoadMLComponent._do_training` calls the sync `train_curriculum()` with no offload). **Corrected 2026-09-22:** an earlier version of this entry said the components share the main event loop and a blocking call stalls shutdown, HA callbacks and every other component — wrong on both counts. Components are not tasks sharing one loop: `Components.start()` starts each one through `base.create_task()` (`hass.py`), which spawns a real non-daemon OS thread per component running its own `asyncio.run()` — so a sync CPU-bound call inside an async component method blocks **only that component's** loop; other components and the main loop keep running. The real cost is shutdown: `stop_all()` (`hass.py`) calls `terminate()` — which stops every component, logs each "Stopped" and "Predbat terminated" — and then `t.join(5 * 60)` per component thread; a component whose `run()` has not returned keeps its thread alive, so the join waits up to 5 minutes and after the timeout the interpreter's own non-daemon-thread shutdown waits again, without a timeout. That is why a #5075 log can show "Predbat terminated" with training still logging minutes later. The misleading "Lock released - event loop is free during training" comment is still in `load_ml_component.py` on main; PR #5112 (open draft, unmerged) fixes load_ml both ways — `asyncio.to_thread` plus a `stop_callback` on `LoadPredictor.train()`/`train_curriculum()` checked per epoch and per curriculum pass — and rewrites the comment. Note freeing the loop alone is **not** sufficient to make shutdown prompt: the thread only exits once `run()` returns, so an uninterruptible call holds the join whether it blocks the loop or a worker the loop is awaiting — a long-running component needs both off-the-loop and a check of `api_stop` inside the long call. Symptom pointer: restart/upgrade hangs for minutes, every component logged Stopped, "Predbat terminated" printed, process still alive → find the component whose `run()` cannot return, starting with any synchronous compute inside an `async def` (load_ml first). #3448 (fixed v8.33.8) was the run-blocking flavour, serialised against the prediction pools but never offloaded off the loop, which is why the shutdown flavour survives. The watchdog's timeout path is the complement of that shutdown flavour (found reviewing PR #5112, open at the time of writing): on timeout `start()` cancels the awaiting task — `asyncio.wait_for(asyncio.shield(task), timeout=self.run_timeout)` then `task.cancel()` (`component_base.py`) — which for a worker started with `await asyncio.to_thread(...)` raises `CancelledError` at the await and leaves the executor thread running to completion, a result nobody consumes; the timeout path never sets `api_stop`, the loop re-fires `run()` on the next tick with no guard against a second concurrent run, and the cancelled run never stamps its completion markers — so two workers can race on shared state and any cooperative-stop hook keyed solely on `api_stop` never trips on a watchdog timeout. The in-tree fix shape is a per-run cancellation handle fed by `stop()`, the timeout path and `fatal_error` (`component_base.py` already treats `fatal_error` as a stop condition). Only bites once a component moves CPU-bound work off the loop — unreachable for load_ml before that, because the synchronous training pinned the loop (GH#5075). Another startup-stall shape (GH#5134, code-read): a phase-0 component whose *constructor* fails (HAInterface raising on a 502 from `/api/services` during an HA restart) leaves the dependent components constructed but never `api_started` - their `run()` short-circuits while the HA component is missing - and `Components.start()` then blocks up to the full 10-minute `ComponentBase.wait_api_started()` default on each of them, so an HA core restart costs ~12.5 min of Predbat downtime instead of the ~20s restart loop. (`HAInterface` overrides the wait to 240s, but the failed instance never constructed, so that override is not the one biting; the startup backoff caps at 128 minutes and only the 10-min wait bounds a stalled phase.) On "Predbat down/slow after an HA restart", compare the log's phase-0 timestamps against the 60s→128min backoff gaps plus the 10-min expiry. One generic first-cycle trap from GH#5177: if `run()` raises or returns False while `first` is still True, `ComponentBase.start()` keeps `first` True (it is only cleared once `api_started` is set) and re-runs the whole first-cycle block on the 60s→128min startup backoff — so a component whose `health_message()` is tied to a short cooldown shows a blank health message for most of the gap between attempts, and the run status says only `component errors: ` even though the component knows why; the pattern to copy is a diagnostic that stays set until a request succeeds (the Solis quota one did, and #5185 extended that to the datalogger cooldown). **The serial wait means one dead component costs 10 minutes of restart, and the count is the delay ÷ 10 (GH#5580, log arithmetic verified 2026-10-17):** `Components.start()` creates a component's task and blocks on `wait_api_started()` (10-minute timeout, `component_base.py`) *before creating the next task in the phase*, so a dead component eats its full window every restart and the dead-component count in the failing phase is the restart delay divided by 10 minutes (GH#5580: Kraken "failed to start" at 11:12:39, Axle the same at 11:22:39); a deterministic failure never sets `api_started`, so it consumes the window every time — E.ON Next began rejecting the email/password token mint with HTTP 400 around 16 Oct 2026 (GH#5580) — and `ComponentBase.start()`'s own ladder (60s doubling from the first retry, `backoff_interval`) keeps re-running the doomed attempt inside it. Fix shape logged on the issue (maintainer call pending): spawn all of a phase's tasks before waiting on any, bounding the wait by one timeout instead of N. Same arithmetic, opposite trigger to GH#5134 (a phase-0 constructor failure), so read them together on a slow-restart report. **An exception escaping run() is not a crash (GH#5584, code-read on main 2026-10-17):** `start()` wraps every `run()` call in a bare `except Exception` — the framework logs `Error:` + traceback, books `count_errors`/`non_fatal_error_occurred()` and retries one 60s cycle later, but **the remainder of that cycle is skipped** — anything after the raising call (publishing, wiring, further fetches) did not run — and on the `first`/startup path `api_started` is never set, so startup keeps backing off 60s→128min. Severity framing: for a component traceback report, the analysis is which steps after the raise got skipped and whether it can starve startup, not "the component crashed". And the catch-all is not total coverage: `json.JSONDecodeError` (a `ValueError`) slips through an `(aiohttp.ClientError, asyncio.TimeoutError)` except clause — kraken's own GraphQL path catches bare `ValueError` (`kraken.py`), and `gecloud.py`/`solax.py` catch `(aiohttp.ContentTypeError, json.JSONDecodeError)`, the in-repo precedents for an undecodable-body fetch. **Liveness trap: `update_success_timestamp()` on cached-data-only cycles (GH#5582).** A component whose run() stamps liveness from a cycle that only republished cache stayed healthy forever — the is-alive staleness gate never expired. The fix is an `is_alive()` override: enphase (`api_started and bool(self.sites)`) and, since PR #5583, Kraken (`api_started and not oauth_failed`) — both added after "nothing alerted me" reports; check the call sites on any component-health question for one whose run() refreshes off a cached artifact. **Empty-account convention (found reviewing the #5711 Hypervolt component pre-merge; the merged code now enacts it):** a cloud component's `run()` should return **True** when the account is signed in but holds zero devices — Wallbox's `poll()` is the precedent, and `hypervolt.py` does exactly this (`return True` with `update_success_timestamp()` left unstamped, so `api_started` is set but the 60-minute liveness check still reports the account empty) — not fall out of its no-fresh-data gate into `return False`, which never sets `api_started`: `Components.start()` blocks on `wait_api_started()` before starting the next component in the phase, so the serial-wait arithmetic (GH#5580) adds ~10 min to *every* Predbat restart and `count_errors` books every attempt. The dividing rule: returning False on missing *data* is correct liveness (the GH#5582 trap runs the other way); it is the zero-device account that must count as "started, empty". Review lesson: stub transports always carry chargers, so nothing pins the empty-account path — probe it explicitly in component reviews. | `components` | +| Component health (`components.py`, `component_base.py`) | Three different signals, only one of which means "answering now". `count_errors` (`get_error_count()`) is a **lifetime counter** - incremented only when `run()` returns False or raises, never reset on success, and startup backoff books its expected retries through it - so "in error, N errors so far" can describe a long-recovered component. `api_started` means "run() returned truthy once", not "serving data": the Gateway component's `run()` deliberately returns True while `_auto_configured` is False so an offline device cannot stall startup (`gateway.py`), so a broker-less gateway flips `api_started=True` with zero data delivered. The current-health accessors are `is_alive()`/`last_updated_time()` (`components.py`), with a 60-minute staleness test. Separately, `record_status()` writes the raw message as the literal HA state of `sensor.predbat.status` (`dashboard_item()`) with nothing truncating on the path, and HA rejects states over 255 chars - long user-facing text belongs in an attribute (no limit) with a truncated state. Test trap: `update_status()` can call `record_status()` twice per cycle (charge window, then export window) and every call overwrites `self.current_status`, so a test that runs a full `update_status()` and asserts on `current_status` only ever sees the export-window message - capture between calls or assert on log output (found reviewing PR #4992). And the `run_timeout` watchdog is inert against blocking compute: `ComponentBase.start()` awaits `asyncio.wait_for(asyncio.shield(task), timeout=self.run_timeout)` on the component's **own** loop, which can only time out if that loop regains control — blocking compute never yields, so the watchdog never fires (GH#5075: `LoadMLComponent._do_training` calls the sync `train_curriculum()` with no offload). **Corrected 2026-09-22:** an earlier version of this entry said the components share the main event loop and a blocking call stalls shutdown, HA callbacks and every other component — wrong on both counts. Components are not tasks sharing one loop: `Components.start()` starts each one through `base.create_task()` (`hass.py`), which spawns a real non-daemon OS thread per component running its own `asyncio.run()` — so a sync CPU-bound call inside an async component method blocks **only that component's** loop; other components and the main loop keep running. The real cost is shutdown: `stop_all()` (`hass.py`) calls `terminate()` — which stops every component, logs each "Stopped" and "Predbat terminated" — and then `t.join(5 * 60)` per component thread; a component whose `run()` has not returned keeps its thread alive, so the join waits up to 5 minutes and after the timeout the interpreter's own non-daemon-thread shutdown waits again, without a timeout. That is why a #5075 log can show "Predbat terminated" with training still logging minutes later. The misleading "Lock released - event loop is free during training" comment is still in `load_ml_component.py` on main; PR #5112 (open draft, unmerged) fixes load_ml both ways — `asyncio.to_thread` plus a `stop_callback` on `LoadPredictor.train()`/`train_curriculum()` checked per epoch and per curriculum pass — and rewrites the comment. Note freeing the loop alone is **not** sufficient to make shutdown prompt: the thread only exits once `run()` returns, so an uninterruptible call holds the join whether it blocks the loop or a worker the loop is awaiting — a long-running component needs both off-the-loop and a check of `api_stop` inside the long call. Symptom pointer: restart/upgrade hangs for minutes, every component logged Stopped, "Predbat terminated" printed, process still alive → find the component whose `run()` cannot return, starting with any synchronous compute inside an `async def` (load_ml first). #3448 (fixed v8.33.8) was the run-blocking flavour, serialised against the prediction pools but never offloaded off the loop, which is why the shutdown flavour survives. The watchdog's timeout path is the complement of that shutdown flavour (found reviewing PR #5112, open at the time of writing): on timeout `start()` cancels the awaiting task — `asyncio.wait_for(asyncio.shield(task), timeout=self.run_timeout)` then `task.cancel()` (`component_base.py`) — which for a worker started with `await asyncio.to_thread(...)` raises `CancelledError` at the await and leaves the executor thread running to completion, a result nobody consumes; the timeout path never sets `api_stop`, the loop re-fires `run()` on the next tick with no guard against a second concurrent run, and the cancelled run never stamps its completion markers — so two workers can race on shared state and any cooperative-stop hook keyed solely on `api_stop` never trips on a watchdog timeout. The in-tree fix shape is a per-run cancellation handle fed by `stop()`, the timeout path and `fatal_error` (`component_base.py` already treats `fatal_error` as a stop condition). Only bites once a component moves CPU-bound work off the loop — unreachable for load_ml before that, because the synchronous training pinned the loop (GH#5075). Another startup-stall shape (GH#5134, code-read): a phase-0 component whose *constructor* fails (HAInterface raising on a 502 from `/api/services` during an HA restart) leaves the dependent components constructed but never `api_started` - their `run()` short-circuits while the HA component is missing - and `Components.start()` then blocks up to the full 10-minute `ComponentBase.wait_api_started()` default on each of them, so an HA core restart costs ~12.5 min of Predbat downtime instead of the ~20s restart loop. (`HAInterface` overrides the wait to 240s, but the failed instance never constructed, so that override is not the one biting; the startup backoff caps at 128 minutes and only the 10-min wait bounds a stalled phase.) **Mechanism to check the tree on before believing it (PR #5766 review, 2026-11-01 — verified by reading + `git log -S` on hass.py):** the standalone runner (`hass.py main()`) has **no retry and never had one** — a failed `initialize()` prints, `stop_all()`s and returns; only the addon wrapper restarts. PR #5766 (open fork PR at that date; also the round whose mangled-predbat.py is under Traps) adds a 10-minute in-constructor `/api/services` retry to `HAInterface.initialize` — if/when it lands, this row's pre-merge signature changes shape: retry warns (first, then roughly every 30 s) and `did not become ready within 600 seconds` appear **before** any `Cannot initialise HA interface` line, so a "HA Core down at addon start" timeline from an older log no longer reproduces one-for-one; map by version header, not by pattern. On "Predbat down/slow after an HA restart", compare the log's phase-0 timestamps against the 60s→128min backoff gaps plus the 10-min expiry. One generic first-cycle trap from GH#5177: if `run()` raises or returns False while `first` is still True, `ComponentBase.start()` keeps `first` True (it is only cleared once `api_started` is set) and re-runs the whole first-cycle block on the 60s→128min startup backoff — so a component whose `health_message()` is tied to a short cooldown shows a blank health message for most of the gap between attempts, and the run status says only `component errors: ` even though the component knows why; the pattern to copy is a diagnostic that stays set until a request succeeds (the Solis quota one did, and #5185 extended that to the datalogger cooldown). **The serial wait means one dead component costs 10 minutes of restart, and the count is the delay ÷ 10 (GH#5580, log arithmetic verified 2026-10-17):** `Components.start()` creates a component's task and blocks on `wait_api_started()` (10-minute timeout, `component_base.py`) *before creating the next task in the phase*, so a dead component eats its full window every restart and the dead-component count in the failing phase is the restart delay divided by 10 minutes (GH#5580: Kraken "failed to start" at 11:12:39, Axle the same at 11:22:39); a deterministic failure never sets `api_started`, so it consumes the window every time — E.ON Next began rejecting the email/password token mint with HTTP 400 around 16 Oct 2026 (GH#5580) — and `ComponentBase.start()`'s own ladder (60s doubling from the first retry, `backoff_interval`) keeps re-running the doomed attempt inside it. Fix shape logged on the issue (maintainer call pending): spawn all of a phase's tasks before waiting on any, bounding the wait by one timeout instead of N. Same arithmetic, opposite trigger to GH#5134 (a phase-0 constructor failure), so read them together on a slow-restart report. **An exception escaping run() is not a crash (GH#5584, code-read on main 2026-10-17):** `start()` wraps every `run()` call in a bare `except Exception` — the framework logs `Error:` + traceback, books `count_errors`/`non_fatal_error_occurred()` and retries one 60s cycle later, but **the remainder of that cycle is skipped** — anything after the raising call (publishing, wiring, further fetches) did not run — and on the `first`/startup path `api_started` is never set, so startup keeps backing off 60s→128min. Severity framing: for a component traceback report, the analysis is which steps after the raise got skipped and whether it can starve startup, not "the component crashed". And the catch-all is not total coverage: `json.JSONDecodeError` (a `ValueError`) slips through an `(aiohttp.ClientError, asyncio.TimeoutError)` except clause — kraken's own GraphQL path catches bare `ValueError` (`kraken.py`), and `gecloud.py`/`solax.py` catch `(aiohttp.ContentTypeError, json.JSONDecodeError)`, the in-repo precedents for an undecodable-body fetch. **Liveness trap: `update_success_timestamp()` on cached-data-only cycles (GH#5582).** A component whose run() stamps liveness from a cycle that only republished cache stayed healthy forever — the is-alive staleness gate never expired. The fix is an `is_alive()` override: enphase (`api_started and bool(self.sites)`) and, since PR #5583, Kraken (`api_started and not oauth_failed`) — both added after "nothing alerted me" reports; check the call sites on any component-health question for one whose run() refreshes off a cached artifact. **Empty-account convention (found reviewing the #5711 Hypervolt component pre-merge; the merged code now enacts it):** a cloud component's `run()` should return **True** when the account is signed in but holds zero devices — Wallbox's `poll()` is the precedent, and `hypervolt.py` does exactly this (`return True` with `update_success_timestamp()` left unstamped, so `api_started` is set but the 60-minute liveness check still reports the account empty) — not fall out of its no-fresh-data gate into `return False`, which never sets `api_started`: `Components.start()` blocks on `wait_api_started()` before starting the next component in the phase, so the serial-wait arithmetic (GH#5580) adds ~10 min to *every* Predbat restart and `count_errors` books every attempt. The dividing rule: returning False on missing *data* is correct liveness (the GH#5582 trap runs the other way); it is the zero-device account that must count as "started, empty". Review lesson: stub transports always carry chargers, so nothing pins the empty-account path — probe it explicitly in component reviews. | `components` | | Run loop (`predbat.py`) | The HA-interface guard at the top of `update_time_loop()` and `run_time_loop()` (predbat.py, two near-identical copies) exists for two trigger conditions - `ha_interface is None`, and interface present with `websocket_active` False and `db_primary` False. PR #5137 (GH#5135) added the guard's two-branch wording and tested only the first, which is not the one production reaches: `ha.py` sets `websocket_active = False` on a websocket disconnect and `db_primary` defaults off, so the reachable trigger is a websocket drop on a db-primary-off install. `test_time_loop_guard.py` covers the None branch only, so a future edit to the guard's condition (dropping the `db_primary` term, swapping and/or) passes CI silently; a future "Predbat loop died / fatal_error loop" report starts there. The guard's contract lives in both copies and their log wording - a change to one copy alone looks correct and is half-wrong. | none | | HA websocket socketLoop (`ha.py`, `hass.py`) | Event/select/number handlers run **on** the socketLoop coroutine: the socketLoop awaits `trigger_callback()` (`userinterface.py`) directly at its `call_service`-event sites (`ha.py`), so an update/save-restore handler whose `call_notify()` blocks waiting for a queued service call (`async_call_service_websocket_command()` waits on `event.wait(2 * 60)`, `ha.py`) deadlocks against the same loop that would service it — self-released only by that 2-minute timer. Ordinary notifications are safe (their threads are not wedged into the loop) and manual selects are safe (entity writes go via REST `set_state` POST, not the WS queue). `Hass.run_in_executor()` (`hass.py`) builds its ThreadPoolExecutor in a `with` and returns from inside the block, so the context-exit `shutdown(wait=True)` makes every call site block its loop thread for the whole callback. Discriminator for a "notification never arrived" report: `Warn: Service call X/Y failed or timed out: result {'response': None, 'success': None, ...}` with a delay of *exactly* 2:00 and **no** `Service call timeout for request id N` line means the queued command was never dequeued and sent — the timeout path sets `error="timeout"` and logs that line, so its absence plus an all-None holder is the never-sent signature; a routed result with present-but-null `success` is the different, non-deadlocked shape (commit `2ac3a355`). Symptom combo: notifications never arrive + `Warn: Web Socket closed` right after + `failed: connection_lost` on an unrelated write in the same window = HA dropped the WS connection server-side during the 2-minute stall, and the unrelated write died when the drop was detected at resume. GH#3460 (reopened 2026-10-21, reporter on v9.4.3) — verified by reading these symbols on main plus three timestamp pairs in the reporter's log; not reproduced by test. Posted fix direction: dispatch EVENT_LISTEN_LIST callbacks off the socketLoop coroutine, and/or make `run_in_executor()` non-blocking. | none | | Carbon intensity (`carbon.py`, `fetch.py`) | The Carbon Intensity API (`https://api.carbonintensity.org.uk`) publishes only ~48h ahead and often far less - on 2026-09-06 it had nothing at all past end-of-day, national and regional alike, so an `fw48h` request from *now* returned 15h. Two consequences worth separating. (a) The API spec requires `{from}` as an ISO8601 `YYYY-MM-DDThh:mmZ` datetime; `fetch_carbon_data()` passed a bare `YYYY-MM-DD` and made *two* calls, the second from now+48h, which lands past the horizon and returns a bare `{}` with HTTP 200 - logged at `Error:` severity every fetch. That is upstream truncation surfacing as a Predbat error, not a broken integration - **fixed in PR #4958**: `fetch_carbon_data()` now makes one spec-format call built from `datetime.now(timezone.utc)` (`carbon.py:49-53`), which covers the whole published horizon, and the comment there records why UTC rather than a local date. (b) `carbon_intensity.get(minute, 0)` in `prediction.py:1279/1298` scores an uncovered minute as **zero** gCO2/kWh, so the tail of the plan looks carbon-free and `best_carbon` swings wildly between cycles (410kg vs 1365kg on consecutive runs). The zero-scoring itself is still in the code, re-verified on main; what mitigates it is `carbon_replicate()` (`fetch.py:1767`, alongside `rate_replicate`), which extends the forecast forward on the 24h cycle so fewer minutes fall through to the default. Check `metric_carbon` before calling this a planning bug - at 0p/kg it only distorts reporting. | `carbon` | | Storage cache expiry (`storage.py`) | Expiry is judged by the **real clock, never Predbat's**: `load()` and `cleanup_expired()` compare the `.meta` sidecar's expiry against `datetime.now(timezone.utc)`, and the hourly cleanup **deletes** an expired file plus sidecar — so an entry whose expiry was built from `self.now_utc` is born expired once Predbat's clock and the real one drift apart (debug replay, paused HA, tests). Every `expiry=` call site on main derives from the real clock; `save_plan()` was the last exception and PR #5100 fixed it (GH#5079). This is the counterweight to the "build test dates from Predbat's clock" trap below — the discriminator is *which clock the code under test compares against*: slot/rate logic measures against `midnight_utc`/`now_utc`, storage expiry compares against the real one. Test tip from the same investigation: before chasing a (culprit, victim) pair from the fuzzer, run the victim alone **and at more than one time of day** — a test that builds its "expired" timestamp from the fixture clock brackets the day rather than failing outright (`plan_persistence` Test 5 was broken on its own). | `plan_persistence` | | DB manager / DB engine (`db_manager.py`, `db_engine.py`) — opt-in path | `set_state_db()`'s "Convert time to GMT+0" line subtracts `utcoffset().seconds // 3600` hours, correct only for whole-hour non-negative offsets: a negative offset loses `timedelta.days` (24 h off — `timedelta(hours=-5)` normalises to `days=-1, seconds=68400`, so 19 h is subtracted instead of 5 h added) and a half-hour offset truncates (+05:30 stored as +05:00). Verified red→green through the db_manager test module (GH#5693, 2026-10-22); fix + regression test are draft PR #5698 (unmerged at the 2026-10-26 flush). `db_engine`'s read path lowercases the entity id while the write path does not, so a write of `sensor.X_case` then a `get_state_db("sensor.x_case")` returns `None` — and the index miss is `if not entity_index: return None`, which also treats a genuine index 0 as missing (test-observed; invisible in production, where entity ids are lowercase). The two write/read sites name the stamp differently: `set_state_db` returns it as `last_changed` (no `Z`) while a read-back arrives as `last_updated` with a trailing `Z` — index the read-back by its own key name and `.rstrip("Z")`, as the existing test does. `db_enable`/`db_primary`/`db_mirror_ha` all default `False`, so a db-bug impact claim applies to that opt-in population only. | `db_manager` | | Manual override selects (`userinterface.py`) | The option list for a manual override select has **three independent builders**, each ending in the same `if values not in time_values ... item["options"] = ...` tail: `manual_times()` (the time-slot selects, `manual: True`), `manual_rates()` (the rate/value selects, `manual_rate: True`) and `api_select_update()` (`manual_api` only, `api: True`; `api_select()` is its read side). A change to how the lists look or are ordered must be made in all three or the dropdowns diverge — `manual_api` is easy to miss, it lives ~100 lines above the other two and is worded differently. `manual_select()` cannot drive `manual_api`: it branches on `manual_rate` and otherwise falls through to `manual_times()`, which would render an API-command select as time slots (GH#5105, verified by reading and by driving both paths from the PR #5108 test). Two incidental details: with nothing selected `values` is `""` and that tail appends an **empty-string option** (rendered as `None` on the web config page), and nothing indexes `options` positionally anywhere — selection matches the literal `"off"` — so a reorder is safe despite `impact()` rating all three methods HIGH (they sit on `initialize`/`update_time_loop`/`run_time_loop`; the risk is cosmetic). **`manual_rates()` prunes elapsed slots every cycle, which re-prices today's cost history at base (GH#5517, code-read on main 92478319, 2026-10-12):** the per-cycle rebuild (`manual_rates()` called from `fetch.py`'s config-options pass) drops every stored override slot starting before the current slot boundary and rewrites the selection without them (`expose_config(force=True)`), and the dropdown only ever offers slots from now forward — so an elapsed slot's cheap rate vanishes from `rate_import` and `today_cost()` (output.py) re-prices those minutes at base, a single step up at the boundary equal to the elapsed slot's kWh × base rate. A past slot chosen from the dropdown is silently discarded (it is filtered before the rewrite), so there is no way to correct a past slot's cost on the select path either. Evidence trap: because the stored selection is rewritten every cycle, **a debug yaml captured after a slot has passed never shows what the user originally selected** — ask the reporter what they set the dropdown to and when. Two open PRs already cover the family — #5078 (retain manual selections 24h past the slot, absolute dates, retroactive correction) and #5425 (persist effective rates through Storage, covering manual rates and IOG-dispatch disappearance alike, the open #2785 umbrella) — duplicate-check there before opening a new fix. | `manual_api` | -| Marginal rate sensors (`marginal.py`) | The `binary_sensor._marginal_rate_now__is_cheap`/`_is_moderate` flags are **plan-relative predictions, never live inverter state** (GH#5107): `calculate_marginal_costs()` injects +1/2/4/8 kWh over the next hour (`MARGINAL_TIME_OFFSETS`) into a fixed best-plan prediction and takes the raw `run_prediction()[0]` delta. Bands: cheap ≤ 1.2 × `rate_min`, moderate ≤ max(0.5 × `rate_max`, 1.5 × `rate_min`) — on a 6.9p/28.9p tariff that is a narrow 8.3p–14.4p band. The delta **excludes `compute_metric`'s battery_value and metric_keep terms**, so battery-served extra load is priced only via displaced future import/export — while the plan is overnight charge-and-export arbitrage an extra kWh costs the *export* rate in the model, so cells flip mid-band while the battery is visibly exporting, and the overnight export slots sit near the profitability threshold and enter/leave the plan between updates. The sensors only refresh at the `calculate_marginal_costs()` call site in `plan.py`'s publish path, so they can be up to `calculate_plan_every` (default 10 min) stale. Start here on any "marginal sensor looks wrong" report; Sigenergy EMS export outside the plan is invisible to them. **The band stats read event-contaminated values (GH#5382, dump-verified 2026-10-04):** the free/saving/Axle loaders run before the final rate scan, so with an Octopus free session in the horizon `rate_min` is 0, `cheap_threshold = rate_min × 1.2 = 0` makes `is_cheap = (cost <= 0)` permanently false (a marginal cell is never exactly 0 — extra load is modelled as displacing stored battery) and `moderate_threshold` swallows everything; while the sensor's own published `rate_min`/`rate_max` *attributes* come from `rate_min_base`/`rate_max_base` (`marginal.py`) — band and attributes disagree, and the attributes are the base-tariff shape the band should follow (fix direction: derive the band from the base values it already publishes). | none | +| Marginal rate sensors (`marginal.py`) | The `binary_sensor._marginal_rate_now__is_cheap`/`_is_moderate` flags are **plan-relative predictions, never live inverter state** (GH#5107): `calculate_marginal_costs()` injects +1/2/4/8 kWh over the next hour (`MARGINAL_TIME_OFFSETS`) into a fixed best-plan prediction and takes the raw `run_prediction()[0]` delta. Bands: cheap ≤ 1.2 × `rate_min`, moderate ≤ max(0.5 × `rate_max`, 1.5 × `rate_min`) — on a 6.9p/28.9p tariff that is a narrow 8.3p–14.4p band. **PR #5756 (merged `b00dc31b`, 2026-10-31) changed the delta — the "excludes battery_value" reading below was true before it and is not now:** `marginal_plan_cost()` re-implements `compute_metric`'s battery_value term (by duplication, deliberately — `compute_metric` is a shared hot path — with a keep-in-step comment, `marginal.py:143-149`), so battery-served extra load is now priced at `battery_value_rate` (the replacement rate: cheapest future import grossed up by charge losses, capped) rather than only via displaced future import/export; the overnight-arbitrage-flips-cells observation keeps, but `metric_keep`, battery-cycle and carbon stay excluded — and so does `metric_self_sufficiency` (`plan.py:2648`), which the docstring's exclusion list omits (flagged in the PR #5756 review). Anything that edits `compute_metric`'s battery_value/value_rate must be mirrored in `marginal_plan_cost()` — a one-sided edit silently reprices every marginal cell. (A `Prediction` used in a test/replay must also be built **after** the rate table is finalised — see the `Prediction` construction trap below.) The sensors only refresh at the `calculate_marginal_costs()` call site in `plan.py`'s publish path, so they can be up to `calculate_plan_every` (default 10 min) stale. Start here on any "marginal sensor looks wrong" report; Sigenergy EMS export outside the plan is invisible to them. **The band stats used to read event-contaminated values — fixed by PR #5827 (merged `15497d83`, 2026-11-01): the thresholds now derive from `rate_min_base`/`rate_max_base`, so a free session can no longer zero the cheap band — keep the pre-#5827 reading for older logs.** The mechanism (GH#5382, dump-verified 2026-10-04): the free/saving/Axle loaders run before the final rate scan, so with an Octopus free session in the horizon `rate_min` is 0, `cheap_threshold = rate_min × 1.2 = 0` made `is_cheap = (cost <= 0)` permanently false (a marginal cell is never exactly 0 — extra load is modelled as displacing stored battery) and `moderate_threshold` swallowed everything, while the sensor's own published `rate_min`/`rate_max` *attributes* were the base-tariff shape the band should have followed — which is exactly what #5827 adopted. | none | | Manual rates (`fetch.py` `basic_rates()`/`rate_replicate()`) | `day_of_week` rules are stamped across the **whole rate horizon**, each day against its own weekday (**fixed in PR #5173**, merged 2026-09-24, GH#5168 — previously only the explicitly modelled days were filtered and the day+2 extension write seeded whatever weekday day+2 actually was not, so the *last rule processed for a time-of-day slice won* beyond the modelled days and a weekend catch-all flattened the weekday peaks exactly 48h out, every later day then taking the previous day's pattern through `rate_replicate()`, which has no `day_of_week` notion; start there on any "next-but-one day's manual rates are wrong" report). Other pre-#5173 shapes: a midnight-spanning weekday rule never reached day+2's early hours (the wrapped half seeded day+3 instead), and yesterday was checked against *today's* weekday (`int(minute_index / 1440)` truncates negative fractions to 0). Keep the mechanism for pre-#5173 logs. A consequence worth knowing before calling anything a bug on a current build: a fully-tiled manual tariff is never `rate_replicate()`d any more, so `metric_future_rate_offset_*`, `futurerate_adjust_*` and the replicated plan markers no longer touch manual-tariff minutes — "the offset stopped applying" on a manual tariff is this. **Still live — two traps that survive the fix.** A rule ending `:59:59` leaves the **final minute of every window unwritten**: `time_string_to_stamp()` floors `06:59:59` to minute 419 and the window is `range(start, 419)`, so today that minute keeps `basic_rates()`' pre-init 0 (`for minute in range(24*60): rates[minute] = 0`) and `rate_replicate()` copies it forward (probe-verified: 0p at 06:59/08:59/16:59/20:59/23:59 each day, `rate_minmax()` min 0); symptom `Import rates: min 0` / `Export rates: min 0` from a manual tariff with no genuine zero rate; workaround: end each rule at the next rule's start (`07:00:00`); in tests, assert window interiors, not exact whole-range equality. What the planner does with a lone 0p import minute is unverified (raised on PR #5173's review thread, not fixed there). And a minute left unmatched by the day filter falls to `rate_replicate()`, which applies `metric_future_rate_offset_import`/`_export`, so a test that only matches the tariff's own rates must pin that offset to 0. The fix's tests (13/14 in `test_basic_rates.py`, plus third-day assertions in 6/7) pin `day_of_week` on every horizon day in either rule order — before #5173 they asserted only today and tomorrow, so keep the lesson: a `day_of_week` regression can land green against tests that never look past tomorrow. | `basic_rates` | | Manual load adjust (`fetch.py` `step_data_history()`) | `select.predbat_manual_load_adjust` is **additive**, never a replacement (GH#5176): `step_data_history()` adds `load_adjust.get(minute_absolute, 0) * step / plan_interval_minutes` on top of the ML/historical load (floored so total load cannot go below zero), and `output.py` mirrors it for the published `load_energy_predicted`. The docs disagreement that misled the reporter ("overwrite predicted load" in docs/manual-api.md vs "adjustments" in customisation.md) was fixed by the maintainer (`c06bff91`, 2026-09-23 — docs now say "add the adjustment amount (which can be positive or negative)"), though the plan-UI cell still says only "Adjust load (kWh)" with no sign hint. Triage method: the reporter's plan HTML marks overridden slots with the `±` symbol — that marker plus the neighbouring un-marked slots attributes "applied but additive" vs "genuinely ignored" in one glance; a +0.2 on top of a multi-kWh ML slot is invisible in the SoC drop, which is the signature of "user expected replacement semantics". `load_today_comparison` (registered) asserts the additive behaviour (+1.0 → predicted load +1.0). Recurring upstream cause: free-event load baked into history — ML training has no free-event exclusion and `load_scaling_free` only scales *forecast* event slots (GH#4942 open). The select's horizon is `MANUAL_RATE_MAX_MINUTES` (7 days, `const.py`), so same-day overrides cannot be dropped by the horizon gate. Suspected, not verified: a small (~0.1-0.2 kWh/slot) systematic offset between ML sensor values and the plan's displayed load on non-overridden slots — do not do per-slot arithmetic beyond the clean case without re-deriving it. | `load_today_comparison` | | Status health (`output.py`, `predbat.py`) | False `Status: (unhealthy)` on the web dashboard (GH#5181, **still live on main**, re-verified 2026-09-26): `predbat.status`'s `last_updated` attribute is written with `now_utc_real.strftime(TIME_FORMAT)` (`output.py:2699`; `TIME_FORMAT` is `%z`, which never emits a colon on any Python) but `is_running()` parses it with `datetime.fromisoformat()` (`predbat.py:1960`), which is colon-strict before Python 3.11 — on ≤3.10 every parse raises `ValueError` → `return False` → `web.py` renders "(unhealthy)" and the API ping returns 500. On 3.11+ the relaxed parser accepts `+0100`, which is why CI on 3.14 stays green. `load_plan()` is **not** affected: its writer uses `.isoformat()` (always colon form), so that round-trip works pre-3.11 too. Trap for the obvious `str2time()` swap: it would lose the naive-string tolerance `is_running()` deliberately keeps (an install upgraded from before the timezone-aware write persists a naive `last_updated`; `web.py:988` already parses this attribute with `str2time()` — in-tree precedent but naive-intolerant) — fix the writer to `.isoformat()` or keep the naive branch. Suspected, not verified: which shipped environments actually run ≤3.10 (no addon/Dockerfile in-repo to read); no test can settle it (Python-version dependent). | none | @@ -189,7 +190,7 @@ Targeted regression: `solax`, including the automatic-config-to-`Inverter` path. | `Failed to create inverter 0: argument of type 'int' is not iterable` (or the 3.11+ wording `'int' is not a container or iterable`), then `Failed to fetch inverter data, not able to compute a plan` | A literal numeric `reserve:` in apps.yaml, e.g. `reserve: - 1`, instead of an entity id — common on inverter types with no reserve entity (reported on Huawei). `reserve_device_bounds()` (PR #4956, so v8.55.1+ only; v8.55.0 is fine) resolves the value and passes it straight to `get_state_wrapper()` as an entity id, which evaluates `"$" in entity_id` (`predbat.py:190`) unguarded and raises `TypeError`. **Fixed in PR #5005 (v9.0.2)** for the whole class, not just this call site: `get_state_wrapper()` and `set_state_wrapper()` now log `Warn: ... is a fixed value, not an entity id` and return the default / `False` instead of raising, so current main degrades the literal to an unread setting rather than crashing. Keep the crash signature for pre-v9.0.2 versions, where the bisect still reads v8.55.0 works, v8.55.1/v9.0.0/v9.0.1 fail with the same apps.yaml. Workaround (still the right one at any version): delete the `reserve:` line or point it at an entity — lossless on `has_reserve_soc: False` types, where the literal only feeds `reserve_percent_current = max(literal, battery_min_soc)` and a value at or below `battery_min_soc` (default 4) is inert. The same fault arrives in two shapes (GH#5033, GE/GivTCP + Solis): the main create path wraps `Inverter()` in try/except (`execute.py`) and logs `Failed to create inverter N: ...`, but `balance_inverters()` re-creates every inverter each cycle with `Inverter(self, id, quiet=True)` and **no try/except**, so on a multi-inverter setup the TypeError propagates through `timer_tick` as a bare traceback through `balance_inverters → Inverter __init__ → reserve_device_bounds → get_state_wrapper` — and it re-crashes every cycle even while the main path reports cleanly. A report showing a timer_tick traceback with `balance_inverters` in the stack is the same apps.yaml fault (pre-v9.0.2; the #5005 guard removes the crash source from both paths). Since PR #5149 (merged 2026-09-19) there is no unguarded balance-path construction at all: `balance_inverters()` is a pure function in `utils.py` driven from `rebalance_inverter_rates()` on the inverter poll (SoC balancing defaults off, `balance_inverters_enable`), and the single `Inverter(self, id)` construction site in `execute.py` is itself wrapped in try/except — so a bare traceback through a balance path is pre-#5149 only. | | `Error: You have not set load_today or load_forecast in apps.yaml, you will have no load data` then `Error: Exception raised ValueError` every cycle, and the plan/SoC stop updating | `fetch_sensor_data()` raises a bare `raise ValueError` (fetch.py) when neither arg resolves and nothing in the fetch path catches it — the raise unwinds the whole cycle from the fetch call site (`predbat.py`, `sensor_force_replan = self.fetch_sensor_data()`), so inverter reads, the plan and every sensor publish are skipped, and the generic `Error: Exception raised` handler catches it (GH#5092). The message and the `Error: load_today not set correctly` status both point at apps.yaml, but cloud components set `load_today` at runtime (Solis `automatic_config()`, GE Cloud `async_automatic_config()`, `sunsynk_const.py` maps it too), so during a component startup delay there is nothing in apps.yaml to fix — this is the fetch-side end of the Solis startup-outage family (see the Solis row for why the delay happens; check the Components panel for startup backoff before telling the user to edit apps.yaml). No graceful fallback exists: `self.load_minutes` persists in memory only once a previous fetch has succeeded, so a restart into a not-yet-configured component has nothing to fall back on; any fix has to decide what the planner runs on for that cycle (maintainer call on #5092). | | `Error: timer_tick caught exception: ` in the log with `predbat.status` saying `Error: Exception raised ` (often with a printed traceback just above) — "Predbat stopped planning" but no crash | An exception escaped `update_pred()` mid-fetch: the scheduled-trigger handler records the status and re-raises (`predbat.py`), then `timer_tick` catches it (`hass.py`). The app survives, but the aborted cycle computed no plan and executed nothing — find the raising function from the exception's own payload. `read timeout=20` in the exception text → `download_octopus_rates_func` (octopus.py, the 20 s `requests.get`); `read timeout=120` → `download_octopus_free_func` (octopus.py, 120 s) — the only two requests-based download paths that catch `ConnectionError` alone, and `ReadTimeout` is a *sibling*, not a subclass, of `ConnectionError` (only `ConnectTimeout` is both), so read-timeouts escape while connect-timeouts are handled (GH#5743; fix drafted in PR #5801). Exhaustiveness checked 2026-10-25: `ha.py`'s `api_call()` handles `Timeout`/`ReadTimeout`/`ConnectionError`/`JSONDecodeError` and `futurerate.py` wraps its request in `except Exception`, so any *new* `except requests.exceptions.*` narrower than those around a bounded `requests.get` is a candidate for the same escape. | -| A startup burst of `Warn: Failed to decode response from http:///api/history/period/...` then `Error: Too many API errors, stopping`, `Error: Web Socket failed to reconnect, stopping....`, `Info: HA interface stopped` — and Predbat then sits "stopped but running", web answering `/api/ping` 500 | The REST-layer **consecutive** error counter in `HAInterface.api_call()` (`ha.py`), not the websocket: a non-JSON response — which is what HA's 404 page surfaces as (`JSONDecodeError`) — plus every timeout or connection error increments `api_errors`, it resets **only on a fully successful call**, has no time decay, and at 10 calls `fatal_error_occurred()` (deliberate design since #2110 as a recovery mechanism). The websocket lines are the consequence, not the cause — the socket loop exits on `fatal_error`, waits 5s to reconnect, hits the outer break and logs the two stopping lines — so a websocket that was healthy all along is dragged down by REST-only 404s on the history endpoint. The threshold is reachable within one startup fetch: `get_history()` fetches each window in `HISTORY_CHUNK_DAYS` = 3-day chunks with nothing marking a chunk handled, so an entity's window is `ceil(max_days_previous/3)` consecutive calls (`days_previous` defaults `7` → 8 days → 3 calls per entity — `days_previous: 28+` reaches the 10 from one entity), and the boot-time full fetch is scheduled immediately at init (`update_time_loop` first fire `datetime.now()`, `predbat.py`), so a few entities' 404s back to back reach 10 in seconds. A non-2xx response **with a JSON body does not count** — it parses and is treated as data (degenerate, untested). While `fatal_error` is set `is_running()` reads False so `/api/ping` answers 500 while the web component keeps serving; standalone/Docker `stop_all()` still exits code 0 (per-thread join bounded at 5 min), so an `on-failure` supervisor policy does not restart it and the ping can answer 500 for minutes during shutdown — the official add-on wrapper restarts after ~20s. The fix is a maintainer design call in the counter (per-endpoint counting, or retry/backoff on history fetches) plus new tests, since existing tests assert the current behaviour. Related, not duplicate: #5134 (failed interface init blocks 10 min in `wait_api_started` — opposite mechanism, same "HA not ready at startup" family). **One HA outage can walk *both* mechanisms in sequence (GH#5437, 2026-10-08):** after the counter fires, a log can continue into #5134's mechanism — `Cannot initialise Home Assistant Interface` (the constructor's bare `raise ValueError` at the `ha_key`/direct-connect checks makes `str(e)` empty, hence the trailing comma with nothing after it) → repeating `HAHistory: No HAInterface available` spaced on the component startup backoff (starts 60 s, doubling — `component_base.py`; `wait_api_started()` gives up after 10 min) → the `HA interface not found` raise in `update_pred()` → wrapper restart. So a log showing that full pattern maps to both open tickets at once — don't force-close into either. `fatal_error` is initialised False once and never cleared in-process: only the web Restart button and the standalone runtime loop act on it, `Components.initialize()` runs once per process, so one interface means one attempt per process. The delta to probe before theorising: ask for the FULL predbat.log — repeated `Predbat: Startup` banners mean the restart loop is alive but not converging, no banner after the fatal lines means the process sat stopped-but-running and the wrapper never restarted it (both known mechanisms end in add-on auto-recovery: ~12.5 min in #5134's log, ~20-30 s cycles otherwise). Attribution note (GH#5580): a 502 flood against `http://supervisor/core/api/websocket` (`WSServerHandshakeError`) alongside `HA interface not found` means HA core itself was restarting — the HA `2026.10.2` update outage in that log — not any integration or Predbat component, so don't chase it through this row's counter. **The serial wait after a fatal latch is a pure sleep (GH#5744, code-read 2026-10-25):** `wait_api_started()` (`component_base.py`) polls only `api_started` — no `fatal_error`/`api_stop` check, even though `ComponentBase.start()`'s run loop exits on both — so after a fatal latch each remaining component in the phase waits its full 600 s with nothing to wait for, and `fatal_error` is never reset in-process (`predbat.py`), so the post-hang app stays stopped until a manual restart. Route a "Predbat slow/down after an HA restart" report three ways: a serial-wait hang (component failed-to-start lines 10 min apart) → open **#5134** (delay ÷ 10 min = dead components in the failing phase; the spawn-all-then-single-bounded-wait shape logged on #5580 fixes the serial cost); the `Too many API errors` latch itself (10 *consecutive* failures, incremented with no sleep, reset only by a successful call — so the counter never decays during a long outage and a *running* Predbat crosses it over successive ticks) → open **#5354**; 502-during-startup recovery → open **#5437**. Caution before tightening the 600 s timeout: `Components.start()`'s own startup backoff (retries at ~0/60/180/360 s) is what the wait races — a 120 s timeout marks failed a component that today starts on its third retry. And "the add-on restarts on exit(0)" rests on #5134's log plus the row above, not on wrapper source: the wrapper lives in the separate `springfall2008/predbat_addon` repo (out of reach from triage sessions — verify addon-side behaviour from the banner pattern, not repo access). | +| A startup burst of `Warn: Failed to decode response from http:///api/history/period/...` then `Error: Too many API errors, stopping`, `Error: Web Socket failed to reconnect, stopping....`, `Info: HA interface stopped` — and Predbat then sits "stopped but running", web answering `/api/ping` 500 | The REST-layer **consecutive** error counter in `HAInterface.api_call()` (`ha.py`), not the websocket: a non-JSON response — which is what HA's 404 page surfaces as (`JSONDecodeError`) — plus every timeout or connection error increments `api_errors`, it resets **only on a fully successful call**, has no time decay, and at 10 calls `fatal_error_occurred()` (deliberate design since #2110 as a recovery mechanism). The websocket lines are the consequence, not the cause — the socket loop exits on `fatal_error`, waits 5s to reconnect, hits the outer break and logs the two stopping lines — so a websocket that was healthy all along is dragged down by REST-only 404s on the history endpoint. The threshold is reachable within one startup fetch: `get_history()` fetches each window in `HISTORY_CHUNK_DAYS` = 3-day chunks with nothing marking a chunk handled, so an entity's window is `ceil(max_days_previous/3)` consecutive calls (`days_previous` defaults `7` → 8 days → 3 calls per entity — `days_previous: 28+` reaches the 10 from one entity), and the boot-time full fetch is scheduled immediately at init (`update_time_loop` first fire `datetime.now()`, `predbat.py`), so a few entities' 404s back to back reach 10 in seconds. A non-2xx response **with a JSON body does not count** — it parses and is treated as data (degenerate, untested). While `fatal_error` is set `is_running()` reads False so `/api/ping` answers 500 while the web component keeps serving; standalone/Docker `stop_all()` still exits code 0 (per-thread join bounded at 5 min), so an `on-failure` supervisor policy does not restart it and the ping can answer 500 for minutes during shutdown — the official add-on wrapper restarts after ~20s. The fix is a maintainer design call in the counter (per-endpoint counting, or retry/backoff on history fetches) plus new tests, since existing tests assert the current behaviour. Related, not duplicate: #5134 (failed interface init blocks 10 min in `wait_api_started` — opposite mechanism, same "HA not ready at startup" family). **One HA outage can walk *both* mechanisms in sequence (GH#5437, 2026-10-08):** after the counter fires, a log can continue into #5134's mechanism — `Cannot initialise Home Assistant Interface` (the constructor's bare `raise ValueError` at the `ha_key`/direct-connect checks makes `str(e)` empty, hence the trailing comma with nothing after it) → repeating `HAHistory: No HAInterface available` spaced on the component startup backoff (starts 60 s, doubling — `component_base.py`; `wait_api_started()` gives up after 10 min) → the `HA interface not found` raise in `update_pred()` → wrapper restart. So a log showing that full pattern maps to both open tickets at once — don't force-close into either. `fatal_error` is initialised False once and never cleared in-process: only the web Restart button and the standalone runtime loop act on it, `Components.initialize()` runs once per process, so one interface means one attempt per process. The delta to probe before theorising: ask for the FULL predbat.log — repeated `Predbat: Startup` banners mean the restart loop is alive but not converging, no banner after the fatal lines means the process sat stopped-but-running and the wrapper never restarted it (both known mechanisms end in add-on auto-recovery: ~12.5 min in #5134's log, ~20-30 s cycles otherwise). Attribution note (GH#5580): a 502 flood against `http://supervisor/core/api/websocket` (`WSServerHandshakeError`) alongside `HA interface not found` means HA core itself was restarting — the HA `2026.10.2` update outage in that log — not any integration or Predbat component, so don't chase it through this row's counter. **The serial wait after a fatal latch is a pure sleep (GH#5744, code-read 2026-10-25):** `wait_api_started()` (`component_base.py`) polls only `api_started` — no `fatal_error`/`api_stop` check, even though `ComponentBase.start()`'s run loop exits on both — so after a fatal latch each remaining component in the phase waits its full 600 s with nothing to wait for, and `fatal_error` is never reset in-process (`predbat.py`), so the post-hang app stays stopped until a manual restart. Route a "Predbat slow/down after an HA restart" report three ways: a serial-wait hang (component failed-to-start lines 10 min apart) → open **#5134** (delay ÷ 10 min = dead components in the failing phase; the spawn-all-then-single-bounded-wait shape logged on #5580 fixes the serial cost); the `Too many API errors` latch itself (10 *consecutive* failures, incremented with no sleep, reset only by a successful call — so the counter never decays during a long outage and a *running* Predbat crosses it over successive ticks) → open **#5354**; 502-during-startup recovery → open **#5437**. Caution before tightening the 600 s timeout: `Components.start()`'s own startup backoff (retries at ~0/60/180/360 s) is what the wait races — a 120 s timeout marks failed a component that today starts on its third retry. And "the add-on restarts on exit(0)" rests on #5134's log plus the row above, not on wrapper source: the wrapper lives in the separate `springfall2008/predbat_addon` repo (out of reach from triage sessions — verify addon-side behaviour from the banner pattern, not repo access). **Third stage of the same family, with its own signature (GH#5806, log-verified 2026-10-28 on a v9.5.3 single-FoxESS addon log):** a clean-exit watchdog restart can land back inside the HA outage — HA restart → mid-run `/api/states/*` writes fail → the `ha.py` consecutive-error counter latches `fatal_error_occurred()` at 10 → clean process exit within seconds (the watchdog-friendly half) → the wrapper auto-restarts ~21-25 s later → if HA is still down, the fresh boot's single `HAInterface.initialize()` probes `/api/services`, gets `ConnectionRefused`, and the bare `raise ValueError` is swallowed by `Components.initialize()` (components["ha"]=None) — one attempt per process, never retried — and the process then blocks in phase-0 `wait_api_started()` (600 s, `component_base.py`) with **total log silence**: web never starts (web is phase 0, binds in `WebInterface.start()`), so the addon's ingress UI cannot be answering in that window (treat a reporter claiming otherwise as one more thing to check). Discriminator for the family: "zombie with total silence" is this stage-3 shape, **not** the repeating-`No HAInterface available`-then-backoff shape the row above describes; still unexplained (code-read only): why the component task's own backoff loop never reprints the HAHistory lines after that single attempt — if a future log shows the post-600 s window it disambiguates. Reporter-narrative trap from #5806: the story compressed two boots into one — the "no crash, no exit" steps were the pre-latch process and the unexplained init lines belonged to the auto-restarted one. | `predbat.log` shows nothing but repeating `Loading secrets from ...` / `Loading apps.yaml` pairs at a ~20 s cadence and never reaches the `Predbat: Startup` banner | Bootstrap apps.yaml parse failure: an unknown YAML tag (a typo'd or invented `!secret`-style key - only `!secret` has a constructor registered on the SafeLoader, `load_apps_yaml()` in utils.py) raises `ConstructorError`, caught in `Hass.__init__` (`hass.py`) which does bare `print(exc)` + `sys.exit(1)` - so the real two-line error is on the **add-on console log only** and can never appear in predbat.log; its emptiness apart from the loading pairs is the tell (GH#5530, reproduced with PyYAML). The ~20 s retry is the add-on wrapper restarting on exit, the same family as the row above rather than a Predbat loop. Triage disposition on #5530: enhancement - route the error through `self.log` and hint `did you mean !secret ?`; "continue loading" is not achievable since apps.yaml is the boot config. | | `Warn: Unable to load the load forecast ... predheat.heat_energy$external` every cycle, startup validation `Invalid value None in element predheat.heat_energy$external`, and no `Predheat:` log lines despite the enable switch being on | Predheat's settings are not where the loader looks. `predheat_enable` is a Predbat UI switch, but the `predheat:` config domain must be nested **inside `pred_bat:`** — a top-level `predheat:` app section is silently discarded by the standalone loader, which reads only `config["pred_bat"]` (`hass.py:322`), and under AppDaemon a top-level section cannot load the bundled class at all. The whole `templates/predheat.yaml` is nested under `predbat:`; `docs/predheat.md` says "append it to the end of apps.yaml", which invites the mistake. `self.args.get("predheat", {})` then stays falsy so `PredHeat` is never instantiated (`predbat.py:2009`), the `predheat.heat_energy` entity is never published, and `fetch_extra_load_forecast` warns every cycle. Applies to any bundled sub-app configured by domain (the domain read is `self.args.get(domain, {}).get(arg, default)`) (GH#5002). | | `cost_today` / `cost_today_import` steps up after each half hour of an Octopus Intelligent car charge and falls back 15-60 minutes later (GH#5520) | Not the plan and not the tariff: `today_cost()` (`output.py`) re-prices every elapsed minute of the day from the current `rate_import`, which is rebuilt each cycle, so anything that stops stamping an *elapsed* minute cheap shows at once. A planned dispatch only covers what is still to come (`trim_started_dispatch()` advances a running one's start; an ended one is dropped) and since #4114 is never promoted to completed, while `completedDispatches` lists it 15-60 minutes later. Check the log for the `Intelligent slot at` start moving forward each poll. The gap is bridged in `octopus_held_update()` / `octopus_held_dispatches()` (`octopus.py`): a half hour seen running, and not cancelled by `octopus_intelligent_dynamic`, is injected as a finished dispatch for `OCTOPUS_DISPATCH_HOLD_MINUTES`. The held record used to be memory-only: pre-#5581 a restart inside the window still showed the old step; since PR #5581 (2026-10-17) the held half hours are saved to Storage when they change and restored at startup. Test: `octopus_dispatch_hold`. Same re-pricing mechanism, different trigger: #5517 (manual rate overrides). | @@ -207,6 +208,7 @@ Targeted regression: `solax`, including the automatic-config-to-`Inverter` path. | Weather alert active and the battery sits at its current SoC through the alert while the house imports at peak ("my keep: N% is ignored") | The alert keep is a **floor, not a hold** (GH#3200, replay-verified on main, 2026-10-23 — see the keep mechanisms bullet in Traps): it never raises the reserve and never stops discharge above keep%, so the pinned battery is the optimiser's cheapest defence of the floor. With `set_discharge_during_charge: false` that defence is a daytime charge window whose target equals the reserve value; with ddC true (default) the plan targets ≈ keep% as documented. The alert's own `keep:` value is set in the `alerts:` apps.yaml config (default 100 when omitted) — check it before calling the keep "ignored". Two overlapping alerts of the same storm both apply (the plan's ⚠ marker spans the union). | | "How do I feed prices from integration X" / rates read zero or `Warn: Octopus: No Octopus data in sensor ... attribute 'rates' / 'raw_today' / 'prices'` on a third-party spot-price sensor | `fetch_octopus_rates()` (`octopus.py`) reads today's prices **only from an attribute named `rates`, `raw_today` or `prices`** — `raw_tomorrow` is added for a non-Octopus entity (name without `_current_rate`, the Nordpool shape) — so any other attribute name needs a HA template sensor re-emitting `raw_today`/`raw_tomorrow` (docs/energy-rates.md), then `metric_octopus_import`. Entry keys auto-detect in the order `rate` → `value_inc_vat`/`valid_from`/`valid_to` → `start`/`end` (with **scale ×100**, so EUR/kWh lands as cents-of-currency — tell non-UK reporters displayed costs read as minor units; plan decisions are unaffected) → `value` → `price`/`from`/`till`; none matching gives that Warn. Missing tomorrow is fine (`rate_replicate()` carries today forward) and 15-minute spot pricing wants `plan_interval_minutes: 15`. (GH#5676; code-read on main, 2026-10-24.) | | Battery charges to 100% at Predbat start, on a `pred_bat_mode` change or on a `set_read_only` change (an inverter whose target register carries a floor, e.g. Victron ESS via `inverter_type: SK` or any profile with `has_charge_enable_time: False`) | `PredBat.reset_inverter()` (`execute.py`): "safe mode" writes `adjust_battery_target(100.0, False)` with no `inv_has_charge_enable_time` consult - on such a profile the target register carries the ESS minimum SoC, so 100% is a charge-to-100 order, not an idle value. Fire conditions: the 13 `reset_inverter: True` CONFIG items set `inverter_needs_reset` on any value change *including* None→value at startup (`userinterface.py`), and the two `reset_inverter_force` items (mode select, `set_read_only`) additionally set the force name on a user event - the forced paths run the reset even in Read-Only, where no further writes happen afterwards (the head of `reset_inverter()` gates on it, and `execute_plan()` skips the loop). Normally the 100 is corrected later the same `execute_plan()` cycle (`adjust_battery_target_multi(inverter, 0, ...)` for `has_charge_enable_time: False` inverters outside a window), so it stands only when nothing competes: entering Read-Only, or Predbat stopping right after the reset. Other 100% writes: the calibration branch (`execute.py`) and `self_test()` (only under the `INVERTER_TEST` dev constant). Fixture trap: the identically named `reset_inverter(my_predbat)` in `tests/test_infra.py` resets test state and is unrelated - grep-based test-coverage checks get fooled, and no test module covers the real write path. Docs trap: `docs/inverter-setup.md` used to link `templates/victron.yaml`, which did not exist (404, confirmed against the raw URL; the Victron route existed in prose and GH#2846's discussion only) - **fixed by PR #5332 (merged 2026-10-10, post-v9.3.7)**, which adds the template and rewrites the section; on a pre-#5332 checkout a "user following the docs" Victron report is following the issue discussion. | `inverter` | +| `Error: Inverter N unable to read charge window time - no source is configured (configure an inverter component, or set charge_start_time/charge_start_hour in apps.yaml)` crashing the whole cycle (GH#5804) | The permanent-setup-gap branch in `Inverter.__init__` (`inverter.py` — the export-window twin of the same branch is a few hundred lines below it; both pinned by `test_charge_window_no_source_configured` / `test_export_window_no_source_configured_raises`, so designed behaviour, not a bug): it fires when `charge_start_time` is absent from args **and** `inverter_source_active()` is False, i.e. no component owns the inverter. A TESLA-labelled inverter gets a charge-window source three ways: (1) the built-in Teslemetry component's `automatic_config()` (`teslemetry.py`) publishes and binds Predbat's **own** `select._teslemetry_schedule_charge_start_time` entities — the Tesla-Fleet/Teslemetry HA integration never publishes those, and the component needs a Teslemetry token, not the HA integration; (2) `charge_start_time`/`charge_start_hour` set directly in apps.yaml; (3) the shipped `templates/tesla_powerwall.yaml` **`inverter:` block** (merged over `INVERTER_DEF[type]` in `Inverter.__init__`) — the piece a hand-built apps.yaml most easily misses; with the template's `charge_time_format: "S"` the four charge/discharge time args are self-dummied (the #4738 mechanism) so no real time entity is needed. The stock `TESLA` def (config.py) is `has_charge_enable_time: True` + `HH:MM:SS` selects, so it errors without a source. `inverter_type` is **case-sensitive** — but the raise only fires when there is no `inverter:` block in args, because `Inverter.__init__` auto-registers any unknown type as a GE copy (with `rate_step_percent_of_capacity` popped) when an `inverter:` block is present. A "Powerwall detected correctly" log line can coexist with the crash: type detection and window wiring are independent steps. | `inverter` | | `Hold charging target X%-Y%` while the house still imports at a peak price, or a peak-price charge window in the plan | Three code paths, all verified by reading on main (GH#2716; the family covers #1690 and #5083, and the maintainer marked the original #2716 case fixed in Nov 2025): (1) *plan side* — the high-price gate (`plan.py`, `price_key > best_price_charge_level`) guards only windows whose limit is still 0, so a window already carrying a limit from the levelling pass is exempt and `discard_unused_charge_slots()` keeps any `limit > 0` slot with no price re-check — a peak-price charge window in the plan is not by itself gate evidence, run the config-before-code checks first; (2) *"Hold charging" can be an armed-window fallback, not a hold* — the window-disabling hold needs `set_reserve_hold` + `set_reserve_enable` + `reserve_max >= target` or `inv_has_timed_pause`, and without either the fallback re-arms the charge window while the status still reads "Hold charging"; (3) *the pre-window freeze write* — a freeze-flavoured window inside `set_soc_minutes` before charging starts logs `not yet in charge freeze, holding target SoC at 100%` and deliberately writes a 100% target, so a 100% slot visible in the inverter portal during a displayed hold is that write, not a rogue one. Forensic decoder: the status suffix in `Hold charging target X%-Y%` is the **SoC–target pair**, not window start–end; and while charging the executor writes `max(charge_limit_best[0], reserve)` as the target, so SoC rising past the target means the writes never landed or the inverter ignores mid-window limit reductions (unresolved — needs the brand). | `inverter`, `plan` | | Plan table shows `HoldChrg -> N%` (and the status text "charging to N%") while the slot is actually charging to a higher limit | The State cell and the status text both classify from `charge_window_best[n]["target"]` — `calc_percent_limit(target, ...)` in `publish_html_plan()` (output.py), `HoldChrg` when it lands at/below the window's minimum predicted SoC — but `discard_unused_charge_slots()` only stamps `target = limit` when predicted SoC sits at/above the limit at both window start and end, and **otherwise `target` = predicted end-of-window SoC**: the rate-limited "charge can't complete" case. So a charge that cannot complete renders as `HoldChrg -> ` and `get_charge_export_text()` says "charging to N%", while a genuine hold (`target == limit`) still shows HoldChrg. Freeze classification already reads the limit (`is_freeze_charge(limit)`), so the two classifications can also disagree. A rising charge keeps span-min below end-SoC, so completing charges label correctly *by accident* — a green `Chrg` in a quick manual check proves nothing about the classification input. GH#4445 (split from #4440, whose 4-Aug log is the live evidence; #4446 sibling fixed and closed), verified on main 2026-10-07 by reading + a scratch unit test on the publish_html_plan path, unmerged. Fixture gap: `test_plan_why_reason.py` builds charge windows **without** a `"target"` key, so only the `window.get("target", ...)` fallback path is exercised — pin it with windows whose `target` diverges from `charge_limit_best`. Fix shape: classify from the limit (the same percent `calc_percent_limit(limit, ...)`, one token at each site) and keep the predicted end-SoC as the debug parenthesis; that makes Chrg/HoldChrg consistent with the freeze check. | | Predbat charged the car at peak rate, or planned a small house-battery top-up inside a peak window, with car charging enabled | Non-smart car planning is price-blind by design: **`car_charging_plan_smart` defaulted false until PR #5251 (GH#5237, merged 2026-09-26, unreleased at the time of writing) flipped the default to true** — `car_charging_plan_max_price` defaults 0 (never filters) either way, so pre-#5251 the car filled from the earliest low-rate-scan window onward regardless of price, and a plug-in mid-peak charged at peak (GH#2716, log-confirmed; smart mode is what re-sorts by price and honours the max-price skip, `plan.py`). On a #5251+ build a peak-rate car charge is no longer the default path — check the version before citing this explanation. Two more non-bug shapes from the same report: a saving-session reward is stamped onto the **import** rate too, which can push that hour above the low-rate scan threshold (`Rate thresholds ... import = rate_max - 0.5`), so the hour vanishes from `low_rates` and the car slot list shows a gap there — do not read that gap as a planning bug; and the in-progress peak-window house-battery top-up is the optimiser's keep response (`car_charging_from_battery: true` + `best_soc_keep` > 0 + the end-of-record SoC credit at replacement cost), same family as the "Hold charging target" row above — the high-price gate only skips windows whose limit is still 0, so a deliberately-selected window is exempt by design. Traps: `best_soc_keep` can be time-varying (automation or user), so the incident log and a later debug dump can disagree (4.0 vs 5.0 observed); and the `Calculate Best options` log line carries the plan-relevant config (`best_soc_keep`, `metric_battery_value_scaling`, ...) so you often don't need the yaml. | `car_charging` | @@ -295,6 +297,7 @@ Targeted regression: `solax`, including the automatic-config-to-`Inverter` path. - **`midnight_utc` is local midnight, and `now_utc` is local time.** Both names are wrong in the same direction and it has misled at least one review into hunting for a UTC-vs-local frame mismatch that does not exist. `update_time()` sets `now_utc_real = datetime.now(self.local_tz)` (`predbat.py:654`) - already local, not UTC - and `midnight_utc` is that value with the time zeroed (`predbat.py:655`), i.e. the local midnight of Predbat's configured timezone as a timezone-aware datetime. Anything comparing a slot against `midnight_utc` is therefore working in local wall-clock, which is usually what you want and never what the name says. Before concluding a rate or slot bug is a timezone frame error, check which of the two frames the code is actually in. Corollary for reading logs: `time_abs_str()` renders against `self.midnight`, so a line quoting a past/negative minute key prints in the local frame and will not line up with the UTC timestamps an integration's sensor publishes (GH#5036) — recompute the minutes from the sensor's own timestamps instead of keying evidence off the printed date. Component-side twin, verified separately (GH#5572, `component_base.py`, main 697c44ca): `ComponentBase.midnight_utc` deliberately derives from `base.now_utc` with the time zeroed — **not** from `base.midnight_utc`, which `calculate_yesterday()` rewinds and components read off-thread (its docstring records both reasons) — so it is likewise the **local** midnight as an aware datetime, and formatting it straight with `strftime("...Z")` puts a local wall-clock behind a `Z` suffix, an hour out all summer; any component building an API query window (`period_from`, GraphQL `startAt`) from it must `.astimezone(timezone.utc)` first, and a winter-dated (GMT) test cannot catch the mistake — pin a BST date. Contrast: `kraken.py`'s own GraphQL fallbacks build their window from `datetime.now(timezone.utc)` — genuine UTC midnight, a different instant from the component property during BST (harmless there given the day of margin either side, but the two windows don't line up exactly). Same class, one over: `ComponentBase.now_utc_exact` is local time too — `datetime.now(self.local_tz)` (`component_base.py`; the name reads like a UTC clock, the docstring already says local) — and the GH#5693 issue-author's UTC assumption understated their own bug's impact; `db_manager.set_state_db()` treats it as its "now" and then applies its own broken UTC conversion on top (see the DB row). - **Test ordering.** Since PR #5102 (merged 2026-09-15) every registry test builds its own `PredBat` (GH#5079), so the shared-fixture pollution class is fixed at the source — a test that fails in a full run but passes alone is now likelier to be one of the remaining hand-rolled restores (test_inverter.py, test_agent_tools.py; see the GH#5079 section) or a genuinely order-dependent case, and running only the targeted test still isolates. `run_debug_cases` builds a fresh instance per case for its own reason: each case replays a full dump. The wall-clock half is closed too: `create_predbat()` now pins `minutes_now`/`now_utc` from `FIXTURE_MINUTES_NOW` (`test_infra.py`), so no module inherits either the wall clock or another module's residue into those two fields — the fixture-level pin the GH#5026 note anticipated has landed and closes that class (keep the mechanism for pre-#5102 logs: a suite run used to sit at `reset_inverter`'s noon residue while a standalone run inherited the wall clock, and a time-of-day-dependent test could pass one way and fail the other — `prediction_batch` failed exactly that way, the ten-trial SoC-cost precondition collapsing onto one value at seed 5's window/rate alignment; equivalence-style subtests are `minutes_now`-insensitive, only precondition checks on seeded-scenario economics are sensitive). The per-module pins that preceded the fixture pin: PR #5028 (merged, `9290055d`) pinned the clock per-module - the third per-module pin of this class, after PR #5013 pinned dates and #4971's tests pinned `midnight_utc` - with `minutes_now` added to `SCENARIO_STATE_ATTRS`. Two caveats outlive the fixture pin: a pin-guard test is **vacuous in suite configuration when the pin value equals the residue value** (suite ambient was already 720), so a guard test must capture the pre-pin entry value rather than compare against the pin constant; and `update_time()` still takes `midnight_utc`/`now_utc_real` from the host clock, so the date-frame half of this trap is unchanged. - **`./run_all --test ` resolves names through `TEST_REGISTRY` (`unit_test.py`), not module or file names - a green run proves nothing when the probe was never executed.** `--test dynamic_load_car` maps to `tests/test_dynamic_load.py::test_dynamic_load_car_slot_cancellation` (which runs only that module's Tests 1/2/5), while `tests/test_dynamic_load_car.py` is registered under the name `dynamic_load_car_not_charging` - so probing the car-not-charging tests under the obviously-correct-looking name is a green run with zero new assertions executed (GH#5407 triage). Check `TEST_REGISTRY` before building a probe; and inside `test_dynamic_load_car.py` the `_run_edges`/`_run_rates`/`_run_poll`/... group runs only when the dynamic-load-car args are enabled in the fixture, so a probe wired into that block silently never runs under the default fixture either - wire it into the module entry function after `_run()`. +- **A green suite proves nothing about live-API behaviour — `tests/nordpool_fixture.json` is committed (PR #5799 review, verified 2026-10-28).** `test_nordpool.py` loads the fixture first and only hits the live Octopus/Nordpool endpoints when it is absent, so on every checkout — CI included — the suite contains no live download, and an author's "`./run_all --quick` passes" is not evidence a changed API host still works. Worse for reading test claims: when the live download fails, `run_nordpool_test()` catches `ValueError`, prints `WARN: Cannot download Agile rates ... skipping nordpool test` and returns **False — which the runner counts as PASSED** (`test_failed = func(my_predbat)`; any truthy return is a failure and the suite aborts at the first one), so the network-skip path is indistinguishable from a green pass unless the WARN line is read. To get genuine live coverage, delete the fixture first (it is only written when missing). Companion facts: the 4th element of a `TEST_REGISTRY` tuple is the **slow** flag (False = runs under `--quick` — nordpool is one), and the runner aborts at the first failing test with no continue-on-fail. From the same review, a PR-review rule for integration migrations: match every cited evidence probe against the module's real query set — PR #5799's GraphQL `viewer` probe is a **Kraken** query (`kraken.py`/`kraken_key.py`) that `octopus.py` never sends; what octopus.py issues on the public host is `account_query`, the intelligent catalogue/devices/dispatches/settings, flexibility campaigns ×2 and `obtainKrakenToken` — and `octoplus_saving_session_query` + its join mutation are the only Octopus calls on `api.backend.octopus.energy` (`use_backend=True`). - **A textually clean auto-merge can still be a semantic conflict.** Merging `origin/main` into an old PR branch reported no conflicts while main's GivTCP refactor (#4864) had deleted `Inverter.rest_data`, which the PR both tested on and passed to the constructor - the merged tree crashed the first `Inverter()` construction in two test modules, only one of them the PR's own (PR #4645). For PR-cleanup work the full `run_pre_commit` suite is the detector, not the PR's own module. Corollary: `rest_data` is gone since #4864 and `inverter_source_active()` (`inverter.py`) is the replacement question for "is this inverter component/REST-backed" - anything written against `self.rest_data` predates the refactor. And when a test plants a components stub, construction-time calls run against whatever stub the *previous* test module left behind, so a new components-consulting call in `Inverter.__init__` needs a `getattr` guard on the registry surface, not a fake patched into one module. Correction to what this bullet itself used to imply: `inverter_source_active()` answers a **fleet-wide** question, not a per-inverter one — it takes no index and consults no per-inverter state, so one component-backed inverter at index 0 makes it true for a hand-configured, script-driven inverter at index 1 (its docstring says the scope is deliberate). There is no per-index source API; the usable proxy was the shape of the per-inverter args list itself, because auto-config wrote slots `0..n_discovered-1` and `_keep_configured_tail()` left the rest as the user wrote them — a list that names some inverters but not this one meant the source had said what it covers and this index was outside it (PR #4645, still open, gates on that proxy). **The proxy weakened with PR #5216 (GH#5209):** GivTCP now fills slot n from REST endpoint n via `_per_endpoint_values()`, so a gap slot below the highest discovered endpoint is filled even when nothing is configured for it (with that endpoint's own entities), and a full-length list no longer implies every index is component-covered. Only indices past `max(discovered)` still follow the old rule; a per-index gate has to compare against the component's entity-id prefix (`_givtcp__`) rather than the list length. Related: `create_missing_arg()` pads short per-inverter lists with `None`, not the default, precisely so an unfilled slot is not read back as an entity id — a hand-rolled `while len(...) <= id: append(default)` loop next to it is both dead and wrong about the padding value. - **Check a PR's base staleness before reviewing it.** A long-open PR's stored base commit can be well behind main, and a conflicting PR's headline fix may already be on main: PR #4756's `plan_iboost_smart()` fix duplicated the merged GH#4817 window-average fix, and resolving its `test_iboost.py` conflict in the PR's favour would have silently deleted main's `run_iboost_smart_average_test` — resurrecting the bug. Check `git merge-base --is-ancestor main` and diff any test-file changes against main's current tests, not the PR base, before analysing the "fix". - **A stacked PR's squash can sit on the review target's head branch (PR #4186 round, 2026-10-28).** GitHub merges a stacked PR into its base *branch*, not main, so the squash lands on the target PR's head branch: #5811 merged into #4186's head branch (`feat/plan-execute-split`), the tip commit's message carried the `(#5811)` squash suffix while the PR was #4186, and #4186's GitHub diff became merge-base..head spanning both PRs — matching `git rev-parse HEAD == headRefOid` proves nothing. Before reviewing PR N, check the head commit's message for a `(#M)` squash suffix with M ≠ N (and `gh pr view M --json state` — `MERGED` with the squash on no `origin/*` branch: a squash pushed to a PR head branch exists only on `refs/pull//head`, so `git branch -r --contains ` comes back empty); state in the review body which parts were already reviewed in M and do not duplicate M's threads. @@ -306,6 +309,7 @@ Targeted regression: `solax`, including the automatic-config-to-`Inverter` path. - **Reading restarts out of a `predbat.log` (GH#3969, verified against a reporter's 65k-line v8.39.5 log, 2026-10-19 — before trusting any "Predbat keeps restarting" headline).** The `version currently running` banner is a **per-cycle line** from the release check (`github.py`), fired at the top of every `update_pred()` (~5 min) — 209 banners in 15.5 h was only 12 restarts; count restarts from the app re-init signature instead: `Loading secrets from ...` → `Loading apps.yaml` → `Predbat: Startup predbat` (that string lives in each version's own init path) → the staged `Initialising interface` / `LoadMLComponent: Started` lines, spread over minutes — those `Started` lines are per-restart context, not evidence of an add-on restart by themselves. Abrupt external kills interrupt a mid-write line (a "Best export windows" print cut mid-sentence, the next line one 5-minute cycle later); a graceful app reload logs a terminate path (`Predbat terminating`), so a re-init with no terminate line and cut-off output is a kill from outside the app — the trigger itself (config edit, add-on restart, OOM) is never in predbat.log, ask for the AppDaemon/add-on log. And nothing watches `/addon_configs//predbat_dashboard.yaml`: the only file-watch-restart in the repo is the **standalone** path (`hass.py` `collect_watch_files` — `*.py` plus the real apps.yaml), which the add-on path doesn't run, so a "the dashboard file restarted me" theory should first have the dashboard writes correlated against restart timestamps (writes also *lag* restarts — a fresh instance rewrites it). Pre-v9 Load ML drift worth the same context (v8.39.x): `_do_training()` ran an initial curriculum session and then an **unconditional second** session with no else, so the first save was 30–90+ minutes away on Pi-4-speed hardware and any restart in that window restarted training from zero; main uses a single if/else plus a `progress_callback` that keeps the component alive, and main restores `last_train_time` from the loaded model (`load_ml_component.py`) where v8.39.5 did not — so every app restart re-fired a full curriculum fine-tune — and "No training needed/fine-tune (2h interval), model age is 2.0 hours" on that era is the `last_train_time is None` sentinel printing the interval default, not a real age; a run of "Starting fine-tune training" lines is one multi-pass curriculum session (`train_curriculum()`'s non-first passes), not repeated trainings. - **A module's red run proves only its first new test can fail (seen on PR #5641, runner read on main 697c44ca, 2026-10-20).** `run_kraken_tests()` (`tests/test_kraken.py`) runs every `test_*` in alphabetical `dir()` order and **returns on the first failure**, so a stashed-source red run of `tools/triage_test.sh kraken` shows exactly one FAIL and the other new tests never execute — no evidence any of them can fail. What worked under the triage permission mode (where a single-test direct run is denied and only `triage_test.sh` is allowed): rename the test that just failed to `xtest_...`, re-run, repeat until the run is green, revert the renames before `git stash pop` (~0.1 s per kraken run). Read the specific module's runner before trusting a single red FAIL when more than one test was added — the registry loop in `unit_test.py` aborts on a raise (see Test-order pollution above), which is a different "later tests never ran" shape. - **CI's `python-version: 3.x` can resolve to different CPythons on different runners.** (Verified from job logs, 2026-10-19.) On one day it landed CPython **3.15.0** on three runs across unrelated branches (PR #5642 and two other bot PRs, all failing `test_str2time` identically) and **3.14.8** on another run that passed. Grep the `Successfully set up CPython` line of the job log before blaming a PR for an unrelated failing test — a same-base control run without comparing interpreter versions led one bot review of PR #5642 astray (it blamed "interpreter-state pollution" by the PR's own new test; the real mechanism was CPython 3.15, not interference). The underlying break is fixed on main by PR #5653: from Python 3.15 `strptime` returns a naive datetime instead of raising when a `%z` format meets a string with no offset, and `strptime_aware()` (`utils.py`) now raises whenever the parse has no tzinfo — `str2time_strptime()` and the production `%z` strptime sites go through it (nothing changes on ≤3.14; the variable-format inverter clock loop is deliberately left outside, it localises a naive result itself), with an AST-scan test (Test 6 in `test_str2time.py`) stopping new direct `strptime` calls from reintroducing the gap. Review finding on the fix (still open on main): `offset_strptime_calls()` resolves the format only when the argument is a string literal or a plain `Name` in its known-map — an `Attribute` form (`const.TIME_FORMAT`) or a `BinOp` composite (`"%Y-" + CONST`, the shape `utils.py` itself uses) silently passes, so a future `datetime.strptime(x, const.TIME_FORMAT)` gets a green build out of the guard; matching `ast.Attribute` nodes with `.attr` in the known-map is the cheap patch. +- **Docstring coverage is configured but enforced nowhere** (PR #5810 review, verified on main 2026-11-02 by grep): `pyproject.toml` sets `[tool.interrogate] fail-under = 100` (tests not excluded), but nothing runs interrogate — it is in neither `.pre-commit-config.yaml` (hooks: file-contents-sorter, cspell sorter, export-limit encoding + tests, triage-daemon tests, check-json5, ruff, black, markdownlint, cspell) nor any `.github/workflows/*.yml` — so missing docstrings on new functions never fail CI, and a review cannot claim "CI will catch it"; CLAUDE.md's "docstrings: 100% coverage required (interrogate)" is aspirational, and a docstring finding has to stand on style/convention alone. flake8 is absent from the hooks too (the lint hook is ruff with a narrow `--select` list — `F401,E713,F811,E722,F821,F841,E712,B007,B006`). Re-check after any pre-commit/CI overhaul — if interrogate gets wired in, drop this entry. - **`timedelta.seconds` wraps into [0, 86399] — settled at the button-press site, and there is a check before triaging any other `.seconds` site.** Fixed in PR #5697 (merged 2026-10-24; inverter.py now writes `abs((now_local - time_pressed).total_seconds()) < 10` with the comment citing #5694) — keep the pre-#5697 signature for older logs, where a stamp slightly ahead of Predbat's clock read ~86399 s stale and failed all 10 press retries, then fed `record_commit(False)` so the commit re-pressed every cycle (GH#5694), and a multi-day-old stamp read as just-seconds-fresh. Before triaging any remaining `age.seconds` comparison as a wrap bug, check whether a cleanup pass caps the age below 24 h at that site: gecloud (`clean_ge_url_cache()` deletes >24 h entries using `total_seconds()`, read-verified) and futurerate (`clean_futurerate_cache()`) both do, so their `.seconds` checks are correct as written — and `futurerate.py`'s `update_time_since_midnight.seconds < 0` is dead twice over (a normalised `.seconds` is never negative, and the same cleanup deletes yesterday's entries) — do not put it in a sweep ticket. The idiom for any future site is `abs((a - b).total_seconds())`, and with `strptime_aware()` (#5653) the parsed side is aware, so the defect at such sites is the normalisation, not tz confusion. - **Recognising dead vs alive naive-tz code after `strptime_aware()` (GH#5695 — the octopus.py/solcast.py dead sites were removed on main by PR #5696, merged 2026-10-23; this is the checklist for the next sweep).** `strptime_aware()` (utils.py) raises whenever the parse carries no tzinfo, on every Python version, so: (1) a `%z`-format site still guarding/normalising a naive result is dead — the naive case now raises inside `strptime_aware()` and is dropped by the surrounding except; (2) a `.replace(tzinfo=...)` written as a bare statement is a no-op dead, and that shape predates #5653 (a discarded value), while `.replace(...)` chained onto an assignment is alive — check the assignment before sweeping; (3) naive-format strptime sites are not covered by the #5653 AST guard (it pins `%z` formats only) and are mostly functional — the inverter clock format scan is the deliberate naive-result loop (it localises the naive result itself). Deleting a dead branch orphans things flake8 catches only at commit time: locals whose only use was in the branch and module imports whose only use was the dead line (F401). - **Replay-probe traps when A/B-ing a plan from a debug yaml (GH#5616, two reruns' worth, 2026-10-18).** (1) Filtering export windows "after 19:00" as `start >= 1140` deletes **tomorrow's** windows too — the dump's window list is one minute-of-day frame holding both days — so filter by the concrete range (`1140 <= start < 1440`) or by end time as well, or the replay metric collapses by hundreds of p and looks like a bug. (2) The simulated SoC is baked at `Prediction(...)` construction — mutating `soc_kw` afterwards never reaches the simulation (two variants scored byte-identical to baseline); to probe "what if the battery were fuller", vary the window/limit arrays or rebuild the `Prediction` object. Also a tag-availability trap when version-matching: `git describe --tags` after `git fetch origin main` still shows the wrong version until tags are fetched too — `git tag --contains HEAD` answers "is HEAD in release X" directly. @@ -343,7 +347,7 @@ Targeted regression: `solax`, including the automatic-config-to-`Inverter` path. - **A component must read read-only mode with `get_arg("set_read_only")`, never `self.base.set_read_only`** (found on PR #5711, Hypervolt, 2026-10-23; verified by reading the code). `PredBat.reset()` sets the attribute to `True`, and only `fetch_config_options()` inside `update_pred()` loads the real value; a component's first `run()` comes before that, so a control loop that releases on read-only releases everything it holds on every restart. **Resolved for the charger mixin: `car_charger_control.py`'s `charger_control_read_only_now()` reads `get_arg("set_read_only")` as of PR #5793 (merged 2026-10-28) — the same PR persists the held-charger set across a restart, restores it and releases what is owed every tick even while control is off — and `wallbox.py` runs on the same mixin since PR #5798 (landed with the #5793 stack squash, 2026-10-28), so the suspected restart-release half is fixed for wallbox too. Still attribute-first (conservative rather than harmful for inverter-control writes; they are not the EVC loop): `gecloud.py`'s `read_only_now()` and `gateway.py`'s `_ev_control_read_only()`.** Tests miss the pattern because `MockBase` has no `set_read_only`, so only the `get_arg` fallback runs. - **`re:` arg values are anchored `^...$` — full-match, not prefix match.** `resolve_arg_re()` (`userinterface.py:1324`) builds the matcher as `"^" + pattern + "$"` before `re.search()`, so an anchored pattern cannot over-match a longer entity id that merely shares the prefix: when judging whether a template regex "matches too much" or whether two integration entities collide in a single-entity arg, reason from the `$` side of the pattern, not prefix semantics (GH#5677 review, 2026-10-21; pairs with the first-match-wins rule recorded in the Car charging row). - **History from `HAHistory` lags up to 2 minutes, and smoothing back-fills the gap, so anything that counts history up to "now" and then moves its marker to now loses the tail** (manual car SoC undercount, found 2026-10-25 on a Hypervolt, 12.0 of 21.2 kWh counted overnight). `HAHistory.run` refreshes its cache every 2 minutes and `minute_data(backwards=True, smoothing=True)` fills the minutes after the newest cached sample with that sample's value, then smooths them back once the next sample arrives. The energy between the newest cached sample and now is therefore not in the history when it is read, and a marker moved to now skips it for good. Keep the marker where it is and count the total since it, less what is already counted (`car_manual_soc_track()`). Verified by replaying a real session through the real function with a 2-minute cache at three phases: the old code counted 9.6 to 12.5 of 17.8 kWh, the fix 17.83 - shipped in PR #5752 (b3928da0, merged 2026-10-25), which keeps the marker where it is and carries the counted-so-far total in the record (`counted`), so each cycle adds only the un-counted delta. -- **Anything reading `self.predict_soc` after a trial simulation gets the nominal path, not pv10/pv90 (PR #5735's review round, verified on the merged code):** `Plan.run_prediction`'s wrapper (plan.py) assigns `self.predict_soc` (plus `car_charging_soc_next`/`iboost_*`) **unconditionally** from the result tuple on both engines — the kernel builds the dict from `soc_out[k * PREDICT_STEP]` — while `Prediction.run_prediction`'s own assignment sits behind `if self.debug_enable or save:` and fires only on debug/saving runs, so a reader landing there wrongly concludes every consumer is broken; and after `run_prediction_metric()` the attribute holds the **nominal** scenario's path (pv90/pv10 run first, nominal last). Keys are minutes-from-now, multiples of 5, spanning 0 .. forecast_minutes−5 in both engines — `predict_soc.get(minute)` returns `None` at exactly `forecast_minutes`, so a "read the SoC at minute X" judgement from a dump stops one step short of the horizon (the plan.py comment says so: "predict_soc stops one step short of the forecast"). +- **Anything reading `self.predict_soc` after a trial simulation gets the nominal path, not pv10/pv90 (PR #5735's review round, verified on the merged code):** `Plan.run_prediction`'s wrapper (plan.py) assigns `self.predict_soc` (plus `car_charging_soc_next`/`iboost_*`) **unconditionally** from the result tuple on both engines — the kernel builds the dict from `soc_out[k * PREDICT_STEP]` — while `Prediction.run_prediction`'s own assignment sits behind `if self.debug_enable or save:` and fires only on debug/saving runs, so a reader landing there wrongly concludes every consumer is broken; and after `run_prediction_metric()` the attribute holds the **nominal** scenario's path (pv90/pv10 run first, nominal last). Keys are minutes-from-now, multiples of 5, spanning 0 .. forecast_minutes−5 in both engines — `predict_soc.get(minute)` returns `None` at exactly `forecast_minutes`, so a "read the SoC at minute X" judgement from a dump stops one step short of the horizon (the plan.py comment says so: "predict_soc stops one step short of the forecast"). **Its construction-time twin (PR #5756 review, verified on main — `Prediction.__init__` does `self.rate_import = base.rate_import`, plus ~200 other attrs copied from `base` at construction, not at run time):** any test/replay/helper that builds a `Prediction` **before** it finalises the rate table simulates with whatever rates existed at construction — silently. Concrete case: `test_marginal_costs` built `self.prediction` before `reset_rates()`, so the baseline cost was 0 and every matrix cell showed the whole day's import; the test only asserted matrix structure, so it never noticed. Build the `Prediction` after the rate table is final. ## What belongs here, and what does not