Guys, it has been quite a steep learning curve getting to know home assistant, but now i could really need some help. I have followed your instructions and installed the sensor.py (not async), init.py and manifest.json in the folder config/custom_components/huawei_solar/.
I also added to the configuration.yaml:
sensor:
- platform: huawei_solar
host: '192.168.8.3'
I also added the connection to the SUN2000 internal wifi (192.168.8.3) to home assistant via the USB method. When i check with nmcli (on SSH & Web Terminal) using “nmcli con show” i can see i’m both connected to my ethernet as well as the SUN2000 internal wifi. However my log shows the inverter is not reachable. I tried to ping and result is “disconnected”. What am i missing?
Below the log output:
2020-05-20 12:48:56 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-05-20 12:48:56 WARNING (MainThread) [pymodbus.client.asynchronous] Not Importing deprecated clients. Dependency Twisted is not Installed
2020-05-20 12:48:59 ERROR (SyncWorker_17) [pymodbus.client.sync] Connection to (192.168.8.3, 502) failed: [Errno 113] Host is unreachable
2020-05-20 12:49:02 ERROR (SyncWorker_17) [pymodbus.client.sync] Connection to (192.168.8.3, 502) failed: [Errno 113] Host is unreachable
2020-05-20 12:49:02 ERROR (SyncWorker_17) [huawei_solar.huawei_solar] failed to connect to device, is the host correct?
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/huawei_solar/huawei_solar.py", line 147, in read_register
response = self.client.read_holding_registers(register, length)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/sync.py", line 107, in execute
raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.8.3:502)]
2020-05-20 12:49:02 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up huawei_solar platform for sensor
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/huawei_solar/huawei_solar.py", line 147, in read_register
response = self.client.read_holding_registers(register, length)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)
File "/usr/local/lib/python3.7/site-packages/pymodbus/client/sync.py", line 107, in execute
raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.8.3:502)]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/huawei_solar/sensor.py", line 78, in setup_platform
entities.append(HuaweiSolarSensor(inverter))
File "/config/custom_components/huawei_solar/sensor.py", line 90, in __init__
self._name = self._inverter.get("model_name").value
File "/usr/local/lib/python3.7/site-packages/huawei_solar/huawei_solar.py", line 40, in get
response = self.read_register(reg.register, reg.length)
File "/usr/local/lib/python3.7/site-packages/huawei_solar/huawei_solar.py", line 150, in read_register
raise ConnectionException(ex)
huawei_solar.huawei_solar.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.8.3:502)]