Android app on tablet doesn't automatically reconnect after router restart

I have a wall mounted Fire HD 10, using WallPanel to show a Home Assistant dashboard. I also have the Home Assistant Android app running in the background in order to utilize its various sensors it provides.

To handle power management, I have a Sonoff USB Smart Adaptor along with a Node-Red automation to turn on the charger at 30% and turn it off at 80%. Maybe one day I’ll open up the tablet and disconnect the battery from the charging circuit so that it’s safe to always have the power connected, but for now the cycling is fine.

What I’ve noticed is that if I restart my wifi router, the Home Assistant app on the tablet never seems to reconnect, so Home Assistant stops receiving the sensor data, so the charger doesn’t get turned on when it hits 30% and it ends up running out of battery after a while. I don’t physically notice it on the tablet because WallPanel is still working fine.

I haven’t actually been able to catch it in this state, because every time I notice it it’s because the tablet ran out of power and turned off.

I can switch to using WallPanel’s battery sensor instead of Home Assistant’s, but it’s an issue for the other sensors too, not all of which are available in WallPanel.

The tablet is accessing Home Assistant directly via IP (e.g. http://192.168.0.40:8123/) and this IP is configured statically on the DHCP server, so it’s not a DNS issue or anything like that.

Any ideas how to fix this?

Thanks!

I had a similar problem on my Fire 7 using Fully Kiosk. Occasionally the app could crash which would cause the battery sensor to go into an unavailable state and the tablet to die. How I ended up correcting this was with the use of Join and Tasker.
So when the battery sensor would go into the unavailable state, Join sends a message to my tablet, something simple like “fully.” I then have a tasker event when it receives the “fully” message, it launches the Fully Kiosk Browser. This setup fixed my issue. Oh, I think I also used AutoInput which is a plugin for Tasker.

My node red automation. Switch has three options, 10%, unavailable, 100%.
image

Edit: Oh I also remembered the first way I fixed this before finding out about Join. When the battery sensor would go into unavailable I would have it turn the switch on. That way at least the tablet wouldn’t die. I was still left with the problem of having to manually re-launch Fully Kiosk…which is how I eventually figured out about Join.