-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Lose connection to HA after PC Sleep #71
Comments
Hmm, my pc enters sleep mode often, and i am not facing that problem. After it woke up, all icons once flash the eclamation icon and then return to normal operation :/ Edit: I have debugging enabled for stream deck app - maybe this changes the plugins behaviour... I will check. |
I will try a re-install, as well as using the external URL instead of the local IP. |
I have reinstalled, checked that the plugin files are where they should be (in appdata) and used both the external URL and internal IP. I was able to get it to respond a few times, however, most of the time, a restart of the Stream Deck app is required to get the Home Assitant buttons working again. I believe the issue may be with Windows 10 power management and adapter configurations. Perhaps the connection to Home Assistant is not being done upon return from sleep at the right time. I have disabled Energy Efficient Ethernet, as well as Wait for Link, but am still having the same problem. I will continue testing other settings/options. |
I have played around with Windows 10 settings for Sleep and WOL. As of now, the issue persists. My PC is set to sleep after 60 minutes, hibernate never. On initial boot, everything works fine. The application loads, plugin loads, and all Home Assistant icons briefly show a green checkmark while starting up. Pressing the buttons works as they are supposed to. The Server Settings show that the Home Assistant URL (internal IP) and Long Access Token are valid (green check marks). Once the PC goes to sleep (either on its own over time, or using Start -> Power -> Sleep), the plugin does not seem to reconnect to Home Assistant on wake. Pressing the buttons does nothing, and toggles/status are not updated. |
I'm experiencing the exact same problem. I'm on Windows 11 and everytime my PC comes back from sleep, pressing any of my Home Assistant shortcut shows an exclamation mark. Restarting the Stream Deck application makes it fine again. I'm using a Stream Deck mini plugged in a USB 2.0 port (if that can make any difference). |
I am also experiencing this problem. Same as described above, after my PC goes to sleep the home assistant buttons no longer work until I restart the stream deck app. Not sure if anyone has figured out a fix for this. |
Same on Windows 11. I have a similar issue with the BarRaider World time plugin too, so I think it may be something happening on the Stream Deck side. |
I am using Windows 11, newest StreamDeck and HomeAssistant plugin an still can not reproduce the problem (neither with hibernate nor with standby)... |
I think @glnces is right, it looks on Stream Deck side. I have the weather widget and the issue appears for it too, at the same time (same thing for a date widget too). It looks like the stream deck lose connection with third party plugins after some time. But the media keys and folder navigation continues to work. Strange. And very annoying. |
I think it has to do with the webhooks losing connection on sleep. The connection can be re-established by exiting the stream deck app and opening it again, or rebooting/restarting your home assistant. I have disabled all network power saving features and enabled Wake on LAN, so my network card should not be shutting down on sleep. The only other difference I have in my setup, is that I've enabled auto-login on my Windows 10 OS (no password required on startup or wake). Maybe this skips the part of the webhooks reconnecting? If it cannot be replicated or fixed, is there a way to make an stream deck action/icon to reconnect to home assistant? That would be a short term solution... |
I think you're exactly right about the webhooks not re-initializing if you have it set to not require a password after sleep. I just changed my windows settings back to require a password after sleep and the Stream Deck worked as expected. |
Great finding! Maybe I could add a 2 second-delay before i reestablish the websocket connection (or find out, why the plugin does not automatically retry to establish the connection as intended). |
Wow! Thank you so much for this! Like I said before, I not only had problems with HA plugin, but also a date widget and the weather one. All of them work perfectly now. I would have prefered to leave auto-login on, but it's a minor issue compared to having to kill and relauch the Stream Deck app all the time. |
Have you been able to implement the delay, or find out why it was not reconnecting? |
my PC never goes to sleep or back to the login screen, but after ~5 hours i also experience this issue. every other plugin i use responds properly. |
I have this same issue, but using:
Seemingly overnight (without the laptop going to sleep) connection is lost and won't re-establish without a restart of the Stream Deck app - restarting Home Assistant does not solve it. During this time the entities and actions are still populated, though I presume they're cached or something. Exiting and reopening the Stream Deck app reconnects and functions operate as before. |
Figured I'd jump on this train and say I am having the same issues described above. Win 11 (was also an issue in windows 10), without password required for login or wake from sleep. After hibernation, I have to manually go in and close and re-open the stream deck companion software to re-gain my home assistant connection. |
@cgiesche fixed the memory leak and i can confirm my stream decks no longer go unresponsive after a certain amount of time. i personally have not seen this issue in ~2 months. there's also another part to the issue though, because elgato has a known bug where you have to re-plug the USB. i will start to experience delayed commands, especially switching between pages on my XL. takes 3-5 seconds for the page to change when it's typically instant. when you replug the USB (don't even need to restart the app) it goes away and everything is snappy again. it sounds like this thread might me a mixture of these issues. |
I found a work around for now, with task scheduler on wake and taskkill. For some reason, there are multiple processes, but it doesn't seem to matter if you kill it too many times.
|
As many things have changed on both sides (plugin and streamdeck app): Does the issue (Lost connection after PC sleep) still occur? |
@cgiesche I just disabled my scheduled task and it still does not connect on wake from hibernation (I did try the buttons, they show the yellow warning triangle). Restarting the client still corrects the issue. |
Yes, the problem has persisted, even after all the latest changes. My computer is set to auto-login on boot and I believe that this is what is affecting the plugin. There is a service or refresh that is not occurring because I do not have to login after the PC sleeps. I am not familiar enough with Windows or what is occurring to troubleshoot it any further... To resolve the issue, I have to quit the Streamdeck application and re-launch it after waking the PC each time. |
Any update on this? I'm still having to relaunch the Streamdeck app every time the PC wakes up (with an auto-login on boot). |
Ihm having the exact same issue on
Doesn't respond after waking up from sleep. |
Having the same issue as well on MacOS Sonoma 14.0 |
Same here, whenever the mac sleeps for a considerably amount of time it requires me to open stream deck and tap reconnect inside the HA tile |
Same here, even with the updated Plugin
|
I am looking into this issue. |
https://github.com/cgiesche/streamdeck-homeassistant/releases/tag/2.4.1 (Coming soon(tm) to elgato store, download and install manually to get features now) |
Installed, I will keep an eye to see if it fixes the issue |
Having a simular issue to those discribed above. After leaving my PC for some time. No sleep and no hibernate, not even locking the screen. The HA plugin goes unresponsive, but still shows static data and no explenation marks. I need to restart the deck app to get it working again. I set up the HA connection external with SSL/WSS and Cloudflare tunnel. I just changed it to internal connection to try if the problem percists. Will keep you updated. |
@BlomRuben
|
I have the same problem with Windows 11. But I'm glad to have just found out about version 2.4.1. |
@cgiesche the new release solved it for me. Thank you! |
Fixed in latest release. |
Sorry to re-open this issue but just encountered it for the first time today! Windows 11 Symptoms seem to be the same as above - after coming out of standby (I and don't have autologin enabled, I need to enter a PIN to unlock the PC) the Stream Deck starts up again and static content is shown (with switch status for a light correct), but then pressing any HA button just shows a yellow exclamation mark with nothing in the Stream Deck logs. I had thought it was something with my long-access token at first but replaced it with no change. I get green ticks against the server URL (internal IP) and token. I can browse entities OK. If I then exit the Stream Deck application and re-start it then it works fine again but when I put the PC to standby and wake it back up it stops working again. |
I have added entities to my Stream Deck using this plugin and everything functions as it should. The connection using a local network URL and Long-Lived Access Token works and I am able to add multiple, working entities on my Stream Deck.
After I leave my PC for several hours, it enters "Sleep" mode (or it can be put into sleep mode using power options). A button press on my keyboard or my Stream Deck is able to wake the PC up. However, pressing an entity button on the Stream Deck results in a yellow exclamation icon on the button and no action being performed. The other, native Stream Deck buttons/actions continue working fine.
In order to get this HA plugin working again, I need to close the Stream Deck companion application and re-open it. Then all works as it should.
No error messages in tmy HA logs.
Stream Deck: 5.1.4.14753
HA: 2021.12.8
The text was updated successfully, but these errors were encountered: