v1.0.0
πͺ EP Cube Integration v1.0.0 β Opinionated Predbat Bridge (Breaking Change)
TL;DR β the TOU editor card and
ep_cube.set_tou_scheduleservice are gone. From v1.0 the integration treats Predbat as the single source of truth for time-of-use control. If your cube has user-painted TOU slots while Predbat is running, an HA Repair issue offers a one-click wipe. If you want manual TOU control without Predbat, use the EP Cube mobile app or Bobsilvio/epcube.
Why this is breaking
The TOU editor existed as a relief valve for "Predbat isn't doing what I want right now." But overriding at the cube creates state divergence: Predbat re-plans against its model of the cube while the cube is actually running a hand-painted schedule the model doesn't know about. The right fix for "Predbat isn't doing what I want" is to tune Predbat (metric10_weight, metric_battery_value_scaling, etc.) β not to override at the device.
The honest product framing for v1.0:
- Predbat + variable tariff users (the integration's primary audience): everything they need is in the shim's
charge_start/discharge_start/charge_freeze/idleservices. They never neededset_tou_scheduleand shouldn't be tempted by it. - Fixed-tariff non-Predbat users (the audience the editor was secretly built for): better served by Bobsilvio's
bobsilvio/epcubeHACS integration, or just the EP Cube mobile app. Neither has an "is Predbat tuned right?" problem to fight.
π₯ Breaking changes
- Removed
ep_cube.set_tou_scheduleservice. Any automation calling it will fail. Migrate to one of:- EP Cube mobile app for ad-hoc manual TOU painting.
- Bobsilvio's epcube integration if you want manual TOU as a permanent HA-native control surface (deliberately different design from this one).
- Removed
www/ep-cube-tou-editor.js(the Lovelace editor card). If you have it installed:- Settings β Dashboards β Resources β delete the
/local/ep-cube-tou-editor.jsentry. - The
dashboards/ep_cube.yamlno longer references it. If you customised the dashboard, thetype: custom:ep-cube-tou-editorcard block can be removed.
- Settings β Dashboards β Resources β delete the
- Removed
tou_scheduleandtou_pricesextra-state-attributes fromselect.ep_cube_operating_mode. If you read these from automations, switch to the EP Cube app or a different integration for the underlying data. parse_tou_schedule()andparse_tou_prices()helpers removed fromservices.py. They were public-but-internal β listed here for anyone who imported them in a custom module.
β¨ New: HA Repair flow for the Predbat-priority transition
When the coordinator detects:
- The cube has at least one non-shim slot in any of the six non-DST tier lists (workday + weekend Γ peak / mid-peak / off-peak), AND
- At least one entity in the
predbat.*domain exists on this HA instance,
β¦an HA Repair issue appears (Settings β System β Repairs) titled "Manual TOU slots on the cube while Predbat is running." Selecting Submit wipes the six non-DST tier lists on the cube in a single guided flow:
- Abandons any in-flight Predbat shim override first (user-wins).
- Reads current state, strips stale shim-signature slots, builds an overrides dict that empties the six tier lists.
- Uses the 2-write dance when the cube is in non-TOU mode (write A flips to TOU and lands the empty lists; write B flips back to the original mode). Same provenance and quirks as the shim's existing dance β see services.py
PredbatShim. - Triggers a coordinator refresh β the detection helper auto-clears the issue once it sees the wiped snapshot.
DST tier lists are deliberately left intact. They're shared-across-year state; the conflict surface lives entirely in the six non-DST lists.
The repair flow is idempotent and non-destructive without confirmation β the issue surfaces, the user reads, the user clicks. No auto-wipe.
π§Ή What was cleaned up
custom_components/ep_cube/services.pylost ~400 lines:handle_set_tou_schedule+SET_TOU_SCHEDULE_SCHEMA+_PRICES_SCHEMA+_USER_SLOT_RE+_parse_user_slot+_validate_day_profile+_user_slot_to_wire+_slot_wire_to_user+_existing_house_price+_DEFAULT_PRICE_BY_USER_FIELD+parse_tou_schedule+parse_tou_prices.tests/test_set_tou_schedule.pyremoved (~900 lines, 30+ cases). The 2-write dance is still under test coverage viatests/test_shim.py(the shim uses the same pattern for charge / discharge / freeze).const.DEFAULT_TIER_PRICE_*removed (onlyset_tou_schedulereferenced them).services.yamllost theset_tou_scheduleentry; the shim services remain.
π¦ What's kept
- Predbat shim:
charge_start,charge_stop,discharge_start,discharge_stop,charge_freeze,discharge_freeze,idleβ unchanged. debug_freezediagnostic service β unchanged.- All 22 sensors, 1 select (operating mode), 2 numbers (reserve SoCs), 2 switches (grid-charge allow + DST) β unchanged.
select.ep_cube_predbat_inverter_mode+number.ep_cube_predbat_charge_limit(Predbat-entity-first stubs from v0.7 line) β unchanged.parse_tou_schedulecallers in dashboards / cards β none in the public repo; if you forked the editor card it'll stop working without the helpers.
π§ͺ Tests
Suite shrinks from 229 β ~200 with the deletion. The repair flow itself gets light coverage in this release; the cube-write path is exercised by the existing shim tests. Suite is green on Python 3.12.
π¦ Upgrading
- HACS users: bump v0.7.0 β v1.0.0 in the HACS UI. Restart HA. After restart, if the cube has manual TOU slots and you run Predbat, an HA Repair will appear β click through to wipe them.
- Manual users: re-copy
custom_components/ep_cube/from the release zip. If you'd installedwww/ep-cube-tou-editor.js, remove it from/config/www/and remove the Lovelace resource entry. Restart HA. - Automation cleanup: search your
automations.yamland node-red flows forep_cube.set_tou_scheduleβ these calls now fail. Decide per-call: drop entirely (let Predbat handle it), move to the EP Cube app, or migrate to Bobsilvio's integration.
π£ What's next
- v1.0.x β
queryDataElectricityV2cloud-stats expansion (signed grid import/export,*_yesterdayvariants, lifetime totals withRestoreSensorseeding) β waiting on a mitmproxy capture session. - v1.1 β HACS Default submission.
- v1.x β HomeAssistant-OctopusEnergy β half-hourly smart-meter consumption replaces Riemann
load_today. Gated on Octopus Home Mini arrival.
Why v1.0 not v0.8
This is the first release whose scope matches the original product statement: "let Predbat control the EP Cube." Earlier versions stopped short of being opinionated about it and shipped escape hatches that, in practice, made the Predbat path harder to reason about. v1.0 deletes the escape hatches and replaces them with a one-click handoff.
β Support
If this saves you the mitmproxy sessions and Python hours it took to build, consider tossing a ko-fi in the tank. Thanks!
Not affiliated with or endorsed by Canadian Solar or EP Cube.