mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
342 stars 92 forks source link

Modbus no longer works #291

Closed Hirates closed 4 months ago

Hirates commented 4 months ago

Before you create an issue, make sure to update to the current version of modbus_sungrow.yaml

Describe the bug:

A clear and concise description of what the bug is.

Your Sungrow inverter:

Home Assistant version:

modbus_sungrow.yaml:

Inverter Firmware Status:

To Reproduce Steps to reproduce the behavior: I have been looking at developer options for a sensor and there is not available (Every Modbus sensor)

LOG:

Logger: homeassistant.components.modbus.modbus Quelle: components/modbus/modbus.py:331 Integration: Modbus (Dokumentation, Probleme) Erstmals aufgetreten: 5. Mai 2024 um 23:34:36 (1 Vorkommnisse) Zuletzt protokolliert: 5. Mai 2024 um 23:34:36

Pymodbus: SungrowSHx: Error: device: 1 address: 4999 -> Modbus Error: [Connection] Not connected[AsyncModbusTcpClient 192.168.1.240:502]

Expected behavior Can anyone tell me what is going on? I have checked the IP address of the inverter and restarted both Hass and the inverter, but I still get the error message.

I have never had similar errors, I have not changed a single bit of the modbus, but yesterday it stopped working

Screenshots If applicable, add screenshots to help explain your problem.

Bildschirmfoto 2024-05-06 um 09 22 39
mkaiser commented 4 months ago

Can you check with QModBusMaster if the connection is working in general?

https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/wiki/FAQ:-Problems-with-the-connection#check-3

Hirates commented 4 months ago

Debug

Thanks for the prompt reply, here is a screenshot. I think it isn't sending any data.

I've tested it with 192.168.1.240 and 192.168.001.240 both the same result.

mkaiser commented 4 months ago

Looks like the IP address of the inverter has changed.

Can you access your router and check? If you have the IP use a terminal / cmd prompt and ping the inverter:

should look like this:

image

Gnarfoz commented 4 months ago

If the address is unchanged, do you maybe have more than one thing accessing the inverter via Modbus? Even if not, the inverter's Modbus interface is finnicky and prone to just giving up entirely if it encounters anything it doesn't like (mostly: overlapping Modbus queries). A trivial remedy appears to be unplugging the network cable for a moment.

Hirates commented 4 months ago

I have changed the subnet of the inverter in my UDM Pro for further testing.  This caused the inverter to reconnect to the router. This solved the problem.

Thanks for your fast reply :)

tkahn commented 4 months ago

I had a similar error and it was also related to a subnet setting.

In Home Assistant (running on a Raspberry Pi) the IP was set to 192.168.1.XXX/32 which effectively made Home Assistant think it was all alone on its own subnet. It will assume that there are no other hosts within its subnet with which it can communicate directly (effectively a subnet setting of 255.255.255.255). The actual subnet setting of my network is 255.255.255.0. By changing this setting in Home Assistant to 192.168.1.XXX/24, Home Assistant got the correct subnet setting (255.255.255.0) and found the Sungrow inverter immediately after having rebooted Home Assistant.

mkaiser commented 4 months ago

@tkahn: good to know, thank you for the feedback!