Closed CamHaug closed 1 year ago
I don't see an error appearing in the logs, so I don't have anything actionable to work with.
A related issue is #108 . Do you see similar behavior? How do you connect to the inverter? Via the SDongleA?
Yeah - sounds like that exact behavior
Left it running debug logs today (power is still out) look like there are some errors there now
2022-10-13 09:27:20.615 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:27:20.616 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:27:20.616 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 2
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0x58
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0x58
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 2
2022-10-13 09:27:21.740 DEBUG (MainThread) [pymodbus.payload] [344]
2022-10-13 09:27:21.740 ERROR (MainThread) [huawei_solar.huawei_solar] Aborting client creation due to error.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 153, in create
await huawei_solar._initialize()
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 122, in _initialize
self.battery_type = (await self.get(rn.STORAGE_UNIT_1_PRODUCT_MODEL)).value
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 248, in get
return (await self.get_multiple([name], slave))[0]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 298, in get_multiple
result = [await self._decode_response(registers[0], decoder)]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 240, in _decode_response
result = reg.decode(decoder, self)
File "/usr/local/lib/python3.10/site-packages/huawei_solar/registers.py", line 78, in decode
result = self.unit(result)
File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
return cls.__new__(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
raise ve_exc
ValueError: 344 is not a valid StorageProductModel
2022-10-13 09:27:21.745 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SUN2000-5KTL-L1 for huawei_solar
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/huawei_solar/__init__.py", line 142, in async_setup_entry
raise err
File "/config/custom_components/huawei_solar/__init__.py", line 56, in async_setup_entry
primary_bridge = await HuaweiSolarBridge.create(
File "/usr/local/lib/python3.10/site-packages/huawei_solar/bridge.py", line 76, in create
client = await AsyncHuaweiSolar.create(host, port, slave_id, loop=loop)
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 163, in create
raise err
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 153, in create
await huawei_solar._initialize()
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 122, in _initialize
self.battery_type = (await self.get(rn.STORAGE_UNIT_1_PRODUCT_MODEL)).value
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 248, in get
return (await self.get_multiple([name], slave))[0]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 298, in get_multiple
result = [await self._decode_response(registers[0], decoder)]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 240, in _decode_response
result = reg.decode(decoder, self)
File "/usr/local/lib/python3.10/site-packages/huawei_solar/registers.py", line 78, in decode
result = self.unit(result)
File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
return cls.__new__(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
raise ve_exc
ValueError: 344 is not a valid StorageProductModel
2022-10-13 09:27:21.747 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Client disconnected from modbus server: None
2022-10-13 09:27:21.748 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
Also, yes - connected via Sdongle however the behavior was the same when I was connecting via the internal wireless on the inverter, I got the dongle in the hope it would solve the issue :(
Thanks for the additional logs. It shows a different behavior than the previous issue. Your inverter is responding with an invalid response when querying the battery type: It receives value 344 while only 0, 1 or 2 are valid answers:
The setup of the integration subsequently fails and the connection is closed (not necessarily by the inverter).
As I don't have a backup box myself, it is not possible for me to debug this issue myself. I encourage you (and other backup box owners) to experiment with the underlying library and raise a PR when you're able to get everything going.
You could also try to use a serial connection via the RS485 pins, but I can't give you any assurances that this would work any better...
I can't even find that register (47000) in the doco I have for the version I am running? Could you please link to your document?
Also - Interestingly 344 is the model ID of my inverter probably not a coincidence....
Cam
Never mind - I found it - Poor formatting in my document
Another point worth mentioning: The integration read 47000 several times DURING the power outage with no issues it then failed after that with 344...
2022-10-13 09:26:57.511 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Client connected to modbus server
2022-10-13 09:26:57.511 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-10-13 09:26:57.514 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.44.20:502.
2022-10-13 09:26:59.663 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2022-10-13 09:26:59.665 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x3 0xa7 0xfe 0x0 0x1
2022-10-13 09:26:59.666 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 1
2022-10-13 09:27:00.012 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:27:00.012 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:27:00.012 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:00.012 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 1
2022-10-13 09:27:00.093 DEBUG (MainThread) [pymodbus.payload] [480]
2022-10-13 09:27:00.093 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:27:00.094 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:27:00.100 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 2
2022-10-13 09:27:00.518 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:00.518 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:00.518 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:00.519 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 2
2022-10-13 09:27:00.571 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:27:00.571 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30000
2022-10-13 09:27:00.571 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x3 0x75 0x30 0x0 0x19
2022-10-13 09:27:00.572 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 3
2022-10-13 09:27:01.690 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x3 0x0 0x0 0x0 0x35 0x1 0x3 0x32 0x53 0x55 0x4e 0x32 0x30 0x30 0x30 0x2d 0x35 0x4b 0x54 0x4c 0x2d 0x4c 0x31 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x54 0x41 0x32 0x31 0x41 0x30 0x30 0x31 0x38 0x32 0x31 0x35 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
2022-10-13 09:27:01.690 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x3 0x0 0x0 0x0 0x35 0x1 0x3 0x32 0x53 0x55 0x4e 0x32 0x30 0x30 0x30 0x2d 0x35 0x4b 0x54 0x4c 0x2d 0x4c 0x31 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x54 0x41 0x32 0x31 0x41 0x30 0x30 0x31 0x38 0x32 0x31 0x35 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
2022-10-13 09:27:01.690 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:01.690 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 3
2022-10-13 09:27:01.747 DEBUG (MainThread) [pymodbus.payload] [21333, 20018, 12336, 12333, 13643, 21580, 11596, 12544, 0, 0, 0, 0, 0, 0, 0, 21569, 12849, 16688, 12337, 14386, 12597, 0, 0, 0, 0]
2022-10-13 09:27:01.747 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30071
2022-10-13 09:27:01.748 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x3 0x75 0x77 0x0 0x1
2022-10-13 09:27:01.748 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 4
2022-10-13 09:27:02.758 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:02.759 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:02.759 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:02.759 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 4
2022-10-13 09:27:02.810 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:27:02.811 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37200
2022-10-13 09:27:02.811 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x3 0x91 0x50 0x0 0x1
2022-10-13 09:27:02.812 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 5
2022-10-13 09:27:03.338 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x5 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:03.338 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x5 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:03.338 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:03.339 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 5
2022-10-13 09:27:03.389 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:27:03.390 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37100
2022-10-13 09:27:03.390 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x3 0x90 0xec 0x0 0x1
2022-10-13 09:27:03.390 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 6
2022-10-13 09:27:03.966 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
2022-10-13 09:27:03.966 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
2022-10-13 09:27:03.966 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:03.967 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 6
2022-10-13 09:27:04.018 DEBUG (MainThread) [pymodbus.payload] [1]
2022-10-13 09:27:04.018 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37125
2022-10-13 09:27:04.018 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x3 0x91 0x5 0x0 0x1
2022-10-13 09:27:04.019 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 7
2022-10-13 09:27:05.138 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:05.138 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:05.138 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:05.138 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 7
2022-10-13 09:27:05.190 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:27:05.190 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:27:05.191 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:27:05.192 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 8
2022-10-13 09:27:05.916 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:05.916 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:27:05.916 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:05.916 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 8
2022-10-13 09:27:05.967 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:27:05.967 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47089
2022-10-13 09:27:05.967 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0xf1 0x0 0x1
2022-10-13 09:27:05.968 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 9
2022-10-13 09:27:06.723 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x9 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:06.723 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x9 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:27:06.723 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:06.724 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 9
2022-10-13 09:27:06.774 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:27:06.775 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-10-13 09:27:06.775 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0xa 0x0 0x0 0x0 0x6 0x1 0x3 0x7d 0x40 0x0 0x34
2022-10-13 09:27:06.775 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 10
2022-10-13 09:27:07.964 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0xa 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x9 0xcc 0x8 0xfc 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xf 0x74 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xc 0xa7 0x0 0x0 0x2 0x9f 0xff 0xff 0xfe 0x4f 0x3 0x48 0x13 0x88 0x27 0x10 0x0 0xec 0xb 0xb8 0x2 0x3 0x24 0xb9 0x63 0x47 0xb7 0x3 0xff 0xff 0xff 0xff 0x0 0x0 0x2 0x93 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xa 0x97 0x0 0x5 0x4f 0xd 0x0 0x5 0xcd 0x4 0x63 0x47 0xda 0xe2 0x0 0x0 0x0 0x2c 0x0 0x0 0x0 0x9e
2022-10-13 09:27:07.965 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0xa 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x9 0xcc 0x8 0xfc 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xf 0x74 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xc 0xa7 0x0 0x0 0x2 0x9f 0xff 0xff 0xfe 0x4f 0x3 0x48 0x13 0x88 0x27 0x10 0x0 0xec 0xb 0xb8 0x2 0x3 0x24 0xb9 0x63 0x47 0xb7 0x3 0xff 0xff 0xff 0xff 0x0 0x0 0x2 0x93 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xa 0x97 0x0 0x5 0x4f 0xd 0x0 0x5 0xcd 0x4 0x63 0x47 0xda 0xe2 0x0 0x0 0x0 0x2c 0x0 0x0 0x0 0x9e
2022-10-13 09:27:07.965 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:07.965 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 10
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [0, 2508, 2300, 0, 0, 0, 0, 0, 0, 3956, 0, 0, 0, 0, 0, 3239, 0, 671, 65535, 65103, 840, 5000, 10000, 236, 3000, 515, 9401, 25415, 46851, 65535, 65535, 0, 659, 0, 0, 0, 0, 0, 0, 0, 0, 2711, 5, 20237, 5, 52484, 25415, 56034, 0, 44, 0, 158]
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\t\xcc']
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x0ft']
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x00\x00']
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x00\x00']
2022-10-13 09:27:08.016 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x0c\xa7']
2022-10-13 09:27:08.017 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x02\x9f']
2022-10-13 09:27:08.017 DEBUG (MainThread) [pymodbus.payload] [b'\xff\xff', b'\xfeO']
2022-10-13 09:27:08.017 DEBUG (MainThread) [custom_components.huawei_solar] Finished fetching TA21A0018215_data_update_coordinator data in 1.243 seconds (success: False)
2022-10-13 09:27:08.017 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Client disconnected from modbus server: None
2022-10-13 09:27:08.018 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol lost connection.
2022-10-13 09:27:18.018 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting to 192.168.44.20:502.
2022-10-13 09:27:18.018 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Connecting.
2022-10-13 09:27:18.021 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] Client connected to modbus server
2022-10-13 09:27:18.021 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Protocol made connection.
2022-10-13 09:27:18.021 INFO (MainThread) [pymodbus.client.asynchronous.async_io] Connected to 192.168.44.20:502.
2022-10-13 09:27:19.022 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2022-10-13 09:27:19.022 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x3 0xa7 0xfe 0x0 0x1
2022-10-13 09:27:19.022 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 1
2022-10-13 09:27:20.564 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:27:20.564 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:27:20.564 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:20.564 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 1
2022-10-13 09:27:20.615 DEBUG (MainThread) [pymodbus.payload] [480]
2022-10-13 09:27:20.615 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:27:20.616 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:27:20.616 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 2
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0x58
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0x58
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:27:21.689 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 2
2022-10-13 09:27:21.740 DEBUG (MainThread) [pymodbus.payload] [344]
2022-10-13 09:27:21.740 ERROR (MainThread) [huawei_solar.huawei_solar] Aborting client creation due to error.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 153, in create
await huawei_solar._initialize()
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 122, in _initialize
self.battery_type = (await self.get(rn.STORAGE_UNIT_1_PRODUCT_MODEL)).value
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 248, in get
return (await self.get_multiple([name], slave))[0]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 298, in get_multiple
result = [await self._decode_response(registers[0], decoder)]
File "/usr/local/lib/python3.10/site-packages/huawei_solar/huawei_solar.py", line 240, in _decode_response
result = reg.decode(decoder, self)
File "/usr/local/lib/python3.10/site-packages/huawei_solar/registers.py", line 78, in decode
result = self.unit(result)
File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
return cls.__new__(cls, value)
File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
raise ve_exc
ValueError: 344 is not a valid StorageProductModel
Ok, thank you for checking that. So this confirms that the connection via the SDongleA is also forcibly closed during off-grid mode. Register 47000 is normally only read if the integration needs to re-connect to the inverter. In normal conditions the connection stays open and that register is not repeatedly read.
When I revisit the connection initiation logic, I'll try to catch unexpected responses and do a retry instead of failing completely. However, this will not result in a stable off-grid connection I'm afraid.
There is a thread on the Huawei forums about this - single admin response does not look good so far: 'in the case of power failure modbus stops running' I hope that is a miscommunication.
As there is nothing left for me to do in this issue, I'm closing it.
Just as a follow up - I tried this direct to the inverter with rs485 - the behavior on backup power is identical.
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4993 Installed Version | 1.28.0 Stage | running Available Repositories | 1118 Downloaded Repositories | 8Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 9.2 -- | -- update_channel | stable supervisor_version | supervisor-2022.10.0 agent_version | 1.4.1 docker_version | 20.10.17 disk_total | 916.2 GB disk_used | 665.9 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | File editor (5.4.1), Let's Encrypt (4.12.7), Mosquitto broker (6.1.3), InfluxDB (4.5.0), Grafana (8.0.2), Zigbee2MQTT (1.28.0-1), MariaDB (2.5.1), ESPHome (2022.3.1), Samba share (10.0.0), Double Take (1.12.1), Exadel CompreFace (1.0.0), Nginx Proxy Manager (0.12.2), Terminal & SSH (9.6.1), RPC Shutdown (2.2), phpMyAdmin (0.8.1), Frigate (Full Access) (0.11.1)Dashboards
dashboards | 2 -- | -- resources | 1 views | 5 mode | storageRecorder
oldest_recorder_run | October 3, 2022 at 11:09 PM -- | -- current_recorder_run | October 13, 2022 at 7:38 AM estimated_db_size | 1735.16 MiB database_engine | mysql database_version | 10.6.8Huawei Solar Setup
SUN2000-5KTL-L1 LUNA2000 Smart Meter Single phase DDSU666 SDongleA-05 (this IS powered when in off grid mode)
Describe the issue
I lose data via the integration when in off grid mode - I can still see everything as normal via the portal, and directly on the device via the sun2000 app. Does anyone else have this issue? It is pretty annoying as during off grid mode I want MORE info on the system so I can stay online longer - really hope this isn't a limitation at Huawei's end though I am guessing it might be... although it seems modbus comms might still be happening according to logs?
Cheers,
Cam
Relevant debug logs