Jump to content
  • Sign in to follow this  

    Mastering Tasker - 4: PIN locking via Bluetooth Smart proximity


    Welcome to part 4 of our feature, 'Mastering Tasker'. In this series of articles, we'll take you through getting the most out of the powerful, versatile but also scary-to-newcomers Tasker application. In this part - PIN locking via Bluetooth Smart proximity.

    What today's article covers

    Today we're going to talk about PIN locking your device using proximity to a Bluetooth Smart device. Keeping your device secure is very important so using a lock method such as a PIN lock really is vital. The thing is though, I personally find entering a PIN a right pain so i'd rather not do it. The solution I use is to have the PIN disabled automatically when the phone is near my FitBit (which I always have in my pocket) and enabled if that ever goes away (for example if someone has snatched my phone). It's actually a double win as if my phone pops up with a PIN box it reminds me i've left my FitBit behind. :)

    Downloading 3rd party plugins

    To start today we need to download the third party plugin we're going to use. To have a browse around the Play Store at which plugins are available you can obviously search for 'tasker plugin', but you can also search for 'locale plugin'. Locale is a similar context-based-functionality application to Tasker (it was actually around before Tasker) and Tasker can use its plugins... giving you even more choice! :)

    For this guide i'm going to use a plugin called 'Secure Settings' - downloadable from the Play Store for free (with a premium option available).

    Ready? Then let's go!

    Finding the MAC address of your Bluetooth device

    First of all you need to decide which device you are going to use to toggle your device lock. As mentioned above, I use a FitBit but that's not the only option. A Bluetooth Smart device of some description makes sense due to battery life and the ease with which you can chuck it in your pocket, but there a lots of them available - the HTC Fetch, Nokia Treasure Tag, the forthcoming iFind from Kickstarter... they should all work!

    All Bluetooth devices have a unique MAC address (like regular network devices), and you need to find this as it's this that will be used to identify your Bluetooth device. The easiest way to do this is to download an application called Bluetooth Scanner from the Play Store.

    Enable Bluetooth on your device, ensure your Bluetooth device is nearby and run the app. You'll be presented with a screen similar to this:


    Here you can see it has found my FitBit One. Identify your device and take a note of the MAC address. You can exit the app now, we're done here.

    Using the Bluetooth Near context

    Now run Tasker and hit the big '+' button down in the bottom right to add a new profile. Click the 'State' button, followed by the 'Net' button followed by 'BT Near'. As we are using a State, this means that the profile will be continually active while the state is true, firing a task on entry and also a task on exit if defined.


    There are a lot of options in the next screen, but we don't need to worry about most of them. All we need to do here is enter the MAC address we wrote down earlier (DD:90:2D:14:EF:99 in my example) in the 'Address box' and tick the 'Low-Energy (LE) Devices' and 'Unpaired Devices' boxes. Once you've done that, hit the Tasker icon at the top to go back. You'll see your new Profile in the list and you'll be prompted to hit the 'New Task' button. Do so!


    Add the entry and exit tasks

    You'll be prompted to optionally enter a name for your task at this point, you can enter one if you like, I don't generally bother - I just press the tick. ;) You are defining your Entry task at this point - i.e. what happens when your Bluetooth device is detected.

    You'll now be at the Task Edit screen with an empty action list. In here you want to define the disabling of your device lock. Hit the + icon down the bottom, select 'Plugin' followed by 'Secure Settings'. For 3rd party plugins, the configuration is handled externally, by hitting the pencil icon next to the Configuration text.


    In the Secure Settings UI, expand the 'Dev Admin Actions' section and click 'Password / Pin'. Ensure that the button says 'Disabled' (and that 'Device Admin Enabled' is checked so it can do its thing) then press on the disk icon to save. Press the Tasker icon at the top left again to save the action and you should be returned to the Task Edit screen showing your new action. One more press on the Tasker icon and you should be back at your Profile list showing your new entry task.

    All you need to do now is to define an Exit task - so the when your Bluetooth device goes away, the PIN is enabled. Press and hold on the Entry task ('Secure Settings Clear Password') in the Profile screen and from the menu that pops up, select 'Add Exit Task'. Simply repeat what you did above, but this time click the 'Disabled' button so it says 'Enabled' and enter a PIN or password.

    After saving the exit task you're done! :)


    Hopefully setting this up has inspired you with all sorts of ideas about what you could do with other built-in / 3rd party Tasker actions and Bluetooth proximity... let us know if you come up with any great ideas in the comments below!

    Enhance the profile with your Home zone and variables

    I've actually enhanced my profile slightly in that I also disable PIN lock when I am at home, on my Home WiFi. To do this, I set variables on entry to the Home or Fitbit Near tasks and in the exit of each, I check the other isn't active by checking this variable in the 'if' part of the task, as you can see below.


    Next time

    In the next part of our Mastering Tasker feature we're going to look at how you can send push messages to your device from the web to launch any task you choose.

    Please post your feedback in the comments, together with any requests / ideas for future parts!

    Sign in to follow this  

    User Feedback

    Recommended Comments

    Hey guys, I've been new to tasker and I'm learning to get around it, and wanted to take a tour on your "Mastering Tasker - 1, 2, and 3 " but first post in the topics is really messed up and almost unreadable wit a lot of <br> and &#39 and similar tags. (#3 is ok but the pics are messed)

    Could you fix it, please? Thanks

    Here are the topics:



    edit: nevermind, the link on the end of the first post in each topic leads to the article in the news+articles section. 

    Edited by prile

    Share this comment

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now


Important Information

By using this site, you agree to our Terms of Use.