Go Back   Android Forums > Android Discussion > Android Applications > Tasker

Like Tree2Likes
  • 2 Post By Cerberus666

test: Reply
 
LinkBack Thread Tools
Old June 8th, 2012, 02:07 PM   #1 (permalink)
AF Contributor
Thread Author (OP)
 
Scootmien's Avatar
 
Join Date: Apr 2012
Location: South UK
Gender: Male
Posts: 553
 
Device(s): iPhone 5s - Stock ::::: HTC One - Stock ::::: Samsung S2 - Rooted
Carrier: Vodafone / Three

Thanks: 87
Thanked 367 Times in 148 Posts
Default Tasker - trying to automatically turn off keyguard when near home wifi

Hi all

I wonder if any Tasker gurus could help me please?

I'm trying to create a Tasker task so that when I am connected to my home wifi network, the keyguard is automatically off

So in essence, I am doing as follows:
1) Context > State > Net > Wifi connected (input SSID or MAC)
2) Task > Display > Keyguard > Set 'Off'

Now whilst it works some of the time, most of the time it doesn't and when my screen times out and locks, I have to enter my password again. It doesn't always do this, just more often than not and definitely enough to be annoying.

Now i've looked at the step through on wikidot for the Tasker task but I can't get it to work as it asks me to add in a second context before I add a task (which Tasker won't let me do) - Disable Keyguard When At Home - Tasker Wiki

I realise I must be doing something fundamentally wrong but can't figure out what it is, so if anyone could lend a hand I would be appreciative please.

Advertisements
Scootmien is offline  
Reply With Quote
sponsored links
Old June 8th, 2012, 04:58 PM   #2 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,196
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 62
Thanked 419 Times in 345 Posts
Default

I've been doing the something similar recently, and know others have done so before, but I wanted to do it on my own and learn from the process. One thing I notice about your profile is that you're using the "Wifi Connected" context, whereas the profile in the Wiki uses "Wifi Near". If you leave Wifi on all the time, these two contexts may appear to almost identical on the surface. But if your Wifi Sleep Policy allows your Wifi to sleep when the device is off, you'll find that your Keyguard turns on each time your Wifi goes to sleep (because you're disconnecting from Wifi when Wifi sleeps).

Also, the Tasker help indicates that Keyguard changes may not be reliable unless the screen is on and unlocked.

What I'm doing is using the Secure Settings plugin to enable/disable the PIN lock based on Wifi connection. I found this to be unreliable with regard to locking the device after disconnecting from Wifi. So in my task that enables the PIN lock, I use Secure Settings to turn the display on for 5 seconds immediately before enabling the lock. I haven't had any problems in the past 2-3 days.

Here are my profiles:

Profile: Trusted Zone (184)
State: Wifi Connected [ SSID:ssid1/ssid2 MAC:* IP:* ]
Enter: Trusted (192)
A1: Secure Settings [ Configuration:Clear Password/Wait For Unlock ]

Profile: UnTrusted Zone (193)
State: Not Wifi Connected [ SSID:ssid1/ssid2 MAC:* IP:* ]
Enter: UnTrusted (194)
Abort Existing Task
A1: Wait [ MS:0 Seconds:30 Minutes:0 Hours:0 Days:0 ]
A2: If [ %PACTIVE ~ *,untrusted zone,* ]
A3: Secure Settings [ Configuration:Screen Dim
5 Seconds ] If [ %SCREEN ~ off ]
A4: Secure Settings [ Configuration:Set Pin ]
A5: End If

Notes:
  1. The 30 second delay allows time to reconnect, in the event that I briefly go out of range
  2. The "Wait For Unlock" makes it so that if someone finds my phone, they can't simply bring it within range of my Wifi to unlock it - it must be unlocked once while connected, or already be unlocked when it connects, then it will remain unlocked for as long as it remains connected.
  3. The reason I'm using two separate profiles, instead of a single profile with both an Enter and Exit task is that by using a single "Wifi Connected" profile, if the device is turned off while the PIN lock is disabled, and next turned on when out of Wifi range, the PIN would remain disabled (the profile would not exit during shutdown, or during startup). A single "Not Wifi Connected" profile with both an Enter and Exit task would possibly go the other way, meaning that if the device is turned off when out of range, then turned on when in range, the PIN might not be disabled (much safer than the other way, but still not ideal).
__________________
Dropbox referrals: http://db.tt/GfR6Q7v8
UncleMike is offline  
Last edited by UncleMike; June 8th, 2012 at 05:04 PM.
Reply With Quote
Old July 30th, 2012, 10:48 AM   #3 (permalink)
New Member
 
Join Date: Jun 2012
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tried this too. In my experience, two things do not work reliably, at least not on Jelly Bean:

1. The context "Wifi connected" on its own (I have "never sleep" on, and yet at some point Tasker "forgets" that Wifi was on and the keyguard is re-enabled until I switch Wifi off and on again).

2. The command "turn keyguard off" (often stops working all together at some point until reboot: even a Tasker short-cut on my home screen will then be unable able to turn off the keyguard).

My work-arounds are these:

1. I have added another profile with the context "Screen Off" + "Wifi connected" that turns the keyguard off if conditions are met. This way, the Wifi state is checked every time the phone is normally locked, which works reliably for me.

2. I have my action "Lock Off" set to first turn the keyguard on, then off again. This is reliable, whereas only turning it off usually stops working at some point (only starts working again after reboot).
Pinmac1 and joshatt34 like this.
Cerberus666 is offline  
Reply With Quote
Old August 14th, 2012, 09:18 AM   #4 (permalink)
Junior Member
 
Join Date: Jul 2012
Posts: 42
 
Device(s):
Carrier: Not Provided

Thanks: 2
Thanked 5 Times in 4 Posts
Default

I tried having it turn on then off again but it just stays on! The only way I can get it to work reliably is to use secure settings and use the toggle option under keyguard. Then it switches between enabled /disabled when I want it to.
scrabbley is offline  
Reply With Quote
Old August 27th, 2012, 07:31 AM   #5 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

My SGS2 would stay on when in Untrusted Zone after entering the pin once.
that is no pin required after the initial pin entry.
I removed the comma after untrusted zone

from A2: If [ %PACTIVE ~ *,untrusted zone,* ]

to A2: If [ %PACTIVE ~ *,untrusted zone* ]

Seems to work properly now.
Deedzy is offline  
Reply With Quote
Old October 5th, 2012, 09:30 AM   #6 (permalink)
New Member
 
Join Date: Oct 2012
Posts: 11
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Guys,

Can you please help me in understanding the criterias as I am a noob in Tasker Variables (not a developer). I am using Galaxy S2, Stock ROM on ICS 4.0.3

Parameter:
If [ %PACTIVE ~ *,untrusted zone* ]

I have removed the comma from the above parameter. But what is the *asterisk for? Do I have to give it as is or input a blank space or something else? I dont seem to get the pin code lock to work.

Pls help
shivark79 is offline  
Reply With Quote
Old October 5th, 2012, 06:45 PM   #7 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,196
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 62
Thanked 419 Times in 345 Posts
Default

Quote:
Originally Posted by shivark79 View Post
Hi Guys,

Can you please help me in understanding the criterias as I am a noob in Tasker Variables (not a developer). I am using Galaxy S2, Stock ROM on ICS 4.0.3

Parameter:
If [ %PACTIVE ~ *,untrusted zone* ]

I have removed the comma from the above parameter. But what is the *asterisk for? Do I have to give it as is or input a blank space or something else? I dont seem to get the pin code lock to work.

Pls help
Asterisks are wildcards, and will match any text of any length. What the statement above is doing is checking the %PACTIVE variable (the list of active profiles maintained by Tasker) to see if untrusted zone appears in that list. The reason I originally had the profile name bracketed by commas is that it specifies a complete profile name, and will only match if a profile named untrusted zone is active. Without the second comma (at the end), it will match untrusted zone, untrusted zone1, untrusted zonephone, etc.

If you're having trouble getting your profile to work, your best bet is to post the profile here so others can see exactly what you're doing. When I need to do this, I long-press on the profile and select Export, the Description to Email. This brings up a choice of apps to handle the exported file. I usually choose Dropbox (you'll need Dropbox installed to do this) because the file is then automatically synced with my desktop and I can easily copy/paste the profile from the exported file into the forum post. Regardless of how you get the profile into the forum post, Description is the "format" you want to export in.
UncleMike is offline  
Reply With Quote
Old October 6th, 2012, 01:05 AM   #8 (permalink)
New Member
 
Join Date: Oct 2012
Posts: 11
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the profile that I have set:

Profile: Trusted Zone (29)
Priority: 8 CoolDown: 0
State: Wifi Connected [ SSID:Tvishi MAC:* IP:* ]
Enter: Trusted (30)
A1: Secure Settings [ Configuration:Clear Password/Wait For Unlock Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]

Profile: Untrusted Zone (31)
State: Not Wifi Connected [ SSID:Tvishi MAC:* IP:* ]
Enter: Untrusted (32)
Abort Existing Task
A1: Wait [ MS:0 Seconds:0 Minutes:30 Hours:0 Days:0 ]
A2: If [ %PACTIVE ~ *,untrusted zone* ]
A3: Secure Settings [ Configuration:Screen Dim
5 Seconds Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ] If [ %SCREEN ~ off ]
A4: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]
A5: End If

I also tried to give a comma after untrusted zone and before asterisk but still no luck
The *asterisk in Mac and IP are fields left blank
The *asterisk in setting A2 are * given manually. Attached screen shot
uploadfromtaptalk1349503505574.jpg
shivark79 is offline  
Last edited by shivark79; October 6th, 2012 at 01:19 AM.
Reply With Quote
Old October 6th, 2012, 08:59 AM   #9 (permalink)
Senior Member
 
UncleMike's Avatar
 
Join Date: Nov 2009
Location: Central NJ
Posts: 2,196
 
Device(s): Moto X - GSM DE
Carrier: Not Provided

Thanks: 62
Thanked 419 Times in 345 Posts
Default

I think I was using the Screen Dim in Secure Settings as a troubleshooting measure at one time, but I no longer have that in my Untrusted task, but I don't see that including it would cause any issues.

Is the profile not activating, or is it not doing what it's supposed to do when it activates?
UncleMike is offline  
Reply With Quote
Old October 6th, 2012, 10:56 AM   #10 (permalink)
New Member
 
Join Date: Oct 2012
Posts: 11
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can see it as activated in the notification drop down but it does not do what it is supposed to do : (
shivark79 is offline  
Reply With Quote
sponsored links
Old October 6th, 2012, 12:32 PM   #11 (permalink)
Senior Member
 
shauny13's Avatar
 
Join Date: May 2010
Location: Beautiful Dorset
Gender: Male
Posts: 1,226
 
Device(s): HTC Desire, dGB, S-OFF.(retired) HTC One X. rooted running viper rom 2.01 (retired) HTC ONE (M7), v
Carrier: Vodafone uk

Thanks: 176
Thanked 287 Times in 255 Posts
Default

ive been at this for days, tried everything but it just will not work for me.
__________________
ROOTING FAQS
shauny13 is offline  
Reply With Quote
Old October 6th, 2012, 09:07 PM   #12 (permalink)
New Member
 
Join Date: Oct 2012
Posts: 11
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

So I am not the only one who has this problem.. There has to be some kind of solution to this issue.

PS: this worked for me

Profile: Change Lock Style (11)
State: Wifi Connected [ SSID:Tvishi MAC:"give your mac id here" IP:* ]
Enter: Lock Off (12)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A2: Secure Settings [ Configuration:Clear Password/Wait For Unlock Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]

Exit: Lock On (13)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A2: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]
shivark79 is offline  
Last edited by shivark79; October 7th, 2012 at 05:00 AM.
Reply With Quote
Old November 19th, 2012, 03:07 AM   #13 (permalink)
New Member
 
Join Date: Nov 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to add CoolDown

Hello

A great thread...I'm new to Android and have two issues.

I'm unable to find "Profile Properties" to add a Cooldown. I've long clicked on the profile but only get the menus of Profile Options not Properties.

When using Secure Settings to set the Pin I get an error Decryption Failed.

I'm using a new Nexus 7 3G which isn't rooted.

Any help would be great. Thank you.

Ben
bsandall is offline  
Reply With Quote
Old November 19th, 2012, 06:20 PM   #14 (permalink)
Member
 
bruce73's Avatar
 
Join Date: Feb 2012
Location: Los Angeles
Posts: 380
 
Device(s): HTC Vivid, Nexus 10
Carrier: Not Provided

Thanks: 113
Thanked 45 Times in 42 Posts
Default

Quote:
Originally Posted by shivark79 View Post
So I am not the only one who has this problem.. There has to be some kind of solution to this issue.

PS: this worked for me

Profile: Change Lock Style (11)
State: Wifi Connected [ SSID:Tvishi MAC:"give your mac id here" IP:* ]
Enter: Lock Off (12)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A2: Secure Settings [ Configuration:Clear Password/Wait For Unlock Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]

Exit: Lock On (13)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A2: Secure Settings [ Configuration:Set Pin Package:com.intangibleobject.securesettings.plugin Name:Secure Settings ]
I'm trying to follow along here and have created a profile exactly as you describe, and when on my home network it activates, but it won't set my PIN again when I test it by turning off Wifi, waiting the 5 seconds and switching off/on the phone. What am I missing?

Edit: OK, it is working now, but there is the problem UncleMike alludes to when at home and not Wifi connected (my night setting with Juice Defender). So I'm going to try his profile, but what's the verdict on inserting the second comma in [*,untrusted zone,*]? Yea or nay?

Edit: after updating SecureSettings to the latest version, UncleMike's isn't working at all anymore. So I've changed the contexts of both profiles to WiFi Near; so far so good.
bruce73 is offline  
Last edited by bruce73; November 25th, 2012 at 01:47 PM.
Reply With Quote
Old November 22nd, 2012, 11:33 AM   #15 (permalink)
Senior Member
 
Join Date: Jan 2012
Posts: 919
 
Device(s): rooted AT&T GS4 w/ Android 4.3
Carrier: Not Provided

Thanks: 271
Thanked 195 Times in 153 Posts
Default

Quote:
Originally Posted by bsandall View Post
Hello

A great thread...I'm new to Android and have two issues.

I'm unable to find "Profile Properties" to add a Cooldown. I've long clicked on the profile but only get the menus of Profile Options not Properties.

When using Secure Settings to set the Pin I get an error Decryption Failed.

I'm using a new Nexus 7 3G which isn't rooted.

Any help would be great. Thank you.

Ben
Properties should show up.
Are you pressing on the profile (not the context)?
Maybe try turning off beginner mode?
Menu / Preferences / UI / Beginner Mode (uncheck)
electricpete is offline  
Reply With Quote
The Following User Says Thank You to electricpete For This Useful Post:
bberryhill0 (November 22nd, 2012)
Reply


Go Back   Android Forums > Android Discussion > Android Applications > Tasker

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:43 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.