@ligeza@Emilv2 guys your help is required again. I moved from SD card to SSD and since then I can’t connect to the inverter in HA. I have the same configuration in the SD card and if I use the SD card everything starts working fine again.
I can successfully ping the inverter but it not populating.
Probably you are using the wrong port : 502 vs 6607 or you have more than 1 device connected to the Inverter AP. You can also try to swich OFF and ON the Inverter : DC switch to OFF and AC Circuit breaker OFF for couple of minutes then both back to ON. Wait for Inverter to reboot completely.
Hi,
I am about to order solar panels and Huawei 8KTL M1 inverter with battery. I have read through this forum roughly but count really find an answer to my question.
Is it possible from Home Assistant to change setting for battery charging? I mean if I have hourly rate I want to charge the battery directly from the external electrical net if the price is good enough. Especially wintertime here in Sweden when the solar panels won´t give enough. So maybe charge if the rate is what Tibber (where I buy the power) classify CHEAP or VERY CHEAP and change the setting to consume from battery when they classify the power as EXPENSIVE or VERY EXPENSIVE. The Tibber integration is no problem. I only wonder if I can send commands to change how Huawei act to charge the battery?
I’ve reverse engineered the login sequence to get write access to the required modbus registers to support this. It’s not unthinkable that Huawei changes the login sequence and breaks my implementation, but for the foreseeable future it should work.
I also plan to test using a direct wired connection to the RS485_1 pins which does not need the reverse engineered login process.
Another thing you need to be aware of: there are non-neglible standby losses of around 60W when you let your battery just do nothing while it is charged. (tested by setting "Maximum discharging power to 0W and watching the SOC of the battery drop). My guess is that this is due to all the electronics that stay online and ready to discharge in the battery and inverter. Also for low loads (<300W) - which is a typical household baseline usage - the efficiency is pretty poor (<90%), cfr the efficiency diagrams of the inverter that you are planning to buy.
Best to take this into account to calculate if charging on the cheaper times/discharging on the expensive times is worth the trouble.
Still having problem with this integration - connected through Dongle IP (dongle connected to my wifi). After restart it works for some time (1-10min) and then all sensors shows ‘unavailable’ here’s error:
This error originated from a custom integration.
Logger: custom_components.huawei_solar
Source: helpers/update_coordinator.py:219
Integration: Huawei Solar
First occurred: 10:38:32 (4 occurrences)
Last logged: 10:48:34
Error fetching HV20B0094425_data_update_coordinator data: Could not update HV20B0094425 values: Got error while reading from register 32064 with length 52: Exception Response(131, 3, SlaveFailure)
Error fetching HV20B0094425_data_upda
Preformatted textte_coordinator data: Could not update HV20B0094425 values: Got error while reading from register 32016 with length 4: Exception Response(131, 3, SlaveFailure)
Error fetching HV20B0094425_data_update_coordinator data: Could not update HV20B0094425 values: Could not read register value, has another device interrupted the connection?
My wifi signal is good, so it’s not this…
UPDATE: I switched off RS485 communication device, and it’s fine for 30 minutes now, looks like you can’t read via serial and modbus TCP at the same time (firmware dongle 127, inverter 141)
You can calculate kWh from kW if you want.
(I posted something about this before)
PS : If you have a battery then the Daily Solar Yield indicated by the huawei portal isn’t correct by the end of the day (at least in my opinion). They show a calculation using the battery and this calculation shows a decrease in Solar Yield even after sunset… (??? ) It’s acceptable just until sunset when Input Power becomes 0 kW. The decrease afterwards is due to the calculation using the battery and the losses involved with retrieving and storing the energy
After having about 1MWh energy goring through my battery, I can see that the losses are about 7-8%.
Those percentages will appear between the Daily Solar Yield at sunset (0W power) and Midnight (actualy sunrise, but you can’t verify this on the portal → check the Discharge vs daily energy yield at sunrise). They ‘hide’ those losses in the Solar Yield because one can’t argue against the sun…
Today they completed the installation of all inverters, batteries, etc …
I can ping the inverter to the address 192.168.200.1 through a wire connection.
I wanted to ask you what are the main steps to start the connection … in the discussion there are many examples but very fragmented, so I was wondering if someone could explain me the first steps to get something similar …
Grazie a tutti…
it started after I moved from SD card to SSD, which is strange because I was only using the backup from sd card. I think I should try the dongle method.
here is the latest error from logs
Logger: homeassistant.components.sensor
Source: custom_components/huawei_solar/sensor.py:135
Integration: Sensor (documentation, issues)
First occurred: 11:46:36 AM (1 occurrences)
Last logged: 11:46:36 AM
Error while setting up huawei_solar platform for sensor
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 303, in read_register
response = self.client.read_holding_registers(
File "/usr/local/lib/python3.9/site-packages/pymodbus/client/common.py", line 114, in read_holding_registers
return self.execute(request)
File "/usr/local/lib/python3.9/site-packages/pymodbus/client/sync.py", line 108, in execute
raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.200.1: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 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/huawei_solar/sensor.py", line 120, in setup_platform
HuaweiSolarSensor(inverter, config[CONF_OPTIMIZERS], config[CONF_BATTERY])
File "/config/custom_components/huawei_solar/sensor.py", line 135, in __init__
self._name = self._inverter.get("model_name").value
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 275, in get
response = self.read_register(reg.register, reg.length)
File "/usr/local/lib/python3.9/site-packages/huawei_solar/huawei_solar.py", line 308, in read_register
raise ConnectionException(ex)
huawei_solar.huawei_solar.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.200.1:502)]
`
Logger: homeassistant.config
Source: config.py:454
First occurred: 8:26:48 PM (1 occurrences)
Last logged: 8:26:48 PM
Invalid config for [sensor.huawei_solar]: [port] is an invalid option for [sensor.huawei_solar]. Check: sensor.huawei_solar->port. (See /config/configuration.yaml, line 25). Please check the docs at https://github.com/Emilv2/huawei_solar
Logger: homeassistant.config
Source: config.py:454
First occurred: 8:39:43 PM (1 occurrences)
Last logged: 8:39:43 PM
Invalid config for [sensor.huawei_solar]: [port] is an invalid option for [sensor.huawei_solar]. Check: sensor.huawei_solar->port. (See /config/configuration.yaml, line 25). Please check the docs at https://github.com/Emilv2/huawei_solar
WTH
now sensor is a invalid option
Logger: homeassistant.config
Source: config.py:454
First occurred: 9:13:07 PM (1 occurrences)
Last logged: 9:13:07 PM
Invalid config for [sensor.huawei_solar]: [sensors] is an invalid option for [sensor.huawei_solar]. Check: sensor.huawei_solar->sensors. (See /config/configuration.yaml, line 25). Please check the docs at https://github.com/Emilv2/huawei_solar
tried using TCP method with following code
# Modbus
modbus:
name: SolarSun2000
type: tcp
host: 192.168.18.239 (this being the IP of dongle)
port: 502
delay: 10
close_comm_on_error: true
retry_on_empty: true
retries: 10
sensors:
- name: Input Power
device_class: power
unit_of_measurement: kW
count: 2
address: 32064
data_type: int32
scale: 0.001
precision: 3
got this error
Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:291
Integration: Modbus (documentation, issues)
First occurred: 10:07:30 PM (1 occurrences)
Last logged: 10:07:30 PM
Pymodbus: SolarSun2000: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)