cdpuk / givenergy-local

Home Assistant integration for local access to GivEnergy inverter and battery systems
MIT License
47 stars 14 forks source link

Update services.py #51

Closed reidjr closed 1 year ago

reidjr commented 1 year ago

For Activate Timed discharge mode and Activate timed discharge mode services. Replace set_mode_storage with client components, stopping BATTERY_SOC_RESERVE being forced to 100%.

cdpuk commented 1 year ago

I've taken a quick look but I'm now confused why setting Timed Discharge mode doesn't seem to work for me at all. Outside of the time slot it simply keeps discharging the battery. I don't think it's anything to do with this change, since changing the settings in the app has the same effect. I'll have to resume again another day.

reidjr commented 1 year ago

When you say "keeps discharging the battery", do you mean within the time slot it Dumps at full power, and outside meets demand ? That's what my Gen2 does. Or do you mean its totally broken, and it dumps at full power inside and outside the time slot ? As you say, either way probably unrelated to the patch :-) I hope !

cdpuk commented 1 year ago

Following activation of "Scheduled / Home Demand" via the app, I was seeing my battery discharge outside of the discharge slot. That clearly doeesn't make sense for any normal user.

I'm pretty sure this wasn't the case when I originally created this integration a year ago - I wonder if GE have changed what these high level actions do.

After trying this mode, I noticed that battery_power_mode was set to 1 (i.e Eco mode on). Turning this off achieves the desired effect - the battery does not discharge until the discharge slot is hit.

Many of the posts on the HA forum where individuals are asking for Eco mode control suddenly make sense!

reidjr commented 1 year ago

:-) I have had many such discussions on givenergy customer forum. In my view Timed Export/Discharge do what is "expected". Everyone else appears to expect something else :-). After some discussions, culminating in (https://github.com/cdpuk/givenergy-local/issues/48), I came to the conclusion that Gen1 and Gen2 observed behaviour was different

From both the app, and this patch, my gen2 dumps the battery during the discharge slot / selected timed period. The difference is that Timed Export / [scheduled + Full Export ] holds the charge outside the slot, and does not charge. Timed Discharge / [scheduled + Home demand] does the same within the slot, and charges from PV / meets home demand , so is "Eco" outside slot. Lots of posts state that "it doesnt revert to Eco after the slot" but I have never understood if theor observed behaviour is different/ erratic, or they are setting "timed Export"

I see a use case for both, depends really whether you are filling the battery from PV, ( timed discharge) or from a separately configured timed cheap rate charge slot ( timed export), before dumping in to a lucrative export slot. Thanks again for your really useful integration.