-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMA Inverter running modbus fails after time #120511
Comments
You are right what do you want me to respond differently. I have never disputed it might be a software problem, but there are a lot more software in play than just the modbus integration. Between the 2 versions even python itself was changed. I am sorry, but I have no idea where I should start looking for a problem within the modbus integration since there are no indications that it does something it should not do, all I can say is that at least some users including myself do not have a problem. |
That is after reloading the inverter and the integration of the 2024.6.3 container, gets connected again immediately. Will investigate further.
|
Reloading both does not help identify a problem, test if reloading just one of parts make it work again. Or did you mean reloading any of the parts make it work again? |
Container with 2024.3.3 runs smoothly the whole time. No interaction needed. Container with 2024.6.3 (or better said newer than 2024.3.3) stopped working (usually after 2 - 6 days), restarted the inverter as no connection is possible any longer (even with a restart/reload of the 2024.6.3 container). After the inverter restarted I reloaded only the 2024.6.3 container which is seen above. When I am right, in the image I use (linuxserver/homeassistant) python was upgraded to 3.12 in 2024.2 and since that image, it stayed with python 3.12 |
So it seems clearly your device is blocking reconnect.. the reason it disconnects can be too long between reads anyhow this is way beyond the modbus integration. |
Maybe true, but why is, at the same time, the container with 2024.3.3 still able to connect (even a restart of the container does not change that) without error? In the network both containers have the same ip from the server host. That said I can fire up more containers with 2024.3.3 and 2024.6.3, all 2024.3.3 containers get a connection while the others do not. Any option you could provide to have the time between reads changed? That would be great. |
There are a lot of technical reasons why the old version works and the new not, basically it's because more or less everything changed. This channel is for bugs not for support, I cannot help you more, I have given you several pointers..if you find something (fact) that points at the modbus integration I am happy to help. |
I’ve got same problem with my integration: homeassistant.components.modbus.modbus Pymodbus: sma: Error: device: 3 address: 30053 -> Modbus Error: [Connection] Not connected[AsyncModbusTcpClient 192.168.XXX.XXX:502] |
We won’t get any help here. I think you have to live with that. Tried it a couple of times … |
You will get bugs solved here, but not support....however I am still waiting for some indication that it is a problem in the modbus integration. |
Now here is an example of how a user with a problem that helps the maintainer with a good analysis, giving me something to work with !!! |
Are you running those two versions of Home Assistant in parallel, connecting to the same inverter? Configure the proxy to connect to the inverter, configure the clients (like HA) to connect to the proxy, not directly to the inverter. |
@Gnarfoz No I don't. That was just for testing. Usually I only connect with one client (one instance of HA) since ages, but it turns out that any version above HA 2024.3.3 starts disconnecting after time. Will further investigate and also check janiversen's post when I am home. edit: Will capture network traffic for the device, hopefully that helps more :) |
Ok, here you go @janiversen hope this helps better. The connection dropped in HA at 11:15:30 today.
I already changed the scan interval couple of days ago:
I just have theses three entities. |
You did not supply the modbus debug log, so I cannot relate the network traffic to what happens in modbus. With the debug file I would see the transaction number in the last valid message, which then would be easy to find in the network file. You are asking me to find a needle in a haystack, without knowing what a needle looks like. The only thing I can see is that your device closes the connection and do not accept new connection requests. |
My bad sorry. Forgot to switch on the debug log. Already switched that back on and will also log traffic again. Let’s wait till the error appears again. |
Good luck, I am no longer an active maintainer of the modbus integration, instead I will maintain a custom component. |
Maybe my custom integration for SMA-Devices is a solution for you: |
@florie1706: Has the error occurred again? I have the same problem with my SMA inverter and Modbus. I tried SMA WebConnect as an alternative, but my inverter seems to be too old (SMA SunnyBoy 5000 TL). At the moment I am regularly restarting my inverter. |
@janiversen If you are willing to check again, here are the logs: After hard restart of the inverter and reload of the modbus integration it came back online in HA. @littleyoda Saw that already and tested it successfully. I just had the modbus integration running for 2 years without a problem and as I need it for my walllboxes I tried to have as less integrations running as possible. Why does it say "not for production use"? This irritates me :) @gagman10 See above. I changed the scan intervals to different times, so the error does not appear as often, but still exists and the only way to get rid of it is to restart the inverter or use HA 2024.3.3 |
the hint was a relic from the first versions. I will remove it in the next version. The solution is now stable enough. One thing more to note (probably not relevant to the problems): There are reports in a German PV forum that Modbus stopped working after the last firmware update and the inverter (in this case tripower X) had to be restarted. |
My inverter is from 2011. So it is on the latest firmware since very long time (last and only one was before I started using HA and has to be done manually via SD card) |
@florie1706 Hi I just managed to fix this problem with my sma inverter. I had to add delay and timeout settings like this. hope this helps you.
|
Will give this a try. Thanks :) |
Thanks to @BrettLynch123 seems like it is working as expected again. Thanks to your config update :) |
The problem
When using a docker image later then 2024.3.3 the modbus connection will fail after about two days and just comes back up when restarting the inverter and HA.
What version of Home Assistant Core has the issue?
core-2024.6.3
What was the last working version of Home Assistant Core?
core-2024.3.3
What type of installation are you running?
Home Assistant Container
Integration causing the issue
modbus
Link to integration documentation on our website
http://home-assistant.io/integrations/modbus/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
The thing is @janiversen I know you will answer like there is nothing to see in the debug log. But actually the problem persists since 2024.4.0
That said my new test was to have two docker containers of HA running at the same time. First container is running 2024.3.3 which still runs great even with the inverter data. Second container runs the latest HA version and there the inverter data stopped yesterday (after two days where data was received) Log file is from the 2024.6.43 container which does not receive any data anymore. A restart of the second container did not bring back the data even the first container still gets updates thru modbus.
Only way for container two to get data again was restarting the inverter and the container afterwards.
I am sorry to not provide better debug logs but that is what I get out of the debug function.
I really think it is still software side of the modbus integration (update after 2024.3.3) as the hardware connection is still there in the 2024.3.3 container without any interruption.
Anyting I could further contribute?
The text was updated successfully, but these errors were encountered: