Sungrow Hybrid: simplify max discharge power reset configuration
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.
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 Thanks for pointing out the missing division by 10.
@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.
LGTM!
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)
Understood but thats not the case.
Yes, but this would be my expectation / requirement
You've mentioned that before. Happy to take a PR to provide such a service.
@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.
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 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.
@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.
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.
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
serviceinfrastructure? This would needPOSTparameters, 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.
Maybe, but it's not available now for this PR.