Bluetooth connected context?

3,651 views
Skip to first unread message

leopheard

unread,
Oct 4, 2012, 8:21:12 PM10/4/12
to tas...@googlegroups.com
Hi all,

I'm trying to add a profile which detects if another profile is on or not (wifi on at home) and turns on the bluetooth.

I'd like it to detect if the BT is not connected within a certain timeframe and disconnect if not connected to the car BT unit.

I can't find variable to add to the 'if' section of the 'turn BT off' task which basically says 'if BT not connected after x-seconds, turn off'. Ideally, I'd also like to be able to set this to the BT MAC address of the car's BT unit?

Any ideas please, as the only variables I can see Tasker will accept is 'Bluetooth status' as 'on' or 'off'?

Many thanks

Michael Yeager

unread,
Oct 4, 2012, 8:31:48 PM10/4/12
to tas...@googlegroups.com
Use Bluetooth Connected and specify the MAC address of your car Bluetooth. Set a variable for entry task, clear it for exit task. Second profile turns Bluetooth on when you want t on, waits a certain amount of time and turns it back off if first profile isn't active. I do this except I just leave Bluetooth on and use the Bluetooth profiles for other tasks and profiles.

Leo Edwards

unread,
Oct 14, 2012, 7:38:43 AM10/14/12
to tas...@googlegroups.com
Thanks for the reply.

I'm not quite following your idea. Which variable should I set/clear? I've created a new variable called %BT_CAR and set it 'connected' if it sees it connected to the car's MAC address, and clears it when the car's not connected to the BT.

I have then used another profile that states if the 'wifi on at home' profile isn't running, it will turn on the BT as an entry task and an exit as BT off if the variable above is not set as 'connected'.

Will this work with the second profile being set as an entry/exit task? The car BT will be connected before Tasker realises I have left the house, but I've not yet left the house to find out!

Thanks for the tips.

Michael Yeager

unread,
Oct 14, 2012, 4:58:51 PM10/14/12
to tas...@googlegroups.com
I use variable %Btooth and set it to 1 anytime a Bluetooth profile is active and clear it on Bluetooth profile exit. The Bluetooth connected profile has the MAC address of the device so if it's the headset then Yeh Bluetooth Headset profile is active and %Btooth is 1. I use %Btooth to prevent the say command speaking text in other tasks. A second profile, Bluetooth Car, also sets and clears %Btooth and I'm working on car mode and read texts...
Message has been deleted
Message has been deleted

Michael Yeager

unread,
Oct 27, 2012, 4:12:41 PM10/27/12
to tas...@googlegroups.com
Ok. Create the first profile and call it BT Connected (or whatever you want to call it) and specify the context as BLUETOOTH CONNECTED and set a variable that you will remember (I think mine is %BTConnected) to 1 in the entry task. Clear it or set to 0 in the exit. This will activate anytime Bluetooth is connected.

Now turning Bluetooth on and off is a bit trickier depending on how definite you want to be with it. Assuming you already have location profiles for home and work, in the exit task you can add a line to turn Bluetooth on, another to wait a minute or two and then one last line to turn Bluetooth off IF %BTConnected = 0. If it's 1, this last line gets skipped and Bluetooth remains on. In the entry tasks for home and work, you simply check to see if %BTConnect = 0 and if so turn off Bluetooth.

It's going to get more involved as you get into it but for now this will get you started....

Jaimon

unread,
Oct 29, 2012, 1:24:11 AM10/29/12
to tas...@googlegroups.com
Thanks for the tip. I followed the exact same steps earlier and couldn't see the variable getting set.  I think I assumed that the status "Bluetooth Connected" will be active as soon as I turn on BlueTooth.  My mistake.

Meanwhile I found another task in the example section where I can turn off the BlueTooth if no devices are connected for a predefined period.  I'm using that right now and it works well.  

Michael Yeager

unread,
Oct 29, 2012, 9:39:25 AM10/29/12
to tas...@googlegroups.com
Turning off Bluetooth after a certain time of nothing is connected is fairly easy. I just leave Bluetooth on at this point in time although I'm not using it much right now. Might have to look into that when I'm done with a few other things. If you only have a headset, turning it off automatically is ok. If your car has Bluetooth, turning it off may cause issues connecting to the car if you don't turn it back on fast enough.
Reply all
Reply to author
Forward
0 new messages