Repository navigation
fix(ohme): take completed Intelligent dispatches from Octopus, planned slots from Ohme - #5443
Open
springfall2008 wants to merge 1 commit into
Open
springfall2008 wants to merge 1 commit into
springfall2008 wants to merge 1 commit into
Conversation
…d 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>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Multi-car configurations can retain stale dispatch wiring and lose per-car ready-time and charge-limit targets.
1 open finding
What changed in this PR
Splits completed Octopus Intelligent dispatches from Ohme-planned slots to preserve historical off-peak pricing.
Changes:
- Adds
octopus_intelligent_planned_slot. - Updates Ohme/Octopus wiring ownership.
- Adds documentation and regression tests.
| File | Description |
|---|---|
apps/predbat/config.py |
Defines the new option. |
apps/predbat/fetch.py |
Merges completed and planned dispatch sources. |
apps/predbat/ohme.py |
Implements split sensor wiring. |
apps/predbat/octopus.py |
Retains Octopus dispatch wiring under Ohme ownership. |
apps/predbat/predbat.py |
Updates ownership semantics. |
apps/predbat/tests/test_multi_car_iog.py |
Tests split dispatch fetching. |
apps/predbat/tests/test_octopus_intelligent_devices.py |
Updates ownership tests. |
apps/predbat/tests/test_octopus_misc.py |
Tests retained dispatch wiring. |
apps/predbat/tests/test_ohme.py |
Adds Ohme transition and source tests. |
docs/apps-yaml.md |
Documents the option. |
docs/car-charging.md |
Explains split Ohme/Octopus behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| car on dispatches that never come. Not so while Octopus drives another device, whose | ||
| dispatches that sensor is about to carry. | ||
| """ | ||
| return bool(entity_id) and entity_id == self.slot_source_applied and not self.octopus_intelligent and not self.octopus_other_device |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Draft for maintainer review. Fixes #5413
Summary
On Octopus Intelligent with an Ohme charger, the car slots came only from Ohme. Ohme reports the slots of the charge session in progress and nothing else, so unplugging the car emptied the slots, and the off-peak rate for charging already done was re-priced at day rate in the plan history and
cost_today. The reporter's log shows this at every unplug.This splits the two jobs:
octopus_intelligent_planned_slot(per car, optional). When set, planned dispatches are read from it andoctopus_intelligent_slotsupplies the completed ones. Slots the planned sensor reports as already finished are merged in behind the slot sensor's completed list, so a slot is covered from when it ends until Octopus lists it; the existing overlap handling inload_octopus_slots()drops whatever Octopus has by then.octopus_intelligent_slotis already a sensor of Octopus's (wired by the Octopus component, or set inapps.yamlto the Octopus Energy integration's). With no such sensor it supplies everything, as before. It re-checks every poll, so the Octopus component wiring or clearing its sensor is followed without a restart.car_slot_ownernow covers the ready time and charge limit only. The Octopus component keeps wiring its dispatch sensor under another component's claim.ohme_controlis still ignored on Intelligent in both wirings.Testing
./run_pre_commitpasses, including the full quick suite ("All tests passed, 4 slow tests skipped").ohme,multi_car_iog,octopus_miscandoctopus_intelligent_devicesfail without the source change and pass with it (source files stashed, tests kept).planned_slot_sensor_5413: the completed dispatch survives the charger reporting no slots after unplug), and four Ohme tests covering which sensors count as Octopus's, the split wiring, following the Octopus sensor coming and going, and leaving Intelligent.octopus_intelligent_slotalone under an Ohme claim) and were updated.Not tested against a live Ohme or Octopus account.
Notes
octopus_intelligent_slotmoves from the Ohme sensor to the Octopus dispatch sensor. The car's battery size and charge rate attributes are therefore now read from Octopus's sensor, where Ohme's had none.docs/devices.mdand pointedoctopus_intelligent_slotat an Ohme sensor. The Ohme component logs which source it is using. The Home Assistant Ohme integration sections ofdocs/devices.mdand the commented template lines are not changed here.ohme_automatic_octopus_intelligent: falsewithohme_control: trueon an Intelligent tariff still turns Predbat-led control on. That is not changed here.fetch_sensor_data_carsrates HIGH in GitNexus (it is on the main loop); the change there does nothing when the new option is unset. The newer Ohme wiring functions are not in the GitNexus index, so their callers were established by search.🤖 Generated with Claude Code