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 8224867
Browse filesBrowse the repository at this point in the historyBrowse files
#43 — Remove Jinja {{ }} from the battery_power data_description (12 occurrences
across strings.json + translations) so HA no longer renders MALFORMED_ARGUMENT;
plain-text instruction now points to the README, which gains a sign-inversion
template example.
#44 — Solar Surplus PRIORITY_HOME branch no longer calls stop_charger() on an
already-off charger every tick. 3-branch guard: stop only when charging; if off
but still holding the coordinator, release it; otherwise a single DEBUG line.
Kills the per-minute log/coordinator churn and the check-counter reset.
#45 — Night Smart Charge: run the is_enabled() check BEFORE _is_in_active_window()
(which mutates _session_state to "active"). Fixes the phantom
"Already active (hysteresis)" + "disabled, skipping" loop on never-enabled
installs.
#46 — Solar Surplus resets _surplus_stable_since on grid-import detection and
after each step-down, so the pre-cloud stability credit can't trigger an
immediate full-amperage jump (large home-battery draw) once the cloud passes.
Diagnostic hardening (#47/#48): the Solar Surplus diagnostic exposes the raw
is_nighttime_computed result, and the "Invalid sensor values" state now names
the failing sensor (truncated; full list still in the errors attribute).
Backward compatible — no schema/entity/config-flow/dashboard change, counts
unchanged (69/55). Tests: tests/test_v270_fixes.py + targeted tests for
#44/#45/#46.
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
@@ -422,6 +422,8 @@ The charger switch entity is used as the unique ID for the config entry. Adding
422
422
423
423
**EV charging power (v2.2.0):** the most reliable signal for whether the car is actually drawing current — when mapped it becomes the single source of truth for charging detection (and the dashboard's green "EV charging" banner), overriding the status string. In three-phase mode map all three per-phase sensors (they are summed) or leave all blank. The sensor must report positive watts while charging; if yours reports negative, wrap it in a template sensor (`{{ states('sensor.your_power') | float(0) | abs }}`) — the diagnostic sensor's `charging_power_w` will read a flat 0 W if the sign is reversed.
424
424
425
+
**Battery power (v2.1.0):** optional signed power sensor for the home battery, used by Hybrid Inverter Mode and Night Smart Charge grid mode to tell real solar headroom apart from the home battery silently covering the EV. **Sign convention: NEGATIVE = discharging, POSITIVE = charging.** If your sensor reports the opposite sign, invert it with a template sensor that negates the value, e.g. `{{ states('sensor.your_battery_power') | float(0) * -1 }}` — the diagnostic sensor's `battery_discharge_w` will read a flat 0 W if the sign is reversed.
426
+
425
427
**Grid available (v2.6.0 — [issue #36](https://github.com/antbald/ha-ev-smart-charger/issues/36)):** optional `binary_sensor` (on = grid present, off = grid lost), typically exposed by hybrid inverter integrations (e.g. `binary_sensor.inverter_grid`). On hybrid "Battery First"/UPS inverters a grid outage is invisible to the integration (every power sensor keeps reporting), so Night Smart Charge **grid mode** would keep drawing — now from the home battery — during the outage. When mapped and OFF (sustained for the grid-import delay, default 30 s), the grid-mode session stops. **Fail-safe:** an `unavailable`/`unknown` state (e.g. at HA boot or an inverter-integration restart) is treated as "unknown" and never triggers a stop. Leave empty to keep the previous behaviour.
Copy file name to clipboardExpand all lines: custom_components/ev_smart_charger/strings.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@
72
72
},
73
73
"data_description": {
74
74
"hybrid_inverter_mode": "Turns on the empirical curtailment probe for zero-export hybrid inverters. You can toggle it any time later from the dashboard — this only sets the initial state.",
75
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
75
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
76
76
}
77
77
},
78
78
"pv_forecast": {
@@ -176,7 +176,7 @@
176
176
"battery_power": "Battery power sensor (W, signed)"
177
177
},
178
178
"data_description": {
179
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
179
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
180
180
}
181
181
},
182
182
"reconfigure_pv_forecast": {
@@ -339,7 +339,7 @@
339
339
"battery_power": "Battery power sensor (W, signed)"
340
340
},
341
341
"data_description": {
342
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
342
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
Copy file name to clipboardExpand all lines: custom_components/ev_smart_charger/translations/en.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@
72
72
},
73
73
"data_description": {
74
74
"hybrid_inverter_mode": "Turns on the empirical curtailment probe for zero-export hybrid inverters. You can toggle it any time later from the dashboard — this only sets the initial state.",
75
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
75
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
76
76
}
77
77
},
78
78
"pv_forecast": {
@@ -176,7 +176,7 @@
176
176
"battery_power": "Battery power sensor (W, signed)"
177
177
},
178
178
"data_description": {
179
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
179
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
180
180
}
181
181
},
182
182
"reconfigure_pv_forecast": {
@@ -339,7 +339,7 @@
339
339
"battery_power": "Battery power sensor (W, signed)"
340
340
},
341
341
"data_description": {
342
-
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor uses the opposite sign, create a template sensor: {{ - states('sensor.your_battery_power') | float(0) }}."
342
+
"battery_power": "Optional. Signed battery power in watts — NEGATIVE = discharging, POSITIVE = charging. Lets the probe detect when the home battery (not solar) is covering the EV, preventing false 'headroom found' results. If your sensor reports the opposite sign, invert it with a template sensor that negates the value — see the README for an example."
0 commit comments