I simply use a xiaomi motion Sensor and the Androids ADB-Shell to wakeup & Hybernate (Keyevent 224&223) via automations. With HA`s “platform: androidtv” and the coressponding “media_player” i can also call Input-Select “homeassistant” via ADB, so the App is always in foreground when the Screen comes up.
Hi,
yes there is a way, I had the same problem and there is an amazing app that help you in this integration: the name is Automagic.
You can find it here: https://automagic4android.com/download_en.html
What can you do with it ? You make the app listen to a web call and associate the call with the simple action of wake up the display, that’s it. I have a camera that sense the motion and when it fire the event an automation listen and call a shell script containing:
cat wakeup_tablet.sh (name of shell script)
#! /bin/bash
wget -q http://192.168.1.60:8080/automagic -O /dev/null
My next step will be to use the camera of the tablet to sense the motion so the wake up will happen in a more restricted area.
Hope it helps
M.
In the mean time the Android Hass companion app has a feature for this. Send a notification with “command_screen_on”.
However it seems this only works when the android device’s screen is off and the device is NOT sleeping. As soon as the Android device sleeps the command doesn’t work anymore. At least for me.
Any way to make this work when the device sleeps with the native companion app?
hello, any one had a complete job with wake screen on / off in actual ha version and android 10? all of tutorials are old. how tu instal adb server actualy? Integration AndroidTV want connect to tablet. Of coure programer mode is enable and debug usb enabled. I dont have options lik ADB over WiFI.
This is my automation, triggers on motion and then opens a HA tab/dashboard (‘motion’) in panel view with the picture glance card. After 20 sec. it relaunches to go back to the main dashboard
Using Fully Kiosk you can set to Turn Screen On on Power Connect and Sleep on Power Disconnect. Works in free version as well.
Then connect the tablet via a HA controlled relay switch which you trigger by a presence sensor.
You need it anyway to prevent battery swelling - program your switch further to maintain the charge at about 20-70%.
I installed the Home Assistant Android app from F-Droid so your value here might vary
Next you’ll need to get adb for Home Assistant. Bit weirdly this is available in the “Android TV” integration. I added my tablet as a “Fire TV” even it is not a one. Seems to work. Probably any device type works. Even a car
And now I was able to create a script / automation which wakes up the screen and open Home Assistant on the tablet:
Here’s the script:
Nice guide, thank you.
The requirement here is to have root access to the tablet and, in my case, I don’t have (old Nexus 10, original).
Anyway, after years now I can say that tablet management via the app Automagic is quite stable and efficient, I use even the tablet’s camera to identify when I am in front of it and wake up the display for the 30 seconds necessary.
Set the Display Timeout of Android to 10 seconds or something like that. In the companion app enable the ‘Keep Screen on’ setting. Enable the interactive sensor somewhere in the energy sensors. Replace my lovelace view with something that fits yours.
When you turn the template switch on it launches the companion app and the screen will remain on. If you turn the switch off, it launches novalauncher (you have to install it on your device and make it the default launcher). After a short time the display times out und the screen goes off.
If you know the intent to launch your favorite launcher you can use that instead.
I found this way here in the forum and the idea is really neat i think (and it works really good, no root and no other software ist needed).
Thanks for the explanation.
Im getting the hang of home assistant but not quite yet regarding templates and value templates.
Can you give me some more information regarding the value template binary sensor?
Do i need to create the binary sensor or how does this work.
The unique ID i have already made, and i have copy pasted your template and adjusted it to my own.
Will show you my template later on. Hope you can help me.