[SOLVED] Enphase Battery: Charge and discharge entities

Hi Patrick,

of course - I am happy to help.

Charge:

{{ states('sensor.solar_batterie_1_2_3_akt_w') | int *-1 if states('sensor.solar_batterie_1_2_3_akt_w') | int  < 0 else 0 }}

Whereas solar_batterie_1_2_3_akt_w is just the sum of the individual battery values sensor.encharge_xxxxx_leistung

For discharge I have this template with the same input value (sum mentioned above)

{{ states('sensor.solar_batterie_1_2_3_akt_w') | int *1 if states('sensor.solar_batterie_1_2_3_akt_w') | int > 0 else 0 }}

For the total in kWh the Riemann (for charging) is:
(I think I created it with the default values):

3 Likes

Perfect. Thanks so much.

1 Like

Has the rest command for changing cloud-only settings been working for people the past couple weeks? I’ve had a few rounds of it working, then needing another token and/or more cookie data, then not working.

It looks to me like this solution is still variable within the Uk just needs a little work as it requires a 1. GET to pull schedules 2. logic to work out what schedule to update 3. PUT request for new schedule 4. POST to validate schedule

I think with a bit of effort the token could be refreshed also if you are willing to put your username and password into the script.

Would anyone else find this useful in the UK?

Hello, I’m interested in those entities you show in the picture where you can select the Storage Mode profile, a toggle to enable or disable the Charge from the grid and others I don’t see them in my official Enphase integration. I have the firmware 8.3.10708.30. Any idea how to get those entities? Thanks in advance.

EDIT: Never mind, I just found them but not coming from Envoy 122xxxxxx but from Empower 122xxxxxx. The only one I’m missing is the Restrict discharge battery toggle. I’ll follow what @chinedu40 shared. Thanks all.

Hi, looks like it’s changed and requires a few more

disclaimer_type: itc
schedule_type: cfg
force_schedule_opted: true
charge_from_grid: true
accepted_itc_disclaimer: true

I’ve been trying to get it to work, but haven’t been able to. Have you updated yours, and does it work in October 2025?

Ok, i know this is a really old post but I’m trying to set this up. on HA Developer Tools ā€œServicesā€ doesn’t exist. I believe this is now Actions, but I can’t create this action (sorry, new to HA). How do I do this please?

OK, i’ve got further. I’m trying to set dtgControl (Discharge to Grid) but I’m getting a 403 back, strangely the error I’m getting is:
Payload: b'{"dtgControl":{"enabled":true}}
Even though I’m specifying:
payload: '{"dtgControl":{"enabled":{{ charge_value }}}}'

not sure where the extra b’ is coming from though (or if that’s the actual issue)

your enphase system is allowed to discharge on the Grid ? i guess it s perhaps no more allowed
perhaps @catsmanac can help you

and did you checked the @chinedu40 github ?