hass-browser_mod icon indicating copy to clipboard operation
hass-browser_mod copied to clipboard

Entities become "unavailable" after 5 minutes

Open ihaettypo opened this issue 2 years ago • 52 comments

My Home Assistant version: 2022.9.6

This is almost the exactly same problem as metioned here: #145.

For me, they become unavailable right after browser visibility sensor being "hidden" for exact 5 min. I use the Fully-Kiosk browser and has disabled system sleep. And yes I have disabled the "Automatically close connection" in HA. And yes I've checked the router, the device is still connected to wifi.

The motion detection for Fully-Kiosk browser does work. The screen will wake up, just that the HA page would then say "disconnected xxxx" and will reconnect.

ihaettypo avatar Sep 24 '22 08:09 ihaettypo

I have the same problem, and to get it working again I need to close the app and open it again.

andregoncalvespires avatar Oct 07 '22 21:10 andregoncalvespires

Having the same issue on 2022.10.1.

T3chArmy avatar Oct 09 '22 21:10 T3chArmy

From #145 add this code below in Inject JavaScript under Advanced Web Settings:

Second attempt:

var audio = new Audio('https://raw.githubusercontent.com/anars/blank-audio/master/45-seconds-of-silence.mp3');
audio.loop = true;
audio.play();

image

Going on 30 minutes and it is still reachable!

Note: second attempt was just to test if looping works as well, this allows us to have no time limit AND use a smaller mp3 file. I suspect that length of the mp3 file is a tradeoff between CPU usage and file size, but it is probably negligible as long as we're not looping 0.1 second mp3 files...

After spending all day trying to find a solution for this, this code mentioned above works perfectly to solve the issue!

One important note that I was fighting with all afternoon that I didn't realize I had on, make sure "Consider Device in Use while Audio Playing" is not turned on in Other Settings. It's working great now!

T3chArmy avatar Oct 10 '22 03:10 T3chArmy

The problem with this is that anything playing in the media player will stop.

jrbecart avatar Oct 10 '22 15:10 jrbecart

Got the same issue here. After 5 minutes everything becomes unavailable and my popups aren't generating anymore. Before in Browser Mod 1, the popups where generated even when the screen was off for longer time. Benefit here, was that if I walked by the tablet after say 30 minutes. The popup still shows (for example last ringer / trashcan pickups). I've set the Fully Kiosk Stay awake as well, no luck.

KentuckyMC avatar Oct 23 '22 14:10 KentuckyMC

Confirming the same issue

stefanschaedeli avatar Oct 26 '22 15:10 stefanschaedeli

Have a same problem !

ppurice avatar Oct 27 '22 08:10 ppurice

Same issue. Also using Fully Kiosk.

funzie19 avatar Nov 12 '22 01:11 funzie19

FWIW: Changing this setting and restarting the browser seems to have fixed my issue (not FK, using HADesktop): image

shbatm avatar Nov 13 '22 12:11 shbatm

Got that one turned off already. no luck. image

KentuckyMC avatar Nov 14 '22 07:11 KentuckyMC

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 15 '23 22:01 stale[bot]

Has anybody been successful with Fully Kiosk and this?

funzie19 avatar Jan 15 '23 22:01 funzie19

Nope, still same issue. Before I could trigger a popup even when the screen of the tablet was off. So when I wasn't home, I could send a popup for example when I received a postmail. So when I came in, and walked by, the tablet showed me the popup. Not sure why this isn't working anymore.

KentuckyMC avatar Jan 16 '23 07:01 KentuckyMC

same issue with my Asus TF700 showing unavailable. I have to restart Home Assistant Companion App for it to work again.

markmghali avatar Jan 18 '23 18:01 markmghali

I thought I had the solution yesterday. But unfortunately not working. I set the always on when powered in the developer tools on my Android device. It seems that the timeout worked for more minutes. After some triggering of the screen on/off, suddenly after 5 minutes the browser mod became unavailable again.

The weird part is, that my Fully Kiosk itself (with the official integration in HA) isn't losing any connection. That one always stayed on and there I trigger my screen on/off (not in Browser mod). Browser mod isn't really putting the screen off, but just black background, when I use that, it works as expected and the browser mod stays active. But I want to really put my screen off instead of black. It's weird, because of browser mod 1 worked fine with this method.

KentuckyMC avatar Feb 02 '23 09:02 KentuckyMC

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 07 '23 06:04 stale[bot]

Still happening, not stale.

miguelangel-nubla avatar Apr 07 '23 08:04 miguelangel-nubla

Same problem also here

Bibouche avatar May 03 '23 13:05 Bibouche

Same here, all entities are getting unavailable after a while despite setting the connection to persistent. On the other side, popus still work fine

Matz88 avatar Jul 12 '23 07:07 Matz88

Same here, all entities are getting unavailable after a while despite setting the connection to persistent. On the other side, popus still work fine

Also popups when your screen is off and the entities are unavailable? I can't put a popup on the screen then.

KentuckyMC avatar Jul 12 '23 07:07 KentuckyMC

no pupos at screen off, they appear then when I manually switch on the screen But if teh screen is kept on, then the popus are not an issue

Matz88 avatar Jul 12 '23 07:07 Matz88

Saw lately some updates on other posts. Hopefully this one will get some love as well. I believe it´s an easy one to reproduce. Get a combination working with Fully Kiosk Browser. Set the screen off with the toggle in Fully Kiosk Browser and wait for 5 minutes. All entities become unavailable till you toggle it back on. Same behaviour on just setting the tablet itself (Lenovo Tab M10 here) on/off.

KentuckyMC avatar Jul 18 '23 17:07 KentuckyMC

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 16 '23 21:09 stale[bot]

Got the workaround up with the on/off from the tablet.

So before I trigger the popup (when all entities are unavailable). I first use the fully kiosk browser switch to toggle on the screen. Then delay 2 seconds, put the popup up, and 2 seconds after dim the screen again.

KentuckyMC avatar Sep 22 '23 16:09 KentuckyMC

Got the workaround up with the on/off from the tablet.

So before I trigger the popup (when all entities are unavailable). I first use the fully kiosk browser switch to toggle on the screen. Then delay 2 seconds, put the popup up, and 2 seconds after dim the screen again.

I have the same issue. After some time the BrowserMod devices become unavailable. I used to use the kiosk browser device to toggle the screen, but it is not as fast as BrowserMod. If only BrowserMod worked..

iamnikv avatar Sep 27 '23 19:09 iamnikv

The weird thing is just that this worked all fine with the V1 from browser mod. So really don't know what is changed on this functionality.

KentuckyMC avatar Oct 01 '23 12:10 KentuckyMC

I was struggling with a similar issue where Browser Mod would become unavailable randomly on my Fire 10 wall tablets. What I found worked is not using the HA app but actually using a browser to access HA. Browser Mod still goes offline when the screen turns off but comes back up once it's woken up, waking the screen can be handled by Fully Kiosk.

PablaV avatar Nov 08 '23 07:11 PablaV

I'm struggling to identify what is causing this on my Windows 10 Surface Pro 5 device, using Edge browser in full screen mode. It takes longer than 5 minutes to appear offline - it can go for several hours or so, before appearing offline. Set all the power saving settings to off in windows, no sleep, no screensaver, leaving the browser fully visible and the tablet on overnight, yet the browser mod entities all show as unavailable the next day. Using HASS.Agent in windows to send the surface stats like battery level to HA, and those stats remain available throughout, being sent via MQTT.

Does anyone know if the solution mentioned above: https://github.com/thomasloven/hass-browser_mod/issues/452#issuecomment-1272747517 is still an option? Where would this be added?

Scoff123 avatar Nov 21 '23 13:11 Scoff123

Have you tried another browser?

PablaV avatar Nov 21 '23 15:11 PablaV

I've tried both chrome and Firefox, however there are separate issues with both of those browsers in terms of my dashboard display - probably my older MS surface graphics drivers. Edge is the one browser that displays everything properly on my surface which is why I've stuck with it.

Scoff123 avatar Nov 21 '23 19:11 Scoff123