You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 689b85d
Browse filesBrowse the repository at this point in the historyBrowse files
Antonio ...
committed
fix: v2.9.1 — brand-vocabulary status classifiers (available/charged no longer misread)
Closes the residual from the v2.9.0 root-cause: non-Tuya wallboxes report
OCPP-style 'available' (= no EV connected) and 'charged' (= session done),
but three call sites still compared exact Tuya strings:
- night-charge connect gates rejected only 'charger_free' → 'available'
passed as connected and a session started with no car plugged
- late-arrival detection compared old_state == 'charger_free' exactly →
never fired on an available→charging plug-in
- the v2.9.0 grid lifecycle blocklist matched only charger_free/charger_end
New centralized classifiers in power_model.py — is_disconnected_status()
and is_charge_complete_status() — case-insensitive conservative allowlists
of unambiguous synonyms (unknown strings default to connected: the safe
failure mode). Applied to both connect gates, late-arrival, both grid
lifecycle paths, and power_model.is_charging/is_plugged_in. Solar Surplus /
Smart Blocker gates intentionally untouched. Tuya installs byte-for-byte
unchanged.
Tests: +7 in tests/test_night_smart_charge.py, full suite 278 passed / 0
failed.
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,8 @@ Most projects target one charger brand or assume a single-phase home. EV Smart C
58
58
59
59
> **📱 New in v2.7.3+** — EV charging **Live Activities / Live Updates** for the Home Assistant Companion app. When enabled from **Dashboard → Settings → Notifications**, the integration keeps a single `evsc_ev_charging` activity updated for Boost Charge, Night Smart Charge, Solar Surplus, Force Charge, and normal charging detected by the shared `charging_power` / charger-status SSOT. Updates are throttled to protect the iOS push budget and the activity closes only after charging has stopped for two monitor ticks. **Default: OFF**.
60
60
61
+
> **🔌 New in v2.9.1** — **brand-vocabulary status classifiers**. "Is the cable disconnected?" and "has the charge completed?" are now answered by two centralized, case-insensitive classifiers in `power_model.py` (`is_disconnected_status` / `is_charge_complete_status`) instead of exact Tuya-string comparisons. This fixes the remaining v2.9.0 blind spot: on wallboxes reporting OCPP-style statuses (`available` = no EV connected, `charged` = session done), Night Smart Charge could start a session **with no car plugged** (the connect gate only rejected `charger_free`) and the plug-in *late-arrival* detection never fired (it compared against `charger_free` exactly). The classifiers are conservative allowlists of unambiguous synonyms — an unknown brand string still defaults to "connected", so no existing setup can lose night charging. Applied to the night-charge connect gates, late-arrival detection, and the grid-monitor lifecycle stops; `power_model.is_charging` / `is_plugged_in` now share the same vocabulary.
62
+
61
63
> **🛠️ New in v2.9.0** — two Night Smart Charge reliability fixes. **(1)** The grid-mode monitor no longer terminates a session because your wallbox reports a brand-specific status string: the old check accepted only the Tuya vocabulary (`charger_charging` / `charger_wait`), so a wallbox reporting e.g. `charging` had its grid session killed ~15 s after the battery→grid fallback — leaving the EV under target for the rest of the night. The check is now the same tolerant blocklist used everywhere since v2.2.0 (only the explicit `charger_free` / `charger_end` lifecycle statuses stop the session; the measured-power blind-spot check keeps protecting against a genuinely idle charger). **(2)** Changing **today's** EV SOC target or turning on **today's** *car ready* switch after a session already ended now **re-arms Night Smart Charge**: the "completed today" latch (and its 1-hour cooldown) is cleared and the session restarts within a minute if the night window is still open. Previously those changes were silently ignored until the next day. **STRONGLY RECOMMENDED for non-Tuya wallboxes.**
0 commit comments