Fixed
- Every FoxESS sensor silently freezes during a charge session's pre-window phase (surfaced 2026-04-25 by the new
collect_ha_session.pytrace collector).SmartOperationsSensor.native_valuecan return"scheduled"— a value added in 1.0.11-beta.9 to distinguish the charge card's pre-window state from the deferred state — but the sensor's_attr_optionslist was not updated when that phase value was introduced. HA's sensor base class rejects any state not in_attr_optionsand raisesValueErrorfromasync_write_ha_state(). BecauseDataUpdateCoordinator.async_update_listeners()iterates listeners sequentially and the exception was uncaught, every listener registered afterSmartOperationsSensorstopped receiving updates. Observed blast radius on a live instance: coordinator polling succeeded every 5 minutes (success: Truein the debug log), yet SoC, house load, generation, work mode, charge rate and every other FoxESS sensor hadlast_reported/last_changedfrozen at their pre-session values for 50+ minutes. Thesmart_operationssensor itself stuck atidle(its last valid state) while the binary-sensor-classsmart_charge_active— which registers earlier in the listener iteration — correctly showedon. Fixed by adding"scheduled"to_attr_options. Regression testTestSmartOperationsSensorOptionsCoverageparametrises over every stringnative_valuecan return and asserts each is in options — structurally prevents the class of defect.
Added
- Repair surface for sensor state-write failures (C-026): the "scheduled-options" freeze above was invisible to the user until live tracing found it — the
ValueErrorwas log-only, and no Repair issue was raised while every sensor silently stopped updating for 50+ minutes. Defence-in-depth hardening: sensor listener callbacks now route through_safe_write_ha_state(), which wrapsasync_write_ha_state()in a narrow(ValueError, RuntimeError)try/except. On failure it logs, creates an HA Repair issue naming the offending entity and the error, and crucially does NOT re-raise — so listener iteration continues and other sensors still update. On the next successful write for that sensor, the Repair is dismissed automatically. Applied toSmartOperationsOverviewSensorandInverterOverrideStatusSensor(the two listener callbacks insmart_battery/sensor_base.py); the helper pattern scales to any future listener. Newsensor_write_failedtranslation instrings.jsonprovides the Repair card text. Seven-test regression suite (TestSensorListenerFailureSurfacesRepair) covers: Repair created with entity_id, recovery dismisses Repair, repeated failures don't spam (idempotent), listener iteration continues when one sensor raises, pattern applies to multiple sensor classes, helper logs the exception, happy-path is invisible. schedule_writestructured event emission:smart_battery/events.pyhas definedSCHEDULE_WRITEsince 1.0.11-beta.7 but no call site was emitting it — grep showed the constant declared but never referenced. Live trace collection confirmed the gap: a 15-minute charge session capturedtick_snapshot+algo_decisionevents but zeroschedule_writerecords, despite confirmed inverter schedule writes.Inverter._post_schedule()now funnels every/op/v0/device/scheduler/enablecall through a single path that emits oneSCHEDULE_WRITEevent per write (payload:groupslist + APIresponse+endpoint+call_site). BothInverter.set_scheduleandInverter.set_work_moderoute through it, so every code path that writes an inverter schedule (direct writes from_services.py/foxess_adapter.py, orself_use/force_charge/force_dischargeviaset_work_mode) produces exactly one event. Payload is JSON-serialisable so the replay harness can reconstruct exact API state changes; committed sample tracetests/replay_traces/sample_schedule_write.jsonlis picked up by the parametrised replay-regression test.scripts/collect_ha_session.py— merged event + observation timeline collector: produces a single JSONL per session capturing both what the integration decided (algorithm decisions, schedule writes, session transitions, tick snapshots) and what the real inverter + house were doing at the same moments (SoC, house load, PV, grid flows, BMS temperature, work mode). This pairing is what simulator validation needs — feed the exogenous observations into the simulator, replay the decisions, and assert the simulator's resulting state agrees with HA's. Two modes:live(polls every 5 s, appends per-session files, auto-detects the log sensor across integration versions) andhistory(reconstructs a past time range via/api/history/period/). Paired systemd servicesystemd/foxess-collect-ha.serviceruns it continuously withRestart=always/ 10-minute backoff between attempts (survives sustained HA outages without API-hammering). Credentials live in~/.config/foxess-collect-ha.env(not in repo);systemd/foxess-collect-ha.env.exampleships the template.- Soak-artefact run-directory collision fix:
systemd/foxess-soak.serviceinlined its ExecStart script; systemd's own%/$-substitution layer swallowed${TS}_${SHORT}and$$before bash saw them, so every nightly run wrote intoruns/_/— overwriting the prior night's artefacts. Extracted tosystemd/foxess-soak-run.shso bash expands variables normally; runs now land in per-timestamped directories (runs/20260425_080536_d6dc5bc/...) as intended, enabling cross-run comparison.