Thank you for you quick reply
I’ve been busy trying to get my inverter working but sadly no results yet.
I’ve asked my installer to update the firmware of the ethernet dongle so he has updated it to the latest version (V100R001C00SPC123). Since I dont have any wifi recepton where the inverter is located i’m keen on using the ethernet cable.
Now since the update i’m able to get the curl command to display some output and ping is working but modbus connection does not seem te be working.
I’ve tried the platform: huawei_solar and the direct modbus approach but it all gets stuck on no connection.
Pymodbus: Solar: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
or
021-09-14 08:14:37 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform huawei_solar is taking over 10 seconds.
2021-09-14 08:15:04 ERROR (SyncWorker_2) [huawei_solar.huawei_solar] could not read register value, is an other device already connected?
2021-09-14 08:15:04 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up huawei_solar platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/huawei_solar/sensor.py", line 115, in setup_platform
HuaweiSolarSensor(inverter, config[CONF_OPTIMIZERS], config[CONF_BATTERY])
File "/config/custom_components/huawei_solar/sensor.py", line 130, in __init__
self._name = self._inverter.get("model_name").value
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 265, in get
response = self.read_register(reg.register, reg.length)
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 312, in read_register
raise ReadException(message)
huawei_solar.huawei_solar.ReadException: could not read register value, is an other device already connected?
I’ve tried setting the slave to 1 or 0 but neither seem to work, also i’ve restarted the whole inverter several times to make sure I didn’t keep an test connection open with curl.
Is there anything else I can try?
What is your config? Maybe there is some mistake.
modbus:
- name: Solar
type: tcp
host: 192.168.1.13
port: 502
sensors:
- name: Solar SunPower
slave: 1
address: 32080
unit_of_measurement: W
data_type: int
count: 2
scale: 1
precision: 1
scan_interval: 30
This is my huawei_solar configuration
sensor:
- platform: huawei_solar
host: "192.168.1.13"
optimizers: false
battery: false
slave: 1
and this is my modbus configuration
modbus:
- name: Solar
type: tcp
host: 192.168.1.13
port: 502
sensors:
- name: Solar SunPower
slave: 1
address: 32080
unit_of_measurement: W
data_type: int
count: 2
scale: 1
precision: 1
scan_interval: 30
I think I’ve copy pasted it from an older post of you
Every time I test i comment out one method or delete it to make sure they are not both active at the same time.
how i can retrieve all the attribute from the inverter?
i don’t use modbus because i’vbe undestand that i can only use one connection at time: platform or modbus right?
Can you try read data using python?
sudo pip3 install huawei-solar==1.1.0
python3
import huawei_solar
inverter = huawei_solar.HuaweiSolar('192.168.1.13',502,5,3,1)
inverter.get("model_name")
Hmm it really seems that the inverter is not listening to modbus at all, maybe they disabled the modbus again in this new version??
As far as I know SPC123 should work correctly. Maybe there is another device connected. Did you try from other PC? Maybe something is blocking traffic on this port.
Very strange, i’ve indeed checked from the home assistant host and an virtual ubuntu on my laptop and the same results it cannot connect.
This evening I had a time to get close to the inverter (it is at our new house still in construction) and I connected my laptop to the SUN2000 wifi. Then doing your command I managed to get output.
Thanks for the tip, i’ll see if I can rule out that some other “thing” is connecting to modbus by putting the rj45 cable direct in my laptop. Just have to find an ethernet to usb cable since these new laptops don’t have rj45 anymore
OK So far I have benefited from your help. Now maybe I can help someone.
I attach a configuration entry containing all the most necessary entities with solar production data.
modbus:
- name: Solar
type: tcp
host: 192.168.3.182 (change to the IP address of your inverter)
port: 502
sensors:- name: active_power
slave: 1
address: 32080
unit_of_measurement: W
data_type: int
count: 2
scale: 1
precision: 1
scan_interval: 10 - name: input_power
slave: 1
address: 32064
unit_of_measurement: W
data_type: int
count: 2
scale: 1
precision: 1
scan_interval: 10 - name: day_active_power_peak
slave: 1
address: 32078
unit_of_measurement: W
data_type: int
count: 2
scale: 1
precision: 1
scan_interval: 10 - name: pv_01_voltage
slave: 1
address: 32016
unit_of_measurement: V
data_type: uint16
count: 1
scale: 0.1
precision: 2
scan_interval: 10 - name: pv_01_current
slave: 1
address: 32017
unit_of_measurement: A
data_type: uint16
count: 1
scale: 0.01
precision: 2
scan_interval: 10 - name: pv_02_voltage
slave: 1
address: 32018
unit_of_measurement: V
data_type: uint16
count: 1
scale: 0.1
precision: 2
scan_interval: 10 - name: pv_02_current
slave: 1
address: 32019
unit_of_measurement: A
data_type: uint16
count: 1
scale: 0.01
precision: 2
scan_interval: 10 - name: phase_A_voltage
slave: 1
address: 32069
unit_of_measurement: V
data_type: uint16
count: 1
scale: 0.1
precision: 2
scan_interval: 10 - name: phase_B_voltage
slave: 1
address: 32070
unit_of_measurement: V
data_type: uint16
count: 1
scale: 0.1
precision: 2
scan_interval: 10 - name: phase_C_voltage
slave: 1
address: 32071
unit_of_measurement: V
data_type: uint16
count: 1
scale: 0.1
precision: 1
scan_interval: 10 - name: phase_A_current
slave: 1
address: 32072
unit_of_measurement: A
data_type: int
count: 2
scale: 0.001
precision: 3
scan_interval: 10 - name: phase_B_current
slave: 1
address: 32074
unit_of_measurement: A
data_type: int
count: 2
scale: 0.001
precision: 3
scan_interval: 10 - name: phase_C_current
slave: 1
address: 32076
unit_of_measurement: A
data_type: int
count: 2
scale: 0.001
precision: 3
scan_interval: 10 - name: accumulated_yield_energy
slave: 1
address: 32106
unit_of_measurement: kWh
data_type: int
count: 2
scale: 0.01
precision: 1
scan_interval: 10 - name: daily_yield
slave: 1
address: 32114
unit_of_measurement: kWh
data_type: int
count: 2
scale: 0.01
precision: 2
scan_interval: 10
- name: active_power
Hi, Thanks for sharing your experiences. After reading them through I’ve decided to upgrade my SDongleA-05 firmware.
After upgrading to V100R001C00SPC123 I can make connection to modbus via ethernet and what’s more interesting - via Wi-Fi also (the dongle is connected to my main router).
Can someone share V100R001C00SPC123 firmware?
Cześć, jakiego routera (model) używasz do połączenia z ap falownika? Mam podobną sytuacje z umiejscowieniem falownika, a ha mam postawione na proxmoxie w zupełnie innym miejscu.
I can not see this version in the Huawei website. Last public for V100R001 is V100R001C00SPC600
What’s the difference between V100R001 and V200R001 (mine) ?
OK, since we have several power outtages lately and the LUNA battery doesn’t come until 2 weeks from now.
How do you restart your inverters so you can connect from HA again?
Do I relly need to turn off AC-> Turn off DC - > Wait at least 30 sec → Turn on DC → Turn on AC
Isn’t there a better way to clear the connection?
Do wczoraj używałem tp-link wr841n z DD-WRT (aby był AP klient ) o ile dobrze pamiętam, ale robiłem migrację z LXC na LXD to podpiąłem na razie kabelkiem LAN.
Cześć zrobiłem Bridge przez starego tplink, falownik jest połączony z moją siecią, ale nie wiem jak dalej z nim rozmawiać z HA. W integracji wskazałem na adres tego routerka ale dalej się nie komunikuje. Tego MAC adresu również nie widzę w mojej sieci… Nie pytał mnie również o hasło…
co jeszcze powinienem sprawdzić / zrobić?
W konfiguracji routera raczej ci nie pomogę, ale falownik ma zazwyczaj Ip 192.168.8.1 lub 192.168.200.1. Nie wiem dokładnie jak działa bridge w oryginalnym sofcie tp-link, ale na dd-wrt falownik mam jaką odrębną podsieć i do karty sieciowej z HA przypisany wirtualny adres z podsieci falownika. Wcześniej opisywałem już tą konfigurację, również inna osoba opisywała inny sposób konfiguracji bridge w tym wątku.
Hi
This is the file for MODBUS in Hassio integration , that I created for SUN2000L V2, where the slave is in position “0” I added some other parameters only for one stream and optimizers
Im working to import data optimizers
I can confirm. Now I don’t need LAN cable. With firmware SPC123 I can connect directly to smart dongle and read data with slave: 1