-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change battery_power to S16 #58
Conversation
The docs seem to be incorrect here. When the battery is _charging_ the `battery_power` is negative. See https://discord.com/channels/936031869001158666/936031869001158669/994762394511347802
This doesn't seem to be correct. My battery is charging at the moment but the value is still positive. I'm using 13001 (battery_charging) with some mapping (-1 for discharge and 1 for charge) and multiply with 13022 to get a negative value if discharging. Maybe the value is negative when discharging? I will see this evening. |
Hmm perhaps despite their documentation it is not consistent across models. What inverter do you have @michbeck100? |
SH10RT. What about you? I would expect at least the models SHxRT to have the same registers. Or I need a firmware update? |
I am on SH5.0RS, which I suspect should be pretty similar as they are the same series, just three-phase vs single-phase, right? |
Yes, right. At least the change doesn't break anything. |
Here's the graph from home assistant before and after the fix. Clearly only the latter makes sense, but it's certainly possible that there is a bug across inverters here.
Is it a reasonable positive value? If it's equivalent to my negative value then I'd say it's definitely a bug across inverter models or firmware versions 🙄 |
The values on my side make totally sense. But it seems that some of your values are at least questionable. Do you really have a battery state of health of 10 %? And battery_current seems to be a little high. Actually I would expect What type of battery are you using? |
No, this is a separate issue. It's correct if I connect over
TBH, I actually think I changed it to an S16 locally, and it looks correct (assuming the amperage is ~-4.86, but it truncated to -4.8):
That is not far off from true. It was certified and turned on only yesterday, installed about 2 weeks ago.
Yes, possibly this is battery-specific. It's hard to say without more knowledge about Sungrow's internal COMs architecture. Definitely seems plausible, though.
Sungrow's SBR line. 12.8 kWh in modules, so that'd make it an SBR128. What about you? |
I use a BYD battery. The values seem to be completely correct.
Which seems to make sense for DC, since it's the opposite of discharging. And this would explain why the battery_power is negative as well. My guess: these values come directly from the battery instead of being measured by the inverter. That's why we have a different leading sign.
What do you mean by "connect over modbus" and "incorrect over http". Are you referring to the different output channels of SunGather? These values don't differ as the accuracy is applied directly after reading the registers from modbus. So the values are the same for all outputs. |
No, I am referring to the connection type
The values returned by the WiNet-S modbus TCP vs the http workaround by @bohdan-s differ. I can't fathom why other than a bug in Sungrow firmware somewhere (either on the WiNet-S's modbus implementation, web UI, or elsewhere). It's 100% reproducible. Connecting over |
Ok, understand. I would suggest you use a custom version of SunGather and change the accuracy of |
Yep I'm doing that. I'm only going into it since you seemed to be surprised by some values. I just wanted to show why I don't believe it is related to the
Of course. That doesn't concern me, only the order of magnitude difference did! |
As to this specific issue: if the register data type is varying by battery that's pretty hard to handle robustly in this library. I'm not sure what the answer is here without more information. |
I think it's better to use signed integers instead of unsigned. And then it's up to the user to work with these values. As long as data type stays stable for the used setup. |
Then I imagine |
obviously |
@bohdan-s there are two |
@michbek100 I'm not sure what your screenshot shows there. You are showing 13109 which is consistent with the registers file. Maybe I am misinterpreting the PDF, but 13021 doesn't list any models, which I take to mean "all hybrid inverters" (at least which are mentioned under "valid device types" header on page 2. |
@bjeanes Probably you are right. That means that these inverters support the same value on register 13109 and 13021. But is there somebody to confirm that? |
The docs seem to be incorrect here. When the battery is charging the
battery_power
is negative.See https://discord.com/channels/936031869001158666/936031869001158669/994762394511347802