Enphase-API icon indicating copy to clipboard operation
Enphase-API copied to clipboard

POST request to force discharge of battery

Open chrisbeach opened this issue 1 year ago • 1 comments

I'd like to force my Enphase batteries to export to the grid when the export rate is high.

I notice a GET request to /ivp/sc/sched produces the following output, which contains a field Force Discharge

{'ACB_agg_energy': 0,
 'ACB_agg_soc': 0,
 'Agg Backup Energy': 0,
 'Agg VLS Energy': 500,
 'Charge From Grid Allowed': True,
 'ENC_agg_energy': 10000,
 'ENC_agg_soc': 100,
 'Force Discharge': False,
 'Num_of_acb': 0,
 'Num_of_enc': 2,
 'acb_current_mode': 1,
 'acb_debug_mode': -1,
 'agg_soc': 100,
 'max_energy': 10000,
 'sched_mode_key': ['ID - Idle',
                    'ZN - Zero Net',
                    'CG - Charge From Grid',
                    'DG - Discharge to Grid',
                    'ND - No Discharge',
                    'DL - Discharge to Load',
                    'CP - Charge From PV',
                    'HEMS Discharge',
                    'HEMS Charge']}

I have tried various forms of JSON POST request to the /ivp/sc/sched endpoint to try to set Force Discharge to True but all the requests have been rejected so far with { "err": "400 - Bad Request", "msg": "Unable to parse JSON request." }'

I'd really appreciate if someone could point me in the right direction with this. I reckon I could shave years off the payback time of my system if I could export excess energy from my battery.

chrisbeach avatar May 29 '24 15:05 chrisbeach

Enphase recently introduced a new feature to their app to schedule a daily forced discharge of the battery.

I'd still prefer to control it from an API though...

chrisbeach avatar Jun 24 '24 15:06 chrisbeach