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

I think I have cracked it :grin:.

I needed to call a wifi service action in Tasker every 2 minutes on my tablet, I assume to keep wifi alive so that my HE hub could then successfully call to the tablet over the LAN reliably.

So in a (very big) nutshell this setup is essentially Tasker and AutoRemote installed on my tablet, with a profile receiving a message to turn the screen on or off and responding accordingly, plus another profile running every 2 minutes to keep the wifi service alive. There is then a HTTP call from an RM rule to the tablet using the local url format you posted earlier, sending screen on when motion is detected and screen off when it is not, using the Virtual Switch as the indicator.

I'll document it in more detail later. ..

Also, I did notice on a newer tablet that Tasker can open locally saved web pages, but I have not been able to make this work on my old tablet yet, i.e. pages I have saved to the home screen. Not a major issue, just want to get rid of the chrome stuff and show the dashboard in full screen.

1 Like

Still watching with interest.

Think it may be worth looking into fully too, BTW. :slightly_smiling_face:

1 Like

I would now consider this to be reliable, having used it for the last month or so, it turns on almost without fail. I'll capture the notes on the setup later today.

2 Likes

Now I need to remember how I did this.... :slight_smile:

I will outline what I have setup, but hopefully you can see that there are other options at almost each point in this setup, in terms of how to trigger and what to trigger. The key point is you can use Tasker and AutoRemote on a tablet to allow a HTTP call to be made from a HE hub (or elsewhere) to trigger "something" to happen on the tablet.

Not saying these are requirements, but I just wanted to outline the setup I am working with:

  • 7 year old tablet running Android 4.2.2, Tasker v4.7u3m
  • HE C-7 Hub with Hue Motion Sensor paired directly, located alongside the tablet mounted on my fridge
  • Second HE C-4 Hub with motion sensors linked from C-7 hub via Hub Mesh, running Rule Machine

One requirement of this setup will be a fixed IP address for the tablet being used.

There's probably going to be some steps I have missed below, so will update if anyone has any issues... I did play around with Event Ghost, but don't believe this is required, but some of the configuration settings for this may come into play for the setup I have now, not sure...

App Install and Configuration

Look up the Settings on your Tablet or router to find the IP Address configured
Install Tasker on the tablet from the Google Play Store (I think I have paid a few dollars for this...)
Install AutoRemote on the tablet from Google Play Store
Open AutoRemote App and go to Preferences
Under Advanced tick the "Wifi All Networks" option

Tasker Profile Setup

Open Tasker
Under the Profiles section press the + icon to create a new Profile, selecting Event as the type of trigger
Type "Auto" in the Filter textbox, selecting AutoRemote from the results
Press the pencil icon to edit the Configuration of the trigger
Press the Message Filter option
Type in a key word, e.g. "screen_on"
Back out to the Profile screen and press the New Task entry from the pop-up that appears alongside the new screen_on Profile
Give the new Task a name, e.g. Open Dashboard
Press the + icon to add an action, press the App Category, Launch App action, press the Chrome app
Back out to the Profiles screen

To test this setup so far:
Open Chrome on the tablet, navigating to the HE dashboard you want to display
Switch to another app on the tablet, or go back to the Home Screen, leaving Chrome open
Open a browser on another device, such as a another tablet or PC
Paste / type the following into the address bar, replacing the Tablet-IP-Address:
http://<Tablet-IP-Address>:1817/?message=screen_on
Chrome should open up on the tablet, displaying the dashboard opened earlier

HE Rule Setup

In my HE setup I have chosen to include a Virtual Switch, this is optional and can be skipped. The motion trigger from the first rule could be combined with the actions from the second to have the HTTP calls made in response to motion being detected. This switch provides options for triggering in other ways that do not include motion.

Open a browser and access the Devices section for the HE hub
Setup a new Virtual Switch device, with a name such as Display Dashboard
Access the Apps section of your HE hub
If not installed, install the Built-In App Rule Machine
Open Rule Machine and create 2 new rules:

To test, trigger motion and watch the dashboard display on the tablet.

You will notice that the rule includes a second HTTP call when motion is no longer detected. To achieve this I have repeated the Tasker Profile setup process, responding to a screen_off message, launching a Clock App instead of Chrome.

Some other ideas I have had are to launch different dashboards based on when I am doing, such as an A/V Dashboard when I am watching TV in the Kitchen, or a Climate dashboard when severe weather conditions are forecast or detected.

Simon

1 Like

I had a quick crack of this (finally) and noticed some oddities.

If I rely on the ..

http://:1817/?message=screen_on

... I find the message sometimes either fails and/or fails to have any effect. I'm using TinyCamPro along with tasker and an old android4 tab. Reason I attempted this approach as that FKB runs like a dead dog on this tablet, and also, it's reported as being incompatible with android 4 by the end of 2021.

Anyhoo.

Oddly, this is what I've discovered.

Approach 1:
send a message to get tinycam to show a specific cam, fullscreen.

  • works 'patchy'. only seems to work if there isn't a cam screen showing already, i.e. only works from 'home'

Approach 2:
use webcore to first run a piston to 'go to home page', then run another piston to 'start app with single camera'

  • works 100%

approach 3:
use webcore to send the message, have tasker return to homepage then show cam

  • again, only works if there isn't a cam showing already,

Odd.

1 Like

Glad to hear you took a crack at setting it up.

To get mine working somewhat consistently, actually quite consistently for a time... I had to setup a profile to keep the wifi part of AutoRemote (I think) alive. That said, mine has been a little sketchy lately, but am expecting it is something I have done.... I'll grab the profile shortly and post some more info.

Simon

That said, now that I read your post more closely, that doesn't appear to be your problem, more so responding to the message... Not 100% sure what to do in that case...

It's odd. Seems that basically, tasker/autoremote isn't working 100% on their own. At least with TinyCamPro anyway. Add in a bit of webcore too....perfect. Odd.

I've managed to bodge it together to get things working perfectly, including switching the tab on and off. It's a bit clunky but happy to post if it helps?

-=edit=-

realised I've kind of hijacked the thread a little, by adding in cams. But the concept's the same. I still need to flick the screen on/off on events

-=/edit=-

What you described sounds more like the issue is in the Tasker space... Does approach 2 involve Tasker at all? When you are using AutoRemote and Tasker, do you see a message flash up on screen when it receives the message? That will at least confirm that part is working.

Not so much for me, but happy to see other uses of this posted here, for anyone else who may find it useful, so go for it :slight_smile:

Not at all, the intention (for me) was not only to capture my own setup but if that sparks other ideas and discussion, that's great. But thanks for thinking about it...

It's all tasker. Bad explanation on my behalf.

To keep things simple, I have a few tasks in tasker.

  1. Pwr up
    This switches on and unlocks the screen. Triggered by a profile (event->autoremote -> matches text "pwr-up").

  1. Pwr down
    This switches off and locks the screen. Triggered by a profile (event->autoremote -> matches text "pwr-down").

How I trigger the profiles:

webcore httpgets.


1 Like

I'll post details of the wifi "keep alive" profile I have in my earlier post, like I mentioned earlier, don't expect this has anything to do with your issue, but useful nonetheless...

1 Like

I do have the settings for the tablet to keep wifi on during sleep too.

It's actually autoremote wifi service I think...

I might do it later, have a few other things on the go atm, but essentially, create a profile to run on a timed basis, say every 5 minutes. In the task, choose plugin, Auto-Remote, Wifi, tick the first box to turn on the wifi service.