-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
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
Config entry has already been setup for Shelly devices after 2024.5.1 with Gen1 devices #116975
Comments
Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) shelly documentation |
Thanks @coserotondo. We have seen this error but couldn't find why it happen. Maybe with additional info from you we can identify the root cause better. Does it happen only on Gen1 devices? Can you reproduce it with debug logging enabled for Shelly integration? logger:
default: info
logs:
aioshelly: debug
homeassistant.components.shelly: debug Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub. Thanks. |
It happened 2 times only after HA update and consequent HA restart (first 2024.5.1 and then 2024.5.2). Not always the same Shelly devices but all Gen1. I've automations attached to some of them. I put the debug options and tried to manual restart HA. Logs attached but I had no issue this time. Now I stopped the debug (I've 51 Shellyes...). What I can do is to enable the debug option before the next update to observe what happens after the restart. Any other suggestions? Maybe the logs contains useful info? Thanks. |
I have the same problem (only Gen1 devices) but want to note that immediately after the HA restart (when it says "Home Assistant has Started!") all the Shelly devices are found and random testing shows that they appear to work as expected when operated. Within 60 seconds however they are all lost again - so it is not the case that they never get found after a restart.....they are found and then lost, and then found again after reloading the integrations. In the meantime is there an easy/automated way to cause the Shelly devices to reload? Doing them one at a time is rather painful, especially from mobile. |
@ChirpyTurnip please follow #116975 (comment) and provide log. Thanks 👍 |
hi all, exactly the same here. I have had no issues with HA Core 2024.4 and this comes with 2024.5.x... I have 24 Shelly devices. Here is the same log entry one of them:
The name of the shelly device here is: Versions I have (supervisors updated couple of minutes ago): Based on the log entry, it seems the issue relates for |
@zollak please follow #116975 (comment) and provide log. Thanks 👍 |
Please no need to comment that you have it also, it just spams the issue. Follow #116975 (comment) and provide logs. Thanks 👍 |
I did the debugging. I don't want to attach here my log, it contains too much sensitive info. I'm trying to filter it somehow... |
This comment was marked as duplicate.
This comment was marked as duplicate.
For me the reproduction of the issue is fast and reliable --> Restart, count to 100, instant chaos! :-) Here are my logs from running to restart to config reloads..... |
A handful of the shelly code owners have reviewed the code and can't find a path to allow this to happen under normal circumstances. Some of us have spent a few hours staring at the code, looking for a problem. At this point, it might be something corrupting the internal asyncio state. Can you try running in safe mode to see if you can still reproduce the problem? Additionally, if it is an unsafe thread operation corrupting the asyncio state, https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441 can help you uncover it. Follow the steps in |
That doesn't sound super ideal - it would be better if it was an easy fix. :-) The problem does not appear to occur in safe mode....but then in safe mode many things are broken. In normal mode I noted that not all the Shellies were impacted - some (a very small number) continued to operate. I have attached what is hopefully the information are after: I hope this helps! |
Your callgrind files are impressive assuming they are 60s long. You have on of the busiest systems I have ever seen. Normal Mode
Safe Mode
|
It might be that whichever integration is causing the issue is only doing the non-thread-safe operations at startup. You might have to go the |
I can't claim a record...they are 600s long.....I wanted to make sure I captured the process of the Shelly devices coming on line, dropping off, and reloading... :-) I will have a look at debugpy to see what it gives me.....just need to wrap up work so it will take me a couple of hours to get back to it.... |
OK....so this is all a little bit weird. It actually behaves better with the debugpy: entry in the configuration.yaml....like basically no issue. At one point one device dropped off (and came back by itself a few seconds later without intervention):
Over several restart tests I still lost the occasional device (2 -3) and these needed to be reloaded, but not what I had previously where almost all of them had tapped out. However, I'm not actually 100% sure I'm doing it right as I'm not getting extra log files or anything. There was a weird console 'thing' that showed on the screen but it didn't linger. I have also (briefly set) this in the config before restarting:
That caused significantly more logging that just having the recommended entry in the config:
This gave me this log dump, but ironically this also caused all the Shelly devices to fall off again: There is a pattern there.....but what it is a mystery! Regardless, how do I actually use debugpy:? Adding it by itself doesn't seem to do much.... |
Once debugpy is enable, it will turn on asyncio debug mode at startup https://docs.python.org/3/library/asyncio-dev.html which will log any unsafe operations and event loop blocks that it can detect. We need the log for when that is enabled. You'll see a lot of |
Needless to say the problem persists (not expecting it to be any different as nothing has changed). But a semi-off topic question from us sufferers..... Is there any way to automate the reload of all the Shelly integrations? Hitting them one at a time is a major drag.....I'm actively configuring things so HA is being restarted 10 - 20 times a day to load new configs....you can do the math on the number of clicks needed to restart 38 shellies manually every time....I'll need a new mouse by the end of this.... :-( Thanks! |
I am running a change that will be released on the next major release (2025.6.0) and it looks good for few days. |
I'm happy to wait....June is not too far away and the last thing I need is to completely break everything....it would take me longer to fix it than to wait :-) |
June 24 or 25 ??? |
24 😸 |
Since the update which added the debugg logging I didn‘t run into this issue again. May something else in this update fixed that issue? |
@ChirpyTurnip I made a Auto Entities card to streamline the reloading of unavailable devices:
|
2024.5.5 has a stripped down version of the changes coming in 2024.6.x. There is a chance it might improve the situation while we are waiting for 2024.6.x to ship. |
Hi @ChirpyTurnip @zollak @met67 can you update to 2024.5.5 and verify if it still happen? it would be good to know before next release. Thanks 👍 |
So far all good !
Il giorno sab 25 mag 2024 alle 22:34 Shay Levy ***@***.***>
ha scritto:
… Hi @ChirpyTurnip <https://github.com/ChirpyTurnip> @zollak
<https://github.com/zollak> @met67 <https://github.com/met67> can you
update to 2024.5.5 and verify if it still happen? it would be good to know
before next release.
Thanks 👍
—
Reply to this email directly, view it on GitHub
<#116975 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5CAQBAJ2KBOINZKUGO4U6TZEDYTRAVCNFSM6AAAAABHKOEDVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZRGQZTANZQGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@thecode For me it still happens. Today morning a USB powered Shelly H&T is unavailable. |
After a couple of restart, everything’s fine… |
Hi! Sorry for the delay in responding I've not be around much this weekend. I can however (happily) confirm that after about 6 restarts and a couple of full reboots the Shelly devices all come back online and stay online!! Yay!! @vistalba - I have some H&T units too.....I need to leave it for a bit to see if they phone home as expected. If they do not I will post an update, if you hear nothing than all is well on my end. Special thanks to @met67 - it's a tidy solution! I have a few other things that sometimes need a kick so I will be keeping your snippet as it works perfectly! :-) :-) |
Slightly updated the above snipped to also include Sensors (H&T, D&W) which also are affected:
|
Hi, I have updated today my HA to 2024.5.5 and also came updates for Shelly devices v1.3.2 (the previous was v1.3.1). I also updated all my Shelly devices and HA as well. I made system reboot as well and after a couple of restart, everything’s fine… |
I am closing this issue for now, if anyone still experiencing Thanks everyone for helping with logs |
❗ Please do not post "me too" or "I have the same issue comments" as it clutters this issue and notifies everyone who is subscribed to it, which will drive people away who could have helped solve the problem. Instead, give this issue a thumbs up, and post logs requested in #116975 (comment)
The problem
Starting with 2024.5.1 at any HA restart I've
[homeassistant.config_entries] Error
and the entities are related to Shelly Integration. After HA restart, the affected entities are unavailable and I have to manually reload the integration to make them available again.Attached the diagnostics of one Shelly affected devices:
Letto Monte Camera Rosa
.What version of Home Assistant Core has the issue?
core-2024.5.2
What was the last working version of Home Assistant Core?
core-2024.4.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
config_entry-shelly-696dfd20befd67dcebd37c4a7aea8378.json
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: