Closed gieljnssns closed 2 years ago
Thank you for providing the logs. I see frequent connection drops, do you have good connectivity to your inverter? Is the device connecting to the inverter WiFi close enough? Maybe you can run a ping to the inverter to check if you see the connection drops there too?
I'll increase the timeout values in an upcoming release, but I'm not sure that this will do much for you as the connections seem to drop entirely, and the Modbus-TCP implementation of Huawei does not handle this well. The integration periodically tries to reconnect (with a maximum of 5 seconds between attempts).
What inverter do you have?
I have an sun2000-4ktl-m1 inverter with firmware version V100R001C00SPC141 It is located about 1,5m of the intel nuc I'm using for HA. There is no wall in between them.
Indeed with ping I also have bad results
Yikes. Not much I can do in such a situation. I suggest you look into improving stability of your connection. I'll also be documenting the usage of the physical RS485_1 Modbus-interface on the future. You might consider using that instead.
@wlcrs I have downgraded my inverter to V100R001C00SPC135 again. Then the ping times where normal again. But the modbus port changed to 502 again. There is no way to change te modbus port in your integration. So I updated to V100R001C00SPC140. modbus port is 6607 again. And ping responses are normal.
You can change the port by removing and reinstalling the integration
Hello It happens to me... Unavailable sensors But only during 3 seconds... Can say, Around every 1h30m
Inverter firmware 141, last one
I'm connected over internal WiFi, with good coverage, with good ping, good connection. I'm using the stable version of the huawei_solar, I think it's 0.05 (after installing, I don't see the version... Sorry)
I only have 5 sensors activated on huawei_solar integration, but I update values every second.
I have changed from dongle LAN to internal WiFi, because I sow anywhere its faster...
My Log says SLAVEBUSY, as you can see above.
For my automations is important to have 1sec values. In Portugal we pay the electricity with a 15min balance, and my HA calculate that balance to make the automation triggers
There are some way to solve this?
Talking about performance... There are any difference between this integration and the HA Modbus?
Thanks for your GREAT WORK... Congratulations
You are trying to read faster from the inverter than it can handle, hence the SlaveBusy errors. Nothing I can change about this.
Changing to the native HA Modbus integration will not solve this: you will just get the same SlaveBusy errors, without the advantage of the multi-register-reads that this integration performs.
In the beta versions I automatically retry on SlaveBusy errors.
Reducing the number of activated entities in the integration will reduce the errors? For example, only the power yield 1 and 2
Do you know if the rs485 is faster? I don't have the necessary hardware... Rs2lan If it is a solution I could think about that...
Thanks for your patience 🙂
Sensors are bundled: one inverter bundle, one power meter bundle, one battery bundle, one pc string bundle. Enabling a sensor of one bundle will query all datafields of that bundle, regardless of how many are actually enabled.
I have not tried using the RS485_1 interface directly myself (yet). Any feedback would be appreciated on the performance of that interface vs using the WLAN or dongle.
On Tue, Feb 22, 2022, 23:00 gugaspinto @.***> wrote:
Reducing the number of activated entities in the integration will reduce the errors? For example, only the power yield 1 and 2
Do you know if the rs485 is faster? I don't have the necessary hardware... Rs2lan If it is a solution I could think about that...
Thanks for your patience 🙂
— Reply to this email directly, view it on GitHub https://github.com/wlcrs/huawei_solar/issues/29#issuecomment-1048253227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQM5LFDGO74B3FGYFS77KTU4QBQTANCNFSM5ORSNESA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
I built a template to manage when the inverter is unresponsive, or turned off at night.
template:
sensors:
template_inverter_active_power_availability:
friendly_name: Inverter active power
device_class: energy
unit_of_measurement: 'W'
value_template: '{{ 0 if states ("sensor.inverter_active_power") == "unavailable" else states ("sensor.inverter_active_power") }}'
This gives me live updates (and live daily yield numbers when the inverter is unreachable) on the front page (the gauges using sensor_inverter_active_power reports 0 when unavailable and does not replace the gauges with an error message). The calculations I do to present what the house consumes at the moment (solar power PLUS from grid MINUS to grid) is another template sensor;
template_active_power_consumption:
friendly_name: Power consumption
device_class: energy
unit_of_measurement: 'W'
value_template: '{{ states ("sensor.inverter_active_power")|int(0) + states ("sensor.lgf_active_power_import") | int(0) - states ("sensor.lgf_active_power_export")|int(0) }}'
Hope this helps @gieljnssns.
It would, however, be very nice if the inverter reported 0 "out-of-the-box" when not reachable.
I understand that it would be nice to have those entities report as 0, but that is not easy to implement: returning 0 for some registers would cause all kinds of problems and unintended consequences (monotonically increasing registers like total yield for example).
I think that your approach with templates is the best way forward to be honest.
The better solution is never have "unavailable" moments
What's your data update frequency? What kind of connection do you have with the inverter?
I collect data every second. I have some "unavailable" moments... I can say... 30 times a day...
I think it became worth when the integration updated to have rs485
I connect through dongle Lan directly to my router. I already tried inverter WiFi to my AP --> router. Same result
For me, it's impossible to have rs485 usb to my rpi. Can rs485 to Lan do a better result? Thanks
@gugaspinto How do you manage to query the inverter every second? Even if update the inverter values every 10 seconds the inverter stops sending data to Huawei FusionSolar. Or you don't care that no data is sent to FusionSolar?
I have a SUN200 4.6 KTL-L1 with SPC124 and connect via AP wifi
System Health details
System Health
Home Assistant Community Store
GitHub API | ok -- | -- Github API Calls Remaining | 5000 Installed Version | 1.22.0 Stage | running Available Repositories | 1060 Downloaded Repositories | 36Home Assistant Supervisor
host_os | Home Assistant OS 7.4 -- | -- update_channel | beta supervisor_version | supervisor-2022.01.1 docker_version | 20.10.9 disk_total | 457.7 GB disk_used | 112.5 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Samba share (9.5.1), AdGuard Home (4.4.4), AppDaemon 4 (0.8.1), Caddy (1.6), Check Home Assistant configuration (3.9.0), Duck DNS (1.14.0), ESPHome (2022.1.4), Mosquitto broker (6.0.1), Studio Code Server (4.1.0), WireGuard (0.6.0), MariaDB (2.4.0), Samba Backup (5.0.0), InfluxDB (4.3.0), Grafana (7.4.1), Frigate NVR (2.3), SSH & Web Terminal (10.0.2), Glances (0.14.2), phpMyAdmin (0.7.0), Mealie (0.5.6), Arpspoof (1.0.0), Caddy 2 (1.1.0), Firefly iii (5.6.14-2)Lovelace
dashboards | 3 -- | -- resources | 17 views | 18 mode | storageSpotify
api_endpoint_reachable | ok -- | --Describe the issue
My HA instance is connected to the internal wifi of the inverter And I'm using your latest version 1.0.0.a3, in the
manifest.json
it is still 1.0.0.a1All Huawei sensors are going unavailable for some time.
Reproduction steps
Relevant debug logs
This is the moment everything becomes unavailable
And this are all debug logs from going unavailable to available again, sorry for the very long logs...
https://paste.ubuntu.com/p/mFwtgHDwPK/