evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Sungrow Hybrid: simplify max discharge power reset configuration

Open tantive opened this issue 1 month ago • 15 comments

Refactor max battery discharge power reset logic. Set normal mode discharge power to the value configured in evcc whenever evcc enters normal mode and thus removes the artifical discharge power limit to 0.01kW used during hold mode.

tantive avatar Nov 24 '25 17:11 tantive

I'm still not sure this is a good idea. But like I said, I can see you point. Ideally we would need to store the 'before' value to be able to reset it afterwards. But I don't think this is possible.

harmendp avatar Nov 24 '25 18:11 harmendp

@harmendp Thanks for pointing out the missing division by 10.

tantive avatar Nov 24 '25 19:11 tantive

@harmendp Can you explain why you removed the default usage of 5627 # BDC rated power in charge mode when maxchargepower is not set? https://github.com/evcc-io/evcc/blob/a72f0c3c5ff91be0aa724c9bef96bbec6f271820/templates/definition/meter/sungrow-hybrid.yaml

It might be an idea to reintroduce that for charge mode but also for normal mode to reset discharge power when maxdischargepower is not set.

tantive avatar Nov 24 '25 19:11 tantive

LGTM!

andig avatar Nov 25 '25 11:11 andig

Hello, my expectation as a evcc user would be that the values of max discharge/charge power are stored before changing by evcc and and then written back after the session.

And I would expect the following behavior:

  • Maximum charge power: Maximum charge power when charging the home battery
  • Minimum discharge power: Minimum power for discharging the home battery while the car is being charged (home battery not locked, in fast mode or planned charging)

Dodi1968 avatar Nov 25 '25 11:11 Dodi1968

Understood but thats not the case.

andig avatar Nov 25 '25 11:11 andig

Yes, but this would be my expectation / requirement

Dodi1968 avatar Nov 25 '25 11:11 Dodi1968

You've mentioned that before. Happy to take a PR to provide such a service.

andig avatar Nov 25 '25 13:11 andig

@harmendp Can you explain why you removed the default usage of 5627 # BDC rated power in charge mode when maxchargepower is not set? https://github.com/evcc-io/evcc/blob/a72f0c3c5ff91be0aa724c9bef96bbec6f271820/templates/definition/meter/sungrow-hybrid.yaml

It might be an idea to reintroduce that for charge mode but also for normal mode to reset discharge power when maxdischargepower is not set.

This register is 0 for me, and some other users on the forum. Does it has a value on yours? I have created an issue in iSolarcloud for Sungrow, but no reply yet.

harmendp avatar Nov 25 '25 19:11 harmendp

Iā€˜m thinking about adding a feature that can read modbus registers during configuration to be used as default values. Would that help?

/cc @naltatis wdyt using the new service infrastructure? This would need POST parameters, but no parsing yet.

andig avatar Nov 26 '25 07:11 andig

@andig Sure, reading registers and using those values as default might help. The intent of my last PR was that the user specifies the default values he wants to use in maxchargepower/maxdischargepower - as simple as that.

tantive avatar Nov 26 '25 19:11 tantive

@harmendp Can you explain why you removed the default usage of 5627 # BDC rated power in charge mode when maxchargepower is not set? https://github.com/evcc-io/evcc/blob/a72f0c3c5ff91be0aa724c9bef96bbec6f271820/templates/definition/meter/sungrow-hybrid.yaml It might be an idea to reintroduce that for charge mode but also for normal mode to reset discharge power when maxdischargepower is not set.

This register is 0 for me, and some other users on the forum. Does it has a value on yours? I have created an issue in iSolarcloud for Sungrow, but no reply yet.

Which inverter and which SW version? I can check the register on my SH10RT- 20 with SW 95.10 later.

tantive avatar Nov 26 '25 19:11 tantive

What do you think of using current behavior if maxdischargepower is not set

So if maxdischargepower <> 0 then use maxdischargepower else maxdischargepower reg == maxchargepower reg

This should not happen as the template specifies a default of 5000.

tantive avatar Nov 26 '25 19:11 tantive

Iā€˜m thinking about adding a feature that can read modbus registers during configuration to be used as default values. Would that help?

/cc @naltatis wdyt using the new service infrastructure? This would need POST parameters, but no parsing yet.

I think this is the way to go. Currently we are 'guessing' the previous reg value based on other registers, but this will never work 100% for everybody. If we can read it as a default value, then we can simply use the correct value @ restore in normal mode.

harmendp avatar Nov 29 '25 09:11 harmendp

Maybe, but it's not available now for this PR.

andig avatar Nov 29 '25 10:11 andig