Skip to content

Commit 61bc138

Browse files
docs(car-charging): don't replace the default response list in the Zappi example; test an explicit list
- The Zappi plug_status example set car_charging_now_response to just 'charging', which replaces the default for every car. Drop it, and say a list set in apps.yaml must keep 'charging' and the other cars' values. - Note that myenergi_automatic already points car_charging_now at the Zappi charging power, so the example is for the Home Assistant integration alone. - Template comments name switch.predbat_octopus_intelligent_dynamic, an HA switch, rather than a bare octopus_intelligent_dynamic that reads like an apps.yaml key. - Test 24: a car_charging_now_response set in apps.yaml replaces the default, as the docs now say. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2bbabdd commit 61bc138

17 files changed

Lines changed: 40 additions & 33 deletions

‎apps/predbat/tests/test_car_charging_now.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ def _run_default_response(my_predbat):
393393
my_predbat.get_car_charging_planned()
394394
failed |= _check("t23 cycle {!r}".format(state), my_predbat.car_charging_now == [expected], "now {}".format(my_predbat.car_charging_now))
395395
failed |= _check("t23 live {!r}".format(state), my_predbat.car_charging_now_reading(0) is expected, "")
396+
397+
print("Test 24: a car_charging_now_response set in apps.yaml replaces the default rather than adding to it")
398+
my_predbat.args["car_charging_now_response"] = ["yes", "on", "true"]
399+
_sensor(my_predbat, "Charging")
400+
my_predbat.get_car_charging_planned()
401+
failed |= _check("t24 Charging not in the set list", my_predbat.car_charging_now == [False], "now {}".format(my_predbat.car_charging_now))
396402
_sensor(my_predbat, None)
397403
return failed
398404

‎docs/car-charging.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,16 @@ It can be an on/off sensor (matched against **car_charging_now_response**), or a
526526
- sensor.wallbox_portal_charging_power
527527
```
528528

529-
A status sensor works too, as long as its state while charging is one of the **car_charging_now_response** values. For example a myenergi Zappi's plug status reads `Charging`, which the default list accepts:
529+
A status sensor works too, as long as its state while charging is one of the **car_charging_now_response** values. For example a myenergi Zappi's plug status, from the Home Assistant myenergi integration, reads `Charging`, which the default list accepts:
530530

531531
```yaml
532532
car_charging_now:
533533
- sensor.myenergi_zappi_XXXXXXXX_plug_status
534-
car_charging_now_response:
535-
- 'charging'
536534
```
537535

536+
If you set **car_charging_now_response** yourself, keep `charging` in it, and the values your other cars' sensors use: the one list covers every car.
537+
With `myenergi_automatic`, Predbat already points **car_charging_now** at the Zappi's charging power, so leave it unset.
538+
538539
If the sensor's state never matches, Predbat never sees the car charging, so it cancels every dispatch the car is in, even while the car charges.
539540

540541
Without **car_charging_now**, if your car is inside the CT clamp (**switch.predbat_car_energy_reported_load** On), Predbat uses the house load instead - slower and less certain, as other appliances also move it.

‎templates/alphaess_cloud.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ pred_bat:
166166

167167
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
168168
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
169-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
170-
# charging in is cancelled, and the house battery can lose its cheap rate too.
169+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
170+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
171171
car_charging_now_response:
172172
- 'yes'
173173
- 'on'

‎templates/enphase_cloud.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ pred_bat:
147147

148148
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
149149
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
150-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
151-
# charging in is cancelled, and the house battery can lose its cheap rate too.
150+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
151+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
152152
car_charging_now_response:
153153
- 'yes'
154154
- 'on'

‎templates/ep_cube_cloud.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ pred_bat:
201201

202202
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
203203
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
204-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
205-
# charging in is cancelled, and the house battery can lose its cheap rate too.
204+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
205+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
206206
car_charging_now_response:
207207
- 'yes'
208208
- 'on'

‎templates/fox_cloud.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ pred_bat:
138138

139139
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
140140
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
141-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
142-
# charging in is cancelled, and the house battery can lose its cheap rate too.
141+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
142+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
143143
car_charging_now_response:
144144
- 'yes'
145145
- 'on'

‎templates/ge_cloud_octopus_standalone.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ pred_bat:
162162

163163
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
164164
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
165-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
166-
# charging in is cancelled, and the house battery can lose its cheap rate too.
165+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
166+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
167167
car_charging_now_response:
168168
- 'yes'
169169
- 'on'

‎templates/givenergy_cloud.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ pred_bat:
256256

257257
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
258258
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
259-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
260-
# charging in is cancelled, and the house battery can lose its cheap rate too.
259+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
260+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
261261
car_charging_now_response:
262262
- 'yes'
263263
- 'on'

‎templates/givenergy_ems.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ pred_bat:
171171

172172
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
173173
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
174-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
175-
# charging in is cancelled, and the house battery can lose its cheap rate too.
174+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
175+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
176176
car_charging_now_response:
177177
- 'yes'
178178
- 'on'

‎templates/givenergy_givtcp.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ pred_bat:
317317

318318
# Positive responses for car_charging_now, for an on/off or status sensor. Its state must match one
319319
# of these (ignoring case) for Predbat to see the car charging - e.g. 'charging' for a myenergi Zappi
320-
# plug_status sensor. With octopus_intelligent_dynamic on (the default), a dispatch the car is never seen
321-
# charging in is cancelled, and the house battery can lose its cheap rate too.
320+
# plug_status sensor. If it never matches while the car charges, Predbat cancels the car's Octopus Intelligent
321+
# dispatches (switch.predbat_octopus_intelligent_dynamic, On by default) and the house battery can lose their cheap rate.
322322
car_charging_now_response:
323323
- 'yes'
324324
- 'on'

0 commit comments

Comments
 (0)