Lock Android Tablet When Away?

Hello,

I’ve been lurking on your forums for weeks and have to say, what a great collection of people and info, thank you!

I have flush mounted a Nexus 7 to my wall and would like it to control the SHM but for obvious reasons, that isn’t a great idea. I know there is no delay feature on the alarm at the moment and I have tried to setup SmartPins with little success so I was thinking of other ideas. Right now I have the motion sensor and Tasker open Smart Tiles when the front facing camera detects movement, the main reason for going with Android. Ideally, I would like the Tablet to lock if it doesn’t detect my wife or myself in the home, that way no one could come in and turn the alarm off via the tablet. This leaves the tablet unlocked when we’re home but if someone breaks in while we’re home and decides to try and mess with the tablet, we are in much bigger trouble. The other option may be to have it lock from certain hours, say 9PM to 6AM or something like that, even with us inside, in addition to the presence sensor for during the day.

I’m a noobie and while I have spent hours on your forums learning Tasker and such, I can’t seem to find an answer to this, is it possible? Does anyone else have another solution for a wall mounted tablet, short of no SHM on it? I want to be able to disarm it at the door, in case we are letting the dogs out and don’t have our phone.

Thank you!

Tagging @joshua_lyon @tgauchat

When you say “lock” are you wanting to force a pin when your not home?
Could you use secure settings or something like that with tasker to lock the tabet. Then unlock when you want? I do something like that on my phone. I don’t use a pin so that might be little more complicated. Possibly have autoinput enter a pin for you?
A different approach might be to prevent the alarm from being disabled unless your home.
I don’t have an alarm so not sure how it actually works in SHM.
Could you make a virtual switch that allows disabling alarm when your home, or toggle it in smartthings, or is toggled by presence, toggle from phone? So unless you know what to toggle it will keep going off?

I know that’s more questions than answers. Might help you get going in a direction.

My understanding is that the OP is making use of the motion sensor option on the android tablet so that when you walk up to the tablet, SmartTiles is then immediately available.

So they want to retain that feature, but have it function only when the homeowners are home.

There are “kiosk” apps that can lock the screen on a time schedule that are used for store and office displays, but I was thinking Josh or Terry might know of something that would tie in with smartthings for more control options.

I have done something similar in that our tablet has the screen forced off when we’re not home or asleep. Felt no need for it to display when nobody’s around or we’re in bed.
In my situation the screen is held off by tasker in the camera profile (I think). My tablet does not have “lock screen” enabled. So you could override it by pushing power button to wake the screen.
If left on its own. It wakes up when we’re home or awake.
I haven’t finished tweaking it yet. I shifted my priority to learning basic CoRe use.
Tablet isn’t used much in my house. Girls typically use their phones for interaction. So it usually sits there showing a clock until camera is triggered.
I even had camera trigger off for awhile so just clock. Then could double tap screen hit a home button to see smarttiles.

1 Like

I realized just the same what you are asking for. If nobody is at home (status is away and presence is not present) you have to enter a pin to unlock the tablet and if status of SHM is Home you don’t need to enter a pin. The motion sensor detects the motion and brings up Smart Tiles.

I figured this out with tasker but have to look deeper on this later today because I set it up months ago.

Maybe that could be helpful for you.

Thanks
Joe

3 Likes

Depending on how you are powering the tablet, another option might be just to cut the power to the tablet when no one is home. But that would probably require adding another networked device. A tasker option would make more sense.

Wow, thank you for all the replies! I didn’t know much about Tasker and while I learned some basic things to wake the tablet up, I guess I need to keep learning. As for what I want, ideally, I would like the standard tablet lock screen to be on, to block access to the tablet during a time frame at night and while we are out. During the day, when we are home, I would like it to go right to STiles when it sense motion via the front camera.

@Joern, that sounds about right, thanks for clarifying and the motion sensor is just the tablet front camera.

The idea about only allowing the alarm to be disabled while one of us is home sounds perfect but I haven’t seen how to do that; IFTTT? That is something else I need to dive into deeper but the whole job thing is killing my research ha If you could point me in the right direction, I would really appreciate it.

The other thing I just realized is that it maybe hard to wake the tablet up, seeing how I don’t have access to the power button. I assume the camera would detect motion, as normal, and light the tablet up, just to the lock screen. I just don’t know if there is a way to only have the lock screen at certain times.

As for arming and disarming via presence, that would be a TON of false alarms. I like ST and all but connectivity isn’t it’s strong suit, just ask my dimmer switches that work 50% of the time. Hopefully the update Monday will help…

2 Likes

If you want to use a pin. I think @Joern is your man. Sounds like he already figured that out. I’m curious about that myself.

If your wanting to do something else. Then give specifics as to which path / option you want to try. There’s alot of helpful people here. All are eager to help each other. I personally think that’s the best part of this community.

As for using presence as a condition or trigger. In my system we have very few false triggers. We use a combination of phone and presence FOB to help with reliability. Search the forums. It’s talked about alot.

What version of Android are you running on your tablet? In Lollipop and Marshmallow, there’s this SmartLock feature which could be useful. It keeps a device unlocked if it sees another “trusted” Bluetooth device in the vicinity, and locks it otherwise. You could try pairing your and your wife’s phones with the tablet and setting them up as trusted devices.

1 Like

@Gorilla800lbs has a great recommendation with the SmartLock feature.

You can also implement the “lock when not home” feature based on what SmartThings thinks your presence is, but a lot of people have issues with SmartThings presence. In this approach, you could take one of two approaches:

  1. Subscribe to the presence attribute for you and your wife. Create a Tasker profile using the Thing State event plugin and store the status of your presence in a local tasker variable (reference) – when both devices are not present then lock the screen.
  2. Have a Tasker profile run at some designated times which would run the Thing: Get Attribute action for all of your desired presence devices. If both devices are not present, lock the screen.

And if you want to improve the SmartThings presence indication, you could use something like AutoLocation to setup a custom presence solution (reference).

1 Like

Sorry for my late response. But I needed to find some time to figure out what I did to set this up.

For my solution I’m using:

  • Old Nexus 7 running Android 5.1.1 on it

  • Android App “Motion Detector” to switch on the screen if any motions

  • Android app Sharp Tools which informs tasker over the mode change (Home, Away)
    using the variable “%st_mode ~ home” and "%st_mode ~ away

  • Tasker can work together with SharpTools and Motion Detector.

  • Android App Auto Start to start Motion Detector and SharpTools at boot-up (not necessary but nice)

If you have all this together you can create two simple profiles and tasks in Tasker.

First Tasker Profile "Motion Detect"
Intent Received "org.motion.detector.ACTION_GLOBAL_BROADCAST
run Tasker task:
1.Screen & Keyboard Lights on 1 second
2.wait 30 sec
3. System Lock

Second Tasker Profile “Mode change” which uses the strings from SmartTools to set lock the tablet or even not
Set off If %st_mode ~home is one Tasker task and
Set on If %st_mode ~ away is the other Tasker task.

So in (hopefully simple words)
If SmartTools gets the information about a mode change from ST it sends the information to Tasker which is switching the pin on or off. I set up the pin the normal way about Android settings.
If nobody is at home and the motion sensor switches the screen on you only see the lock screen and have to enter the pin. Same thing after a fresh boot.

It’s a little bit difficult to describe but I hope that helps a little bit. It works like a sharm.
Only one thing at the moment is the authentication issue with SmartTiles 5.8. Hopefully will be fixed soon but independent to this solution.

Please let me know if you need more information in detail how this all work together.

4 Likes

Thank you, trying that as soon as I get home.

Just to make the thread better, here’s a pic, not sure why the switch below looks dirty though. I used Lexan and painted the back white but I want a different color because it looks odd, plus my cuts need to be straighter. The tablet’s in the wall with a magnetic mount for the frame so easy to swap it out. As for the cut out, I needed the camera to detect motion so I had to mask it and leave it clear, looks funny though.

2 Likes

Looks good.
I’m almost doing the same thing as @Joern. I don’t have the pin option. When my screen wakes it goes to the smartiles screen. After the display times out it turns off. That triggers Gentle Alarm to start and I get a floating clock display. Motion shuts down clock and back to smarttiles. The screen is held off in sleep mode when my screen variable says for it to stay off. Motion will not wake it up.
I think entering a PIN every time would be annoying. Of course my tablet doesn’t get used much. Even with it right next to my wife and smartiles displayed. She still pulls out her phone. :smile:

That’s what’s great about this hobby, many many ways to accomplish the same task.

1 Like

Soooo…I managed to find the URL for Amazon Music and linked that in STiles, rooted the tablet to enable it to speak with my Airport Express for music streaming but have failed with Tasker. I tried the SmartLock, which seemed like the best way to do things but it doesn’t seem to want to use my iPhone as a device to unlock it so back to the drawing board. I guess I need to keep studying up on tasker.

Not sure what smartlock is? Now my curiosity is up.

I think smart lock is the android integrated smart function to unlock devices on special places, coupled with bluetooth devices and so on.

I didn’t look deeper into it how to combine smart lock with the presence of any devices to unlock the tablet.

Honestly it’s a little bit tricky and not really an app to setup in 5 min. But if you play a little bit around with it it’s not so difficult to set it up.

Please let me know if you need further information on it.

Ahhh, Okay I believe I had that turned on in my S5. When I get home I do not have to go through the lock screen. I can just wake the device and I’m on my home screen.

I think I turned my pin / gesture lock off so one of my Tasker profiles in my phone could function. I just didn’t know / research enough back when I made it to get around that. I don’t leave my phone laying around unattended when away, and don’t care if my family looks in my phone. So I never looked into turning pin lock on again.

I never thought about using bluetooth presence from one device to another to trigger something?

Thanks everyone and yes, the SmartLock seemed liked a good solution but like I said, all my devices, minus this tablet are Apple. I’ve been messing with SHM a bit and trying to get it to disarm at sunrise or a certain time but it works one day and then the alarm goes off the next. ST was fun as I was adding things but now that I’m trying to use it on a daily basis, not real impressed. I’m so tired of re-pairing switches through out the house but that being said, I’ll continue to play with Tasker.