Skip to content

Predbat discharge_start fails with /api/device/switchMode HTTP 500 on HES-EU2-S7-20G #1

Description

@GefLawrence

I'm using ha-ep-cube v1.3.0 with Predbat and a Canadian Solar EP Cube HES-EU2-S7-20G.

Predbat integration/telemetry appears to be working correctly and Predbat successfully creates a forced-export window. However, calling the ep_cube.discharge_start service fails when the integration attempts the switchMode override.

Home Assistant reports:

This error originated from a custom integration.

Logger: custom_components.ep_cube.services
Source: custom_components/ep_cube/services.py:464
Integration: Canadian Solar EP Cube

switchMode override failed:
POST /api/device/switchMode envelope error status=500: Failure

Environment

ha-ep-cube: v1.3.0
EP Cube model: HES-EU2-S7-20G
EP Cube software version: V1.3.2
Battery: 20 kWh / 4 × 5 kWh packs
System: single phase
Predbat: v8.54.3
Tariff: Octopus Intelligent Go
Normal EP Cube operating mode: Time of Use

Predbat configuration/status

Predbat recognises the EP Cube profile and exposes the expected control services:

ep_cube.charge_start
ep_cube.charge_stop
ep_cube.discharge_start
ep_cube.discharge_stop

For the test, Predbat was placed into Control Charge & Discharge, with Predbat Active OFF.

A Manual Force Export window was then selected. Predbat correctly generated an export plan.

Immediately before testing ep_cube.discharge_start, the relevant entities were:

predbat.best_export_start = 14:00
timestamp: 2026-09-05T14:00:00+0100

predbat.best_export_end = 14:30
timestamp: 2026-09-05T14:30:00+0100

predbat.best_export_limit = 86%
predbat.best_export_limit_kw = 17.2 kWh

The battery was at approximately 100% SoC.

Calling:

ep_cube.discharge_start

from Home Assistant Developer Tools → Actions then produced the HTTP 500 error above.

Important diagnostic test

Normal operating-mode control through the same ha-ep-cube integration works.

I successfully used Home Assistant to change:

select.ep_cube_operating_mode

time_of_use → self_consumption

and confirmed the physical change in the official EP Cube app.

I then used Home Assistant to change:

self_consumption → time_of_use

and this also succeeded and was reflected in the EP Cube app.

Therefore normal mode switching/authentication/cloud communication appears to be working. The HTTP 500 seems specific to the discharge_start/Predbat override path.

Steps to reproduce

Configure Predbat with the EP Cube integration.
Set Predbat mode to Control Charge & Discharge.
Create a Manual Force Export period.
Verify predbat.best_export_start, best_export_end and best_export_limit are populated.
Call ep_cube.discharge_start from Developer Tools → Actions.
Service fails and HA logs:
switchMode override failed:
POST /api/device/switchMode envelope error status=500: Failure

Expected behaviour

ep_cube.discharge_start should apply the Predbat export override/TOU schedule and cause the battery to discharge/export towards the Predbat target SoC until the end of the export window.

Additional information

The EP Cube official app can change operating modes normally, and select.ep_cube_operating_mode through ha-ep-cube also works correctly.

The EP Cube has recently introduced Dynamic Tariff functionality, but my system is currently on Octopus Intelligent Go rather than Agile, so Dynamic Tariff is not currently available/being used.

Please let me know if a debug log or the generated /api/device/switchMode request payload would help diagnose which field in the Predbat discharge override is being rejected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions