Simple (and free): Turn an android tablet/phone on/off based on camera motion detection

I haven’t seen a complete example of this anywhere and didn’t want to pay for Fully Kiosk Browser app. This guide should take you like 10 minutes. So here it is:

HA configuration:

  1. Install Home Assistant companion app on your android device (e.g. I used an old tablet)
  2. in android, go to the app info settings and allow all permissions such as “Enable system configuration”
  3. integrate it with your HA server, an action such as notify.mobile_app_lenovo_tb_x606f should become available
  4. go to developer tools/actions e.g. http://homeassistant.local:8123/developer-tools/action and try sending some command such as this simple one:
action: notify.mobile_app_lenovo_tb_x606f
data:
  message: command_screen_on
  data: {}
  1. it should turn on the screen on your screen switch off tablet

Using the device camera for motion detection

  1. on your tablet, download https://play.google.com/store/apps/details?id=com.pas.webcam (you don’t need PRO version)
  2. in the settings, enable Data logging and motion detection, click on Start server
  3. note the IP Address at the camera screeen at the very bottom
  4. go to home assistant and enable this integration Android IP Webcam - Home Assistant where you put your IP Address (password and username if you set that in the app earlier, but not needed, same with port)
  5. it should add new sensors to your homeassistant, most importantly e.g. binary_sensor.192_168_0_167_motion_active that says if a motion has been detected or not

Putting it together:

Simple automation:

alias: Turn on tablet screen when motion detected
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.192_168_0_167_motion_active
    to: "on"
conditions: []
actions:
  - action: notify.mobile_app_lenovo_tb_x606f
    data:
      message: command_screen_on
  - action: notify.mobile_app_lenovo_tb_x606f
    data:
      message: command_webview
  - action: notify.mobile_app_lenovo_tb_x606f
    data:
      message: command_screen_off_timeout
      data:
        command: 30000
mode: single

This will turn on the screen if off, navigate to the webview lovelace, and turn off the screen after 30 secons. You can of course infinitely customize this.

You can let the screen go off, the IP Camera will still work (and the sensor). I have reduce the streaming quality and FPS to reduce the load, as it is not needed for my usecase, I just need simple motion detection so my hope is the lower the CPU resources/battery drain.

I also used the free Fully Kiosk Browser and HACS GitHub - NemesisRE/kiosk-mode: 🙈 Hides the Home Assistant header and/or sidebar to setup my specific dashboard so when accessed with the former on e.g. http://myhas/lovelace/dashboard-with-kiosk?kiosk shows up when woke up. I also removed the overlay “IP Webcam is running in background” so when the Browser is open, there is nothing about the camera recording.

Note that when tweaking stuff via accessing the settings of IP webcam, e.g. at http://192.168.0.167:8080/ , the motion detection won’t work, you have to close that.

On my own Lenovo tablet, the whole screen-on reaction takes about 2-5 seconds, which is not great :snail:

How did you remove the overlay “IP Webcam is running in background” with the free version of IP.webcam? There is no setting for it.

Also how would the automation actions be when using the HA companion android app?

Just for all the people coming here and looking for a solution:

There’s no way to do disable that overlay and be compliant with Google Play TOS any more. This was only possible with ancient versions of IP camera.

If you really need it, there is a workaround: Start the IP Webcam service, and once it is running, remove the overlay permission via android Settings → Apps. It’ll work as long as you don’t restart the IP Webcam service. You cannot restart it with that setting and have to allow overlay permissions to be able to restart it. But you can again remove the overlay permission once restarted.

If you have root – you can edit IPWebcam.xml inside /data/data/com.pas.webcam.(pro)/shared_prefs/IPWebcam.xml , add near the other values, restart your phone and never open Optional Permissions (as it’ll reset this value).

Alternatively, also with root, you can use developer tools to inspect/hide the window that IP Webcam creates.

And if you don’t have root, and don’t want to twiddle with settings, you can minimize window’s visibility by configuring your global Android settings to use the minimal font size.

That is how it stands in July 2025.

I would honestly just pay the one-time fully kiosk licence and avoid having to deal with the issue. It’s only €7.90 per device - I’ve seen coffees which are more expensive.

Thanks @echtarg for the update. I wrote this 6 months ago, so I don’t think that app was that ancient :person_shrugging: .

And yeah, I agree with you @ShadowFist that for me, doing the stuff above woudl be annoying enough that I would just pay for kiosk, but I fully respect some other people don’t want to for whatever reasons. Btw. I also think that such as basic capability should be possible for free and easy, especially if you don’t want kiosk for anything else than just the usecase of motion detection. Honestly, I think this could be a HA companion app feature…

@ShadowFist The full version does not help with that.

The full version has also to apply to Google Play TOS.

I myself use the full version, because I know the developer has/had a lot of work with it and I do not want to use the code without payment.

I was talking about fully kiosk, not IP webcam. Are you saying that fully kiosk has an overlay, even in the plus version?

Yes. The overlay “Camera running in the background” can no longer be disabled, no matter if free or paid version of IP webcam and what app (browser, kiosk, HA companion, etc) you run in the foreground.

I just tried today on a free version - there is no overlay in Kiosk https://play.google.com/store/apps/details?id=de.ozerov.fully&referrer=utm_source%3D/fully-home-en%26utm_content%3Dtext-link