I am using a Samsung Family Hub to display my SharpTools dashboard (Home Assistant) which works great most of the time. The family hub has a built in browser which I am using to display the dashboard - I have no control over choice of browser or browser settings.
The device has a screen saver which kicks in after 5 mins - it cannot be turned off and 5 mins is the maximum.
The issue is when the device wakes up from the screensaver, the data on the dashboard is stale. Any state changes that happened while the screen was sleeping are not updated. I have to initiate a page refresh to get up to date states etc.
The problem does not occur if I use an HA lovelace dashboard.
I’ve tried adding a background picture with refresh enabled every minute, but that does not see to help.
Anybody have any suggestions ?
If you wait 5-10 seconds, do you see a message at the bottom about the Socket being disconnected or reconnecting?
If you wait 30-60 seconds, does it automatically reconnect and refresh the data?
No message at the bottom of the screen. I don’t think this pos browser ever shows messages like that
No matter how long I wait the screen remains almost unchanged from when the device went into screensaver, except the clock tile has updated to the current time.
Events that occur after wakeup are reported.
For example
- Screen is on, a contact sensor tile is showing closed.
- Device goes into screen saver
- I open the contact and leave it open while the device is in screensaver.
- I wake up the device.
- The tile still shows the contact as closed.
- I close and open the contact. Stale sensor tile gets updated.
OR
I reload the webpage. Screen gets updated.
I have found the same issue also occurs on my desktop PC running Windows 10 with Edge browser. If the PC goes into screensaver mode, and a state change occurs on a tile while the PC is in screensaver, when the PC wakes up the tile state is stale. I have to reload the webpage to get an updated tile state.
Also noticed this on a mac mini on safari. Whenever it comes back from sleep, I have to shutdown safari and reload the page. The tiles that are really stuck appear to be any supertiles/custom tiles.
Samsung Fridge + Edge
That’s an interesting clue - thanks for sharing.
It sounds like the connection is either maintained in the background or gets re-established quickly since you aren’t seeing the Disconnected / Reconnecting message at the bottom of the page and are seeing new value updates.
But it’s not clear why the data from while the screensaver was on wasn’t updated.
What about new events or state changes that occur after the PC wakes up from screensaver?
And are you able to consistently reproduce this on demand? Like are you able to force-start the screensaver and then immediately exit the screensaver and you can reproduce the issue? Per the next section on Mac, one of the challenges is we were not able to manually reproduce it. I would occasionally see it after my Macbook Air was asleep for a long time, but I couldn’t force it to occur by manually putting the Macbook to sleep.
Diagnostic Page (hidden)
I would also note that we have a hidden set of diagnostic information for the socket connection that you can access.
Safari on Mac
Certain versions of Safari on Mac seem to have issues with how they’ve implemented “Web Workers” which is the underlying technology that allows the realtime connection to run in the background.
In my experience, when this happens on Safari on Mac, it means the realtime connection is completely lost since Safari is having issues with the web worker – that means that all status updates going forward fail until you close and reopen the page in Safari.
Unfortunately I can no longer reproduce the issue on PC
I can consistently reproduce the issue on the fridge though. I cannot force the screensaver to kick in, but I can set the time before screensaver comes on to a minute.
I was able to capture the data from the diagnostic. See attached screenshot of the fridge screen. Note that the times 1:45:23 and 1:57:33 are the times when I ended the screensaver and screen woke up.
I don’t know if this will help.
That’s an interesting clue on the fridge. It doesn’t show any indicating of losing the connection or reconnecting. It’s almost like Samsung’s Browser is just completely freezing the browser (front-end) completely but allows the background connection to continue to run.
So while it’s in screensaver mode, the background worker may still be sending the events over to the front-end, but since the Browser has completely frozen things, those events never get received.
Normally, the browser would just slightly delay the timing on the frontend but not freeze it… or freeze both. That way when it unfroze the frontend, it would also unfreeze the background worker and that would cause it to reconnect which would get a fresh snapshot of all the device statuses.
–
Unfortunately, I don’t have a Samsung fridge to test with. I’m curious if there’s any indication at all that the front-end was frozen/unfrozen… if so, and if the background worker really remains running, we could just ask the background worker for a fresh snapshot of the data that it’s holding in memory.