A connection can go stale in Chrome without any event handler being called. This happens when a device goes into standby. For computers this is rare but for phones this occurs quite often. This has been solved by sending a regular ping from the server. The frontend will assume the connection has gone stale when it hasn’t heard any communication for a while. Sending a ping will also help the server detect broken connections and clean them up.
I feel this issue still exists, when I power up HA via chrome on an android tablet. Has anyone ran into issue where they load HA on a tablet after it goes on standby, it doesn’t properly reflect the changes in state without a hard refresh?
They’re actually saying that they do this. Meaning HA’s server portion does this. I don’t know if you can tune that ping manually, but I don’t have this problem unless I have HA set up as a web app and move it to the background. It usually manifests itself as my cameras gone missing.
But I think I have so much stuff that is streaming states and video to UI, my connection doesn’t really get a chance to go stale that often.
If you want a bit of fun some time, read some of the comments in the code… after talking in the cited post about not polling and instead streaming, @balloob links to the code section about it and in it I found this gem:
while True: try: # Somehow our queue.get sometimes takes too long to # be notified of arrival of data. Probably # because of our spawning on hub in other thread # hack. Because current goal is to get this out, # We just timeout every second because it will # return right away if qsize() > 0. # So yes, we're basically polling :( payload = to_write.get(timeout=1)
If anyone runs into this problem again and know how to use the Chrome device debugger for Android, please check the console to see if there are any error messages printed to the console
maybe this is obsolete already, but on my Hassio installation I don’t get the Streaming Updates in the left side bar. Do i need to enable anything in the configuration files for that to appear?