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 a862f32
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ohme): take completed Intelligent dispatches from Octopus, planned slots from Ohme (#5413)
Ohme only reports the slots of the charge session in progress, so unplugging the
car emptied the car slots and the off-peak rate already charged at was re-priced
at day rate in the plan history and today's cost.
Add octopus_intelligent_planned_slot: a per-car sensor the planned dispatches are
read from, leaving octopus_intelligent_slot as the record of the completed ones.
On Octopus Intelligent the Ohme component now sets only that, the ready time and
the charge limit when octopus_intelligent_slot is already a sensor of Octopus's
(wired by the Octopus component or set in apps.yaml), and falls back to supplying
everything when there is no such sensor. The car_slot_owner claim narrows to the
ready time and charge limit, so the Octopus component keeps its dispatch sensor
wired under it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
self.log("Warn: Unable to get data from {} for car {} - octopus_intelligent_planned_slot may not be set correctly in apps.yaml".format(planned_entity_id, car_n))
1553
+
self.record_status(message="Error: octopus_intelligent_planned_slot not set correctly in apps.yaml for car {}".format(car_n), had_errors=True)
1554
+
1517
1555
# Completed and planned slots - merge from all cars
self.log("Info: Ohme API: Taking the planned car slots from Ohme and the completed dispatches from {}".format(slot_source))
610
+
else:
611
+
self.log("Info: Ohme API: No Octopus dispatch sensor is set in octopus_intelligent_slot, so the completed car slots come from Ohme too - they are only kept until the car is unplugged")
612
+
self.slot_source=slot_source
613
+
614
+
defoctopus_dispatch_sensor(self):
615
+
"""
616
+
The sensor holding Octopus's own record of the car's dispatches, or None when there is not one.
617
+
618
+
Ohme knows the charge that is planned sooner and better than Octopus reports it, but only for
619
+
the session in progress: unplug the car and every slot it charged in is gone, and with them
620
+
the off-peak rate those minutes were billed at (#5413). Octopus keeps its completed dispatches,
621
+
so where octopus_intelligent_slot already points at a sensor of Octopus's - wired by the
622
+
Octopus component, or set in apps.yaml to the Octopus Energy integration's - that sensor is
623
+
left as the record of what has been dispatched and Ohme supplies the plan beside it.
624
+
625
+
An Ohme sensor is not such a record, whether ours or the Ohme integration's. Nor is an
626
+
unmatched regex from the apps.yaml default, still its literal "re:" string at this point.
0 commit comments