Motion Sensor and Tasker to Turn on Tablet (No Internet Required)

EDIT: Previously I had put a * in the title next to "Internet Required" as there were some options that required the internet, and some options proposed that did not, including the use of a smart plug to toggle power to the tablet, as well as my current solution of a LAN based HTTP GET. I have since had some success with the local AutoRemote / Tasker option, however I still want to prove this is reliable. I decided to call it and say this solution does not require the Internet, and have changed the title to match this, but still need to document the final setup that delivers on this.

I've been meaning to tackle this for a while, and had seen similar posts and thought I'd give it a go...

Amongst other things, on the side of my Fridge I have an old tablet and and Hue Motion Sensor.

So I decided to setup some rules and other integrations so that the tablet would display my main dashboard when I walked up to the fridge.

The first thing I did was install Tasker and Auto Remote on the tablet. I should capture a few more details than this, but for now let's say I

  • Installed both Tasker and AutoRemote
  • Setup a profile in Tasker to be triggered by an Event, choosing AutoRemote
  • Set the message for the AutoRemote Event to be "screen_on"
  • The task triggered by the profile launched an app, selecting Chrome (I would like to refine this, see comments at the end). This relies on having the HE dashboard already open in Chrome and as the tab with focus in Chrome.
  • Setup a similar profile and task, using a message filter of screen_off and choose whatever alternate action to run in response, I chose to launch a "clock" app as I do not have the option to turn the tablet on/off

With tasker configured and working, I then setup the rules on my HE hub:

  • First I created a Virtual Switch called Kitchen Tablet Display Dashboard, with not auto-off configured
  • I created a rule to turn this virtual switch on / off based on motion detected by my Hue Motion Sensor

  • Next I setup a second rule to respond to the virtual switch being turned on / off, sending the appropriate HTTP call to AutoRemote

I originally had just one RM rule based on motion, but I was getting re-activation when motion was re-activated while standing in front of the tablet, annoying when I was switching to other apps apart from Chrome.

I will also be re-instating my charging cable I had done away with, remembering what I had read about Tasker draining battery quite quickly.

One refinement I would like to try and make is to launch a copy of the dashboard that has been saved to my home screen from within Chrome, which does not display the Chrome header, i.e. the tabs and other menus, etc.

One other idea I have had is to setup an RM rule to trigger the display of a different dashboard when I have an activity turned on in my harmony hub, displaying a very simple A/V dashboard I have setup with buttons for different TV stations and volume controls.

Simon

3 Likes

Love it & love how well Tasker and HE work together. Why does it say "Internet Required" in title? I didn't see anything in what you did that requires the internet.

Don't forget to plug into a smart plug so you can turn off when phone is charged and turn back on when phone is sufficiently discharged using a different Tasker profile. :smiley:

EDIT: Ooops, I meant tablet, not phone.

1 Like

Late here, and half asleep.

Possible suggestion to simply. Why not have motion cause a temp USB power cut, and simply have tasker turn the screen on when power is restored?

I found on my older tablet that cutting the power and re-adding actually turned the screen on.

Given it's age, about 6-7 years old, I don't have the option in Tasker to control turning the tablet screen on / off, which is what I wanted to do in the first place.

From what I can see and what was said on one of the Youtube clips by the creator, I believe the AutoRemote call goes out to the internet.

Gotcha, I don't use that piece of Tasker.... yet.

1 Like

Worth a look

1 Like

Will definitely check that out, looks very promising....

Will also look at the smart plug idea, I already have one behind the fridge, but can struggle for room with another double-adaptor and two large plugs on top.... Thanks for the tip.

Actually, the fridge is plugged into that....

Also, it's been a while since I messed with this (it's on the to do list). But there's an external app to turn screen on or off. Which can be called from tasker. Stop tablet from going to sleep, ever, and send a local command for screen in/off as requested. Perhaps. =)

1 Like

Yeah, I would love one, if you find it that would be great, everything I've tried has hit a brick wall in the end.

I just tried it on my brand new cheap ONN Tablet "Walmart Special" and toggling power off & on woke the screen. Previously, I had that working on an old Samsung tablet running Android 4.4

1 Like

Hmmm... I'd never considered that.... It's not really an option for me, but I just tested it as well and it would work for those where a smart plug is an option. If I set the sleep setting on the tablet to X seconds / minutes, then plug in OR unplug the USB charging cable, the screen turns on. Nice.

Also am still playing with the Wifi option for AutoRemote, getting a BAD_REQUEST error that is strange.... Will post back when / if I get it working.

I put a * in the title and an edit on my original post around the need for the Internet based on the smart plug option and potential for wifi as @djh_wolf suggested.

I think I got the local call to work.... Well I know I got a local LAN call to work, reliability is the issue atm.
It needs some work to make it more robust. Got to the point of installing EventGhost on my PC to only realise I was putting an "&" before the message parameter in the URL rather than a "?", I will claim I read it somewhere else on a forum post.... :slight_smile:

Just tested it with my modem unplugged and it worked, but I have done a whole heap of other setup stuff, so probably need to set it up from scratch in order to give a more coherent set of steps. I also did notice it didn't work when I came home earlier, so again, needs some refining.

Will post back when I am making more sense and have something more concrete to contribute :slight_smile:

1 Like

@sburke781

Spot on!

This is on my todo list for a number of reasons. I used tasker etc before but after the move to hubitat I was hesitant to add another cloud based solution to the mix. So this could be quite cool to follow =)

1 Like

I do this using Fully Kiosk. There's a community driver that allows you to change tablet brightness or switch the screen on/off. It works really nicely integrated with RM custom actions. Oh and it's local :slight_smile:

2 Likes

Ah! That's the missing piece. Definitely =)

1 Like

Always nice to have options, not necessarily the one I will go with but nice to see what other people use.