Skip to content
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

[Bug]: Abnormal value for "Battery Total charge" #856

Open
5 tasks done
JensenNick opened this issue Nov 24, 2024 · 2 comments
Open
5 tasks done

[Bug]: Abnormal value for "Battery Total charge" #856

JensenNick opened this issue Nov 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@JensenNick
Copy link

JensenNick commented Nov 24, 2024

Describe the issue

I'm getting an very abnormal initial reading of the value for ´sensor.batteries_total_charge´ . The reading currently id about 463 MWh which of course isn't correct. I also se a smal deviation of the reading for ´sensor.batteries_total_discharge´. Here are the readings I get in the Huawei Solar integration and the values I have in the FusionSolar app.

The issue is also described in this discussion #628

2024-11-24_14-11-58

I have created a new instance of Home Assistant with a new install og the Huawei Solar integration. In order to get the initial value included in the debug log I have proceeded with these steps.

  1. Installed the Huawei Solar integration
  2. Enabled debug logging
  3. Reconfigured the integration
  4. Downloaded the debug log named "…145Z.log"

In order to "track" the reading of the modbus data from the battery I have logged the discharged and charged of the battery.

  1. Set up TOU to discharge from 13:32 until 13:42 and to charge from 13:45 to 13:50.
  2. Enabled debug logging
  3. Downloaded the debug log named "…270Z.log"

Included are also relevant exports from the sql-database as csv-files in order to track the values.

Describe your Huawei Solar Setup

Inverter #1 Type: Huawei SUN2000 10KTL-M1
Inverter #1 Firmware version: V100R001C00SPC165
Inverter #2 Type: Huawei SUN2000 3KTL-L1
Inverter #2 Firmware version: V200R001C00SPC142
sDongle present: Yes
sDongle Type: sDongleA-05 (WiFi / Ethernet)
sDongle Connectivitiy: Ethernet
sDongle Firmware: V200R022C10SPC121
Power meter present: three phase
Optimizers Present: No
Battery: LUNA2000-S1 10kWh
Battery Firmware version: V100R002C00SPC624
Huawei Solar integration version: 1.5.0a1

How do you connect to the inverter?

Please select your connection method

Upload your Diagnostics File

Drag & Drop your Diagnostics File here.
config_entry-huawei_solar-01JDF1SV35W5S3HFZ4PFK720ZP.json

home-assistant_huawei_solar_2024-11-24T12-26-27.145Z.log

home-assistant_huawei_solar_2024-11-24T12-57-02.270Z.log

states_total_charge_2024-11-24_14-34.csv

states_total_discharge_2024-11-24_14-35.csv

states_batteries_charge_discharge_2024-11-24_14-37.csv

Upload your relevant debug logs

Getting an error trying to copy/past the log here and I don't have an option to attach a file.

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@JensenNick JensenNick added the bug Something isn't working label Nov 24, 2024
@wlcrs
Copy link
Owner

wlcrs commented Nov 25, 2024

The total charge is stored in registers 37780 and 37781. We retrieve this by reading 28 registers, starting from register 37760.

2024-11-24 13:25:13.783 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37760 with length 28 from slave 1
2024-11-24 13:25:13.784 DEBUG (MainThread) [pymodbus.logging] send: 0x0 0x61 0x0 0x0 0x0 0x6 0x1 0x3 0x93 0x80 0x0 0x1c
2024-11-24 13:25:13.791 DEBUG (MainThread) [pymodbus.logging] recv: 0x0 0x61 0x0 0x0 0x0 0x3b 0x1 0x3 0x38 0x3 0xca 0x0 0x0 0x0 0x2 0x1b 0x16 0x0 0x0 0xff 0xff 0xff 0xee 0x0 0x0 0x27 0x10 0x0 0x0 0x27 0x10 0x0 0x0 0x27 0x10 0x0 0x0 0x27 0x10 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0xc2 0xf9 0x34 0x0 0x8 0x89 0x65 0x0 0x0 0x2 0xa4 0x0 0x0 0x0 0x1e old_data: addr=None

Register Hex value
37760 0x3 0xca
37761 0x0 0x0
37762 0x0 0x2
37763 0x1b 0x16
37764 0x0 0x0
37765 0xff 0xff
37766 0xff 0xee
37767 0x0 0x0
37768 0x27 0x10
37769 0x0 0x0
37770 0x27 0x10
37771 0x0 0x0
37772 0x27 0x10
37773 0x0 0x0
37774 0x27 0x10
37775 0x0 0x0
37776 0x0 0x0
37777 0x0 0x0
37778 0x0 0x0
37779 0x0 0x0
37780 0x2 0xc2
37781 0xf9 0x34
37782 0x0 0x8
37783 0x89 0x65
37784 0x0 0x0
37785 0x2 0xa4
37786 0x0 0x0
37787 0x0 0x1e

0x02c2f934 = 46332212

The total discharge can be read from the two registers following that:
0x00088965 = 559461

My conclusion is that the integration is working as intended, as it correctly decodes the values reported by the inverter.

@torwag
Copy link

torwag commented Nov 25, 2024

I may add, that I only see this for the main inverter but not for the two identical chained inverters. Would be good to hear if this is always the case as it might help to understand the issue.
As all inverters are read in in the same way, I follow @wlcrs statement, that the logic of the integration is correct.

There need to be something else wrong. Interestingly, the reading within the FusionSolar webpage is correct too. Which again, would mean Huawei reads in the register differently for the first inverter compared to the other inverters, or they read in all the inverters with the same logic, but then this problem starts to become puzzling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants