Home assistant companion app

I have a Samsung tablet that I have in the pantry.
I use a command to turn the screen on when the motion detector detects motion

It works as it should. The issue I have is that the HA app keeps closing. I pin the app and have the dashboard set but every now and then I go in the pantry and the screen comes on but it’s the Samsung home screen.

I didn’t have this issue until I moved houses

Any ideas?

Thanks!

I am surprised you did not have this happen in the past. It is the nature of the beast with Android. The OS closes apps as it feels it needs to based on memory usage.

I have three tablets running and it happens on all of them.

I found that most of the time when it happens the state of the app_importance sensor goes from foreground to foreground_service.

So, I use an automation based on that to send command_webview that opens HA again. I also do this on a reboot of the tablets so I don’t have to wait around until it finishes booting and start HA.

alias: Auto Start HA
description: ""
triggers:
  - trigger: state
    entity_id:
      - sensor.living_room_tablet_last_reboot
      - sensor.office_tablet_last_reboot
      - sensor.garage_tablet_last_reboot
  - trigger: state
    entity_id:
      - sensor.living_room_tablet_app_importance
      - sensor.garage_tablet_app_importance
      - sensor.office_tablet_app_importance
    to: foreground_service
conditions: []
actions:
  - data:
      message: command_webview
    action: >-
      notify.{{ trigger.entity_id | replace('sensor.', 'mobile_app_') |
      replace('_last_reboot', '') | replace('_app_importance', '') }}
mode: queued

awesome!

thanks ledge. i will give it a whirl

If you turn the screen brightness down to 1 instead of turning it off, then it may not close the app. I see this behavior on two always-on displays I have, but they are old Samsung tablets.

hey mate.

I’m not sure how to get this to work for my set up.

this is whati currently have in place

alias: screen on pantry motion
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.hue_motion_sensor_4_motion
    to: "on"
conditions: []
actions:
  - device_id: 7ac3251d9dd3d54f318f53a9416a2c45
    domain: mobile_app
    type: notify
    message: command_screen_on
mode: single