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 7f5a751
Browse filesBrowse the repository at this point in the historyBrowse files
fix(dynamic-load): only cancel Octopus Intelligent slots, never Predbat-led ones
Predbat-led charging is a different mechanism: Predbat itself decides when the
car charges, and its car_charging_slot sensor drives the charger. A second check
here, for cars Predbat plans itself, ran before publish_car_plan(), so a
cancelled slot switched that sensor off. The charger automation then stopped the
charge the check was waiting to see, and every later slot in the run stayed
cancelled.
Detection now applies only to slots load_octopus_slots() built ("octopus": True).
The second check is gone, and a single call before the rates decides every car,
including one whose slots have gone this cycle, so a stale cancellation cannot
outlive them.
This changes behaviour from main: the old dynamic_load() also zeroed
Predbat-planned slots on low load. It no longer does.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
failed|=_check("t6b no clock before 00:05", my_predbat.dynamic_load_car_since.get(0) isNone, "since {}".format(my_predbat.dynamic_load_car_since.get(0)))
@@ -269,22 +268,31 @@ def _run(my_predbat):
269
268
failed|=_check("t10 not applied outside the slot", _kwh(my_predbat) == [3.5, 3.5], "kwh {}".format(_kwh(my_predbat)))
270
269
failed|=_check("t10 saved state untouched", my_predbat.dynamic_load_car_cancelled.get(0, False), "cancelled {}".format(my_predbat.dynamic_load_car_cancelled))
271
270
272
-
# Cars planned by Predbat itself get their slots after the rates are built: the late call
273
-
# decides the cars the early call could not
274
-
print("Test 11: the late call decides cars that had no slots at the early call")
271
+
# Predbat-led charging is a different mechanism: Predbat itself decides when the car charges, and
272
+
# its slot sensor drives the charger - cancelling it would stop the very charge it is waiting to
273
+
# see. Only slots Octopus Intelligent charging built are ever cancelled.
274
+
print("Test 11: a car Predbat plans itself is never cancelled, by the sensor or the load")
Copy file name to clipboardExpand all lines: docs/car-charging.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -627,7 +627,8 @@ e.g. you are using Intelligent Octopus or you use the car slots in Predbat to co
627
627
- **input_number.predbat_car_charging_loss** gives the percentage amount of energy lost when charging the car (load in the home vs energy added to the battery).
628
628
A good setting is 0.08 which is 8%.
629
629
630
-
- **switch.predbat_metric_dynamic_load_adjust** (default `false`) - When On, Predbat cancels a car's charging slots, including the cheap rate of an Octopus Intelligent dispatch, while the car is inside a slot but not actually charging, and restores them as soon as it starts charging again or the slot ends.
630
+
- **switch.predbat_metric_dynamic_load_adjust** (default `false`) - When On, Predbat cancels a car's Octopus Intelligent charging slots, including the dispatch's cheap rate, while the car is inside a slot but not actually charging, and restores them as soon as it starts charging again or the slot ends.
631
+
Slots Predbat plans itself (Predbat-led charging) are never cancelled.
631
632
This releases the battery hold set by **switch.predbat_car_charging_from_battery**, and stops the house battery being planned around a dispatch Octopus may bill at the full rate.
632
633
It uses **car_charging_now** when that is a real sensor (reacting within about 2 minutes), otherwise the house load if the car is inside the CT clamp (about 10 minutes). If turned Off then Predbat won't export during times the car is planned to charge even if the car is not charging.
Copy file name to clipboardExpand all lines: docs/customisation.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,8 +189,9 @@ This setting will not impact the real calculated costs and is only used for plan
189
189
**switch.predbat_metric_dynamic_load_adjust** (default False) is a toggle that when enabled allows Predbat to take into account your energy consumption within the last 5 minutes.
190
190
If the load is above what your battery can deliver the plan is updated to predict this load will continue during the current slot, thus preventing forced export in the plan.
191
191
If the load remains high for two checks in a row, this prediction is extended into the following slot too, so the plan stays up to date across the slot boundary.
192
-
If the current time is inside one of your car's charging slots but the car is not charging, Predbat cancels that slot and every later one, so the battery is no longer held for the car and the plan can include potential export again.
193
-
For an Octopus Intelligent dispatch the slot's cheap rate is withdrawn too, as Octopus may bill a dispatch the car does not use at the full rate.
192
+
If your car is charged by Octopus Intelligent and the current time is inside one of its charging slots but the car is not charging, Predbat cancels that slot and every later one, so the battery is no longer held for the car and the plan can include potential export again.
193
+
The dispatch's cheap rate is withdrawn too, as Octopus may bill a dispatch the car does not use at the full rate.
194
+
Slots Predbat plans itself (Predbat-led charging) are never cancelled, as Predbat is the one deciding when the car charges.
194
195
Whether the car is charging is taken from **car_charging_now** when it is set to a real Home Assistant entity, after 2 minutes of it reporting not charging.
195
196
Without that sensor, if your car is inside the CT clamp (**switch.predbat_car_energy_reported_load** On), the house load is used instead, after 10 minutes of load too low for a car to be charging.
196
197
The slots come back as soon as the car starts charging again or the current slot ends.
0 commit comments