#Need to keep iPad companion app dashboard connection alive

1 messages · Page 1 of 1 (latest)

worldly agate
#

So, I have two iPad 7th gen's I am using for wall mounted dashboards. I have everything literally 99% perfect on how I want them to behave... except when the device's display is off for a prolonged period of time, the dashboard after waking up from a home assistant automation reports that it's lost the connection, reconnecting... and just stays there. It never refreshes the browser in the companion app.

I have browser_mod sending refresh triggers every hour, but do I need to do it more frequently to keep it alive? I also have the companion app specifically set to not kill background connections after 5 minutes. So it's weird that the automation I use to wake the displays up works, but the dashboard gets stuck on reconnecting.

worldly agate
#

I am testing this code to see if it helps

triggers:
  - minutes: /15
    trigger: time_pattern
conditions: []
actions:
  - data:
      deviceID: browser_mod_xxxxxxxx_xxxxxxxx
      code: location.reload(true)
    action: browser_mod.javascript
  - data:
      deviceID: browser_mod_yyyyyyyy_yyyyyyyy
      code: location.reload(true)
    action: browser_mod.javascript
mode: single
#

On manual trigger it refreshes the browser page, so I am hoping that since my motion detection automation still works to wake the displays up, this will resolve the "Connection Lost, Reconnecting..." issue.

worldly agate
#

Yeah so this didn't work unfortunately.

So, I can automate waking the displays by sending a silent push notification, but I cannot seem to keep the websocket alive once they've been idle for too long. I am not sure how to prevent this other than keep the displays on.

worldly agate
#

Unless someone else has any ideas, the only thing I can do is just keep the displays on forever.

peak spire
#
visual oar
#

If iOS is like Android then it is very difficult to get 100% (you can read my notes on Adroid on Browser Mod Wiki - https://github.com/thomasloven/hass-browser_mod/wiki/Android-Devices-'Always-On'). Looking at the Page Lifecycle API looks like Safari supports it. In the lifecycle there is a FROZEN state. Once the browser (direct or App hosted) puts a page in FROZEN state its pretty much end game so to say without something else external to browser/App on the device assisting in some way. You will see in my Android writeup that there are ways to send command messages from Home Assistant - similar may work for iOS. What I have found best is to do whatever you can to prevent a FROZEN state, which as you have found is keeping devices on. Browser Mod latest version has a Save screen state Frontend setting which helps to keep a dark screen using Browser Mod's screen (light) feature to turn off the screen. The very latest version (2.4.0) of Browser Mod also corrects an issue in that Broswer Mod devices may not reconnect on Home Assistant restart. Just a though - I wonder if backlights can be controlled - then a running iPad will be pretty much 'off' as far as screen if the screen is dark (Browser Mod screen off) and backlight is off.

GitHub

🔹 A Home Assistant integration to turn your browser into a controllable entity and media player - thomasloven/hass-browser_mod