Closed johanschelin closed 1 year ago
Hey there @adamchengtkc, @janiversen, @vzahradnik, mind taking a look at this issue as it has been labeled with an integration (modbus
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
modbus documentation modbus source (message by IssueLinks)
It seems you have installed the new version, without updating the requirements. This month release uses a new version of pymodbus.
Please do not add to a milestone, unless you intent to fix it yourself !
You state it is “restart” that is not working, which is strange because this error should prohibit modbus from starting in the first place.
It seems you have installed the new version, without updating the requirements. This month release uses a new version of pymodbus.
Hello Jan and thanks for quick answers. I am beta-testing 2023.2.0b4 and this seems to be an issue in that beta then, that should be fixed before going public?
You state it is “restart” that is not working, which is strange because this error should prohibit modbus from starting in the first place.
My error is described as below, so you are correct that it does not work in the first place, and it prevents restart:
"Modbus stops working and HA cannot restart. Removing modbus from configuration.yaml makes restart working."
Just checked 2023.2.0b4, requirements_all.txt contains:
# homeassistant.components.modbus
pymodbus==3.1.1
And I just did a fresh install of 2023.2.0b4, it runs without problems.
Please verify that you have pymodbus=3.1.1 installed, without that you will get exactly the error you have, you most likely have the old pymodbus.
@johanschelin do you have a custom integration installed that also relies on modbus? Do you have a deps
folder in your config dir? Maybe an old modbus package got installed there.
Just trying to upgrade one of my production systems to see that the UI based upgrade have a problem (which I do not believe).
Ok. Something wrong with the update perhaps. how do I confirm the version I use? How do I update it manually? Otherwise the production release is just around the corner and perhaps solves this as it should be updated then.
As expected it starts without problems: ´´´ 2023-01-29 20:02:28.005 INFO (SyncWorker_7) [homeassistant.components.modbus.modbus] modbus solar communication open
2023-01-29 20:02:28.095 INFO (MainThread) [homeassistant.setup] Setup of domain modbus took 0.1 seconds
´´´
@johanschelin do you have a custom integration installed that also relies on modbus? Do you have a
deps
folder in your config dir? Maybe an old modbus package got installed there.
Hi @balloob
Yes I do run both SolarEdge and Sonnenbatterie from HACS which use modbus. https://github.com/binsentsu/home-assistant-solaredge-modbus https://github.com/weltmeyer/ha_sonnenbatterie
I do have 'deps' folder in my config directory, it is empty though
Your solaredge intgration relies on modbus 1.5 https://github.com/binsentsu/home-assistant-solaredge-modbus/blob/master/custom_components/solaredge_modbus/manifest.json#L5
So this is not an issue in Home Assistant.
Ok - as I understand it - using the Solaredge Modbus from Hacs prevents the modbus to update to the versoin that 2023.2.x will use.
Does that mean that modbus will break for anyone using 2023.2.x when it is released - if they still want to use the solaredge integration? And that my only option is to uninstall the Solaredge modbus before upgrading?
Just to be clear, it is the "normal" modbus that i configure in configuration.yaml that stops working after upgrade to 2023.2 beta. The solaredge and sonnenbatterie works. So this will probably happen to all users of the Solaredge Modbus HACS integration.
Understand that this is not a HA issue in that case, but should be written as a Breaking Change or a note in the update. I can contact the hacs-integration owner and refer to this thread so he can update to reqs and support the new modbus library.
SolarEdge have
"requirements": ["pymodbus==1.5.2"]
seems that have not been updated for years. BUT this cannot have worked with 2023.1.x as stated in the description.
The modbus integration stopped using pymodbus version 1.5.2 a couple of years ago.
Please disable your custom components, then modbus will start to work.
SolarEdge have
"requirements": ["pymodbus==1.5.2"]
seems that have not been updated for years. BUT this cannot have worked with 2023.1.x as stated in the description.
The modbus integration stopped using pymodbus version 1.5.2 a couple of years ago.
Please disable your custom components, then modbus will start to work.
Ok, that is interestering... Because the Solaredge integrations still works fine, i get information from it - showing the very little energy produced today, and all the data from my AC Voltage and so on... The Sonnenbatterie also works and is sending info right now. So does the oficiall Nibe Integration that also uses modbus....
So, it seems like the integrations that provide modbus actually work, but not if I use config.yaml (which I use for 3-4 sensors that are not available in the Nibe integration yet).
Will test to disable SolarEdge it to definitely nail what is the problem.
Now tested to disable both SolarEdge Modbus and Sonnenbatterie integrations and restarted. As you said, the core modbus then works fine. Enabled Sonnenbatterie, and it still works fine. Enabled Solaredge Modbus and then the problem is now inverted - meaning that the core modbus works, but the SolarEdge does not start (probably because it is using an old modbus version). Showing this in the log so it is searchable for others that get this problem.
2023-01-29 20:53:36.473 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration solaredge_modbus: Unable to import component: No module named 'pymodbus.client.sync'
So... to conclude this:
Solution:
https://github.com/WillCodeForCats/solaredge-modbus-multi
Thanks for the help @balloob and @janiversen . Hopefully this issue can help other users in the same situation.
thanks for the explanation @johanschelin and the other option to use for solaredge . Just stumbled over the same problem after upgrading to the latest ha version.
Hi! Had same error message / problem with HACS Integration of Huawei Solar (via modbus).
Solution: Updated Huawei Solar to version V1.2.4 resolved the problem.
Thanks for your information!
I have the same problem. Modbus sensors created via yaml no longer work. Use HA 2023.3.1 Use the SBFSpot integration because everything works. had the suspicion at the beginning that the communication from the inverter had switched off, but it is on.
Please a new issue, with logs etc. This issue is solved. Make sure you test without custom components.
Actually if you have the same issue, then the solution is the same, just follow it.
I turned them all off and didn't do anything. I have a 2nd system to test on, it runs the same and it works. Use SBFSpot lan, SMA Speedwire Integration and SMA Energy Meter and the modbus yaml on it without problems.
I turned them all off and didn't do anything. I have a 2nd system to test on, it runs the same and it works. Use SBFSpot lan, SMA Speedwire Integration and SMA Energy Meter and the modbus yaml on it without problems.
Please do as requested - open a new issue with logs. This issue is closed.
The problem
Modbus stops working and HA cannot restart.
Removing modbus from configuration.yaml makes restart working.
What version of Home Assistant Core has the issue?
2023.2.0b4
What was the last working version of Home Assistant Core?
2023.1.x
What type of installation are you running?
Home Assistant OS
Integration causing the issue
modbus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/modbus/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response