Wake screen on mobile app based on Home Assistant Automation

@Zwaantje This one goes in your switch: part in your configuration.yaml (or in the according file if you have a split configuration like this for example in the configuration.yaml: switch: !include domains/switch.yaml)
You have to adept the binary_sensor to yours and the notify service of course.
The binary sensor is created automatically from your companion app (android, don’t know if the ios has the same features) when you enable the interactive sensor in the energy sensors.
Sorry, activation the sensor was missing in my post above.
But that should be all and the switch could turn on the display and it turns off when screen goes off.

Thanks/Dankje Mike,

I will make an attempt later on. And see if i can get it to work.
I will update if it worked!

I have found the switch and i am going to do some tests.

The command_screen_on i already used but in a different way.
I had the automation that when a certain motion sensor was triggered, home assistant would send a notification to my tablet with the command_screen_on as a message, and this works about half the time but allot of times i think the tablet is in deep sleep and it wont work.

Does the way you do it always work, even if it hasnt been used in a while? so that it will be in deep sleep?

Thanks for the help

No, it works near almost as my device doesn’t get into deep sleep. Independant from what you use for your automation, deep sleep is always a show stopper and there is no command to wake it up in that moment.
Maybe this site helps, it’s a little bit old but gives you hints where to look to disable the deep sleep modes for home assistant:

So it seems like something in my deep sleep messed things up,
i have fiddled a bit in my settings. and now its working.
Changed so many things that i cant tell you exactly what the winning setting was.
Just for the people searching for this, i will make this post:

If you want to have you tablet wake on motion detection, i will make a short guide:

1, make an automation with the following setup
Trigger, if motion is detected by (whatever motion detector you have)

Action, service, send notification to your tablet with the following command as a message: command_screen_on

Then go in to the settings of your tablet and make sure the battery saving options are off. i cant tell you exactly wich one it was, but as madface ( mike ) said, follow the dont kill my app site and try some things. With my android 13 tablet (samsung s8) it was totally different as the site, but still it will be the direction you have to look in, hope this helps. Good luck!

5 Likes

Key things that did the trick for me:

Turning on the screen

  • The wake up order
action: notify.my-device
data:
  message: "command_screen_on"
  • The HomeAssistant application on the device needs to be excluded from the “Battery optimized” ones

Opening a dashboard

  • The launch order
action: notify.my-device
data:
  message: "command_webview"
  data:
    command: /lovelace/doorbell # <- Dashboard path
  • Give the “Foreground running” permission to the app

Works on my very old Samsung SM-T580 with Android 8 !
Thanks @spudje, @madface & @Zwaantje