wlcrs / huawei_solar

Home Assistant integration for Huawei Solar inverters via Modbus
GNU Affero General Public License v3.0
543 stars 88 forks source link

[Bug]: No power meter data via modbus when in off grid mode #151

Closed CamHaug closed 1 year ago

CamHaug commented 1 year ago

System Health details

System Information

version core-2022.10.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.5
os_name Linux
os_version 5.15.72
arch x86_64
timezone Australia/Perth
config_dir /config
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 | 8
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home 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 | storage
Recorder 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.8

Huawei 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

2022-10-13 09:26:42.731 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 43006
2022-10-13 09:26:42.731 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:42.731 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 1
2022-10-13 09:26:49.338 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:26:49.339 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x1 0xe0
2022-10-13 09:26:49.339 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:49.339 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 1
2022-10-13 09:26:49.346 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform command_line is taking over 10 seconds.
2022-10-13 09:26:49.393 WARNING (MainThread) [pizone.discovery] Can't connect to discovered server at IP '192.168.44.105' exception: ConnectionError('Unable to connect to the controller')
2022-10-13 09:26:49.570 DEBUG (MainThread) [pymodbus.payload] [480]
2022-10-13 09:26:49.571 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:26:49.571 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x2 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:26:49.572 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 2
2022-10-13 09:26:50.385 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:50.385 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x2 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:50.386 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:50.386 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 2
2022-10-13 09:26:50.661 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:26:50.661 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30000
2022-10-13 09:26:50.662 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x3 0x0 0x0 0x0 0x6 0x1 0x3 0x75 0x30 0x0 0x19
2022-10-13 09:26:50.663 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 3
2022-10-13 09:26:51.591 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:26:51.591 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:26:51.591 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:51.591 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 3
2022-10-13 09:26:51.614 WARNING (MainThread) [homeassistant.setup] Setup of automation is taking over 10 seconds.
2022-10-13 09:26:51.693 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:26:51.693 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 30071
2022-10-13 09:26:51.694 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x4 0x0 0x0 0x0 0x6 0x1 0x3 0x75 0x77 0x0 0x1
2022-10-13 09:26:51.694 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 4
2022-10-13 09:26:52.733 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:52.733 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x4 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:52.733 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:52.733 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 4
2022-10-13 09:26:52.787 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:26:52.787 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37200
2022-10-13 09:26:52.788 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x5 0x0 0x0 0x0 0x6 0x1 0x3 0x91 0x50 0x0 0x1
2022-10-13 09:26:52.789 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 5
2022-10-13 09:26:53.735 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x5 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:53.736 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x5 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:53.736 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:53.736 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 5
2022-10-13 09:26:53.792 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:26:53.792 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37100
2022-10-13 09:26:53.792 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x6 0x0 0x0 0x0 0x6 0x1 0x3 0x90 0xec 0x0 0x1
2022-10-13 09:26:53.793 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 6
2022-10-13 09:26:54.173 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
2022-10-13 09:26:54.174 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x6 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x1
2022-10-13 09:26:54.174 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:54.174 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 6
2022-10-13 09:26:54.247 DEBUG (MainThread) [pymodbus.payload] [1]
2022-10-13 09:26:54.247 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 37125
2022-10-13 09:26:54.247 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x7 0x0 0x0 0x0 0x6 0x1 0x3 0x91 0x5 0x0 0x1
2022-10-13 09:26:54.249 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 7
2022-10-13 09:26:54.753 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:54.753 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x7 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:54.753 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:54.753 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 7
2022-10-13 09:26:54.805 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:26:54.806 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47000
2022-10-13 09:26:54.806 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x8 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0x98 0x0 0x1
2022-10-13 09:26:54.807 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 8
2022-10-13 09:26:55.702 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:55.702 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x8 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x2
2022-10-13 09:26:55.702 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:55.702 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 8
2022-10-13 09:26:55.753 DEBUG (MainThread) [pymodbus.payload] [2]
2022-10-13 09:26:55.753 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 47089
2022-10-13 09:26:55.753 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0x9 0x0 0x0 0x0 0x6 0x1 0x3 0xb7 0xf1 0x0 0x1
2022-10-13 09:26:55.754 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 9
2022-10-13 09:26:56.686 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0x9 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:56.686 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0x9 0x0 0x0 0x0 0x5 0x1 0x3 0x2 0x0 0x0
2022-10-13 09:26:56.686 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:56.686 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 9
2022-10-13 09:26:56.737 DEBUG (MainThread) [pymodbus.payload] [0]
2022-10-13 09:26:56.738 DEBUG (MainThread) [huawei_solar.huawei_solar] Reading register 32064
2022-10-13 09:26:56.738 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] send: 0x0 0xa 0x0 0x0 0x0 0x6 0x1 0x3 0x7d 0x40 0x0 0x34
2022-10-13 09:26:56.739 DEBUG (MainThread) [pymodbus.transaction] Adding transaction 10
2022-10-13 09:26:57.286 DEBUG (MainThread) [pymodbus.client.asynchronous.async_io] recv: 0x0 0xa 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x9 0x57 0x8 0xfc 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xf 0x88 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xc 0xa7 0x0 0x0 0x2 0xa4 0xff 0xff 0xfe 0x4e 0x3 0x49 0x13 0x88 0x27 0x10 0x0 0xec 0xb 0xb8 0x2 0x3 0x24 0xb9 0x63 0x47 0xb7 0x3 0xff 0xff 0xff 0xff 0x0 0x0 0x2 0x35 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 0xd4 0x0 0x0 0x0 0x2c 0x0 0x0 0x0 0x9e
2022-10-13 09:26:57.286 DEBUG (MainThread) [pymodbus.framer.socket_framer] Processing: 0x0 0xa 0x0 0x0 0x0 0x6b 0x1 0x3 0x68 0x0 0x0 0x9 0x57 0x8 0xfc 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xf 0x88 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xc 0xa7 0x0 0x0 0x2 0xa4 0xff 0xff 0xfe 0x4e 0x3 0x49 0x13 0x88 0x27 0x10 0x0 0xec 0xb 0xb8 0x2 0x3 0x24 0xb9 0x63 0x47 0xb7 0x3 0xff 0xff 0xff 0xff 0x0 0x0 0x2 0x35 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 0xd4 0x0 0x0 0x0 0x2c 0x0 0x0 0x0 0x9e
2022-10-13 09:26:57.286 DEBUG (MainThread) [pymodbus.factory] Factory Response[ReadHoldingRegistersResponse: 3]
2022-10-13 09:26:57.287 DEBUG (MainThread) [pymodbus.transaction] Getting transaction 10
2022-10-13 09:26:57.346 DEBUG (MainThread) [pymodbus.payload] [0, 2391, 2300, 0, 0, 0, 0, 0, 0, 3976, 0, 0, 0, 0, 0, 3239, 0, 676, 65535, 65102, 841, 5000, 10000, 236, 3000, 515, 9401, 25415, 46851, 65535, 65535, 0, 565, 0, 0, 0, 0, 0, 0, 0, 0, 2711, 5, 20237, 5, 52484, 25415, 56020, 0, 44, 0, 158]
2022-10-13 09:26:57.346 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\tW']
2022-10-13 09:26:57.348 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x0f\x88']
2022-10-13 09:26:57.348 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x00\x00']
2022-10-13 09:26:57.348 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x00\x00']
2022-10-13 09:26:57.349 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x0c\xa7']
2022-10-13 09:26:57.349 DEBUG (MainThread) [pymodbus.payload] [b'\x00\x00', b'\x02\xa4']
2022-10-13 09:26:57.349 DEBUG (MainThread) [pymodbus.payload] [b'\xff\xff', b'\xfeN']
2022-10-13 09:26:57.349 DEBUG (MainThread) [custom_components.huawei_solar] Finished fetching TA21A0018215_data_update_coordinator data in 0.611 seconds (success: False)
wlcrs commented 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?

CamHaug commented 1 year ago

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.
CamHaug commented 1 year ago

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 :(

wlcrs commented 1 year ago

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:

image

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...

CamHaug commented 1 year ago

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?

CamHaug commented 1 year ago

Also - Interestingly 344 is the model ID of my inverter image probably not a coincidence....

Cam

CamHaug commented 1 year ago

Never mind - I found it - Poor formatting in my document image

CamHaug commented 1 year ago

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
wlcrs commented 1 year ago

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.

CamHaug commented 1 year ago

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.

https://forum.huawei.com/enterprise/en/modbus-not-working-during-outages-or-fusionsolar-down/thread/1019116-100027?page=1&authorid=4893338

wlcrs commented 1 year ago

As there is nothing left for me to do in this issue, I'm closing it.

CamHaug commented 1 year ago

Just as a follow up - I tried this direct to the inverter with rs485 - the behavior on backup power is identical.