Tasker Profile: Display a Permanent Notification When Near a BT Device

I have recently picked up a pair of Bluetooth Headphones which I use while at work. When I'm at work I sometimes switch from listening to my computer to listening to my phone. Since there is no easy way to connect to my headphones with one click (you have to go to Settings -> Bluetooth -> Tap on your device), I've decided to create next best thing: Tasker Profile!

What this profile does is displays a permanent notification with 2 buttons: Toggle Bluetooth connection to a device of my choice and dismissing this permanent notification. The setup this up, followed profile and task description exports!

Profile Description:

State: BT Near [ Name:BT Headphones Address:11:22:33:44:55:66 Major Device Class:Any Standard Devices:On Low-Energy (LE) Devices:Off Unpaired Devices:Off Toggle BlueTooth:Off ]
Enter: Anon (87)
A1: Notify [ Title:Parrot Zik Text: Icon:hd_hardware_headphones Number:0 Permanent:On Priority:3 Actions:(2) ]
 
Exit: Anon (88)
A1: Notify Cancel [ Title:Parrot Zik Warn Not Exist:Off ]

Please note that Enter task A1 has 2 actions:

  1. Perform Task action which calls a task that is described in the next description block
  2. Notify Cancel action which dismisses the permanent notification

Toggle Headphones Connection Task Description:

A1: Status Bar [ Set:Collapsed ] 
<if not connected to Zik, connect>
A2: If [ %zikActive ! Set ]
<connect to Zik>
A3: Secure Settings [ Configuration:BT Headphones - Connect/Auto BT Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 
A4: Media Volume [ Level:15 Display:Off Sound:Off ] 
A5: Variable Set [ Name:%zikActive To:1 Do Maths:Off Append:Off ] 
A6: Else 
A7: Secure Settings [ Configuration:BT Headphones - Disconnect/Auto BT Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] 
A8: Media Volume [ Level:0 Display:Off Sound:Off ] 
A9: Variable Clear [ Name:%zikActive Pattern Matching:Off ] 
A10: End If
Profile Dependencies: 
Root AccessSecure Settings

Comments