I’ve some problem setting up the integration
if i try curl -v 192.168.1.248:502
SOLAR 2000 reply
Connected to 192.168.1.248 (192.168.1.248) port 502 (#0)
GET / HTTP/1.1
Host: 192.168.1.248:502
User-Agent: curl/7.78.0
Accept: /
but in log i see
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?
Inverter model SUN2000-4KTL-L1
firmware V200R001C00SPC112
MBUS V100R001C00SPC300
First of all a big thank you to @Emilv2 and all others who have worked on this and helping out.
I have two SUN2000-4KTL-L1 and after a bit of struggle I have the now connected to HA on their LAN IP and it working good (at least for the last 24hrs).
One thing I can see is that all values are not on both inverters. Some values are just on one.
Has anyone else more than one inverter and has the templates already done on adding the values together and are willing to share?
I have seen that some of you use a nice card with the flow on, what card is that?
grid_exported_energy <–this must be the total amount of exported.
How can I get what I have exported today?
My grid_exported_energy value is now 142.8 and at the same time the web is telling me that I have exported 9.66 today
How do I get the todays numer or do I need to take current value minus yesterdays value that I need to store somewhere ?
You can have Modbus and custom component at the same time but not connected to inverter AP (only one connection is possible). So you need to use also LAN connected to smart dongle to have second integration. I tested it and no problem if one integration is connected to AP and second is using LAN cable.
Hello Rafal.
Unfortunately I can’t figure out how to use the data downloaded by the ETH dongle.
I now have integration and connect to the Inverter via the Inverter AP. For this I have a bridge made on the RPI.
Now i want to download data directly from dongl ETH.
I have this entry in config:
modbus:
name: Solar
type: tcp
host: 192.168.3.182
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: 10
Everything is OK I have an entity that gives the current solar production.
How do I get the other data? Such as the daily production of voltages and currents etc
PS. you can write in Polish…
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?
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?
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