Check location when Bluetooth disconnected from Vehicle.

609 views
Skip to first unread message

Kris Stuart

unread,
Aug 1, 2018, 9:55:40 AM8/1/18
to Tasker
I am looking for some assistance with the following: 

Using Tasker to check my device location when it disconnects from my vehicle. This is used to then perform further tasker operations. 

At the moment I have a Profile setup for when BT Connected to NAME/ADDRESS as inverted but this is not what I am looking for as this will check the location whenever I am not connected to the vehicle. Even although this does eventually check when the BT disconnects I am looking to find out if there is a better or more specific way to do this only when a certain BT address is disconnected? 

Thanks in advance. 

[Tasker novice - apologies] 

João Dias

unread,
Aug 1, 2018, 11:24:49 AM8/1/18
to tas...@googlegroups.com
You could set it as the exit task of a profile with the not inverted condition :)

Duck Redbeard

unread,
Aug 1, 2018, 1:29:34 PM8/1/18
to Tasker
This is what happens when my phone and car get disconnected…

Parking (41)
Run Both Together
A1: Secure Settings [ Configuration:GPS Enabled Timeout (Seconds):0 ]
A2: Get Location [ Source:Any Timeout (Seconds):75 Continue Task Immediately:Off Keep Tracking:Off ]
A3: Set Widget Icon [ Name:Mode Icon:content://com.android.externalstorage.documents/document/primary%3ATasker%2FPhotos%20for%20scenes%2FScreenshot_20180312-202855__01__01.jpg ]
A4: Profile Status [ Name:Home Set:On ]
A5: Media Control [ Cmd:Pause Simulate Media Button:On App: ]
A6: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A7: Variable Set [ Name:%CARLOC To:%LOC Recurse Variables:Off Do Maths:Off Append:Off ] If [ %LOCSPD < 2.1 ]
A8: Variable Set [ Name:%SPEED To:%LOCSPD * 2.236 Recurse Variables:Off Do Maths:On Append:Off ]
A9: Flash [ Text:Your speed is %SPEED MPH Long:Off ]
A10: Beep [ Frequency:1804 Duration:74 Amplitude:50 Stream:5 ]
A11: Secure Settings [ Configuration:GPS Disabled Timeout (Seconds):0 ] If [ %PACTIVE ~R XV ]
A12: Stop [ With Error:Off Task: ] If [ %PACTIVE ~R XV ]
A13: Secure Settings [ Configuration:GPS Disabled Timeout (Seconds):0 ] If [ %PACTIVE ~R Outback ]
A14: Stop [ With Error:Off Task: ] If [ %PACTIVE ~R Outback ]
A15: Goto [ Type:Action Number Number:5 Label: ] If [ %LOCSPD > 2 ]
A16: Perform Task [ Name:MTSubmode Set Parked Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A17: Notify Cancel [ Title:Connected to the XV Warn Not Exist:Off ]
A18: Play Ringtone [ Type:Notification Sound:Free Stream:5 ]
A19: Vibrate Pattern [ Pattern:0,200,200,200,200,200 ]
A20: Kill App [ App:Play Music Use Root:On ]
A21: Secure Settings [ Configuration:GPS Disabled Timeout (Seconds):0 ]
A22: [X] WiFi [ Set:On ]
A23: Profile Status [ Name:The Cabin Set:On ]
A24: Profile Status [ Name:Home Set:On ]
A25: Profile Status [ Name:TOC Set:On ]
A26: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A27: Bluetooth [ Set:Off ]
A28: Variable Clear [ Name:%CAR Pattern Matching:Off Local Variables Only:Off ]
A29: Secure Settings [ Configuration:NFC Enabled Timeout (Seconds):0 ]
A30: Keyguard [ Set:On ]
A31: WiFi [ Set:Off ] If [ %Mode ~ Work ]
A32: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A33: Bluetooth [ Set:On ] If [ %CHARGING ~ is ]
A34: Perform Task [ Name:MTMode Set Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A35: Profile Status [ Name:XV Set:On ]
A36: Profile Status [ Name:Outback Set:On ]

Duck Redbeard

unread,
Aug 1, 2018, 1:37:27 PM8/1/18
to Tasker
Long story short, it gets my %LOC and saves it to %CARLOC so I can access it later. (A different task opened maps to %CARLOC to show me where I parked). It also does a few things that went apply to you. One thing I have incorporated is that it won't mark my spot if I am still driving. It keeps going back a few steps and rechecks my speed.

This runs if my bluetooth gets disconnected and will abort if reconnected. It also will only run if bluetooth is on. It checks that on the enter task. That way I can turn off bluetooth while driving without this constantly trying to mark my spot.

Kris Stuart

unread,
Aug 1, 2018, 4:48:44 PM8/1/18
to Tasker
Looks very impressive. Is there a way to restore or import this from above to tasker so I can see how it looks to see if I can work out which parts I need to pick to make my profile? Thanks

Duck Redbeard

unread,
Aug 1, 2018, 5:38:33 PM8/1/18
to Tasker
I will thin it down and post it later… mebbe tomorrow.

Duck Redbeard

unread,
Aug 1, 2018, 5:50:44 PM8/1/18
to Tasker
Already had it simplified!

Parking Simplified (378)


Run Both Together
A1: Secure Settings [ Configuration:GPS Enabled Timeout (Seconds):0 ]
A2: Get Location [ Source:Any Timeout (Seconds):75 Continue Task Immediately:Off Keep Tracking:Off ]

A3: Wait [ MS:0 Seconds:4 Minutes:0 Hours:0 Days:0 ]
A4: Variable Set [ Name:%CARLOC To:%LOC Recurse Variables:Off Do Maths:Off Append:Off ]
A5: Beep [ Frequency:1804 Duration:74 Amplitude:50 Stream:5 ]
A6: Play Ringtone [ Type:Notification Sound:Free Stream:5 ]
A7: Vibrate Pattern [ Pattern:0,200,200,200,200,200 ]
A8: Secure Settings [ Configuration:GPS Disabled Timeout (Seconds):0 ]
A9: Notify [ Title:Your parking location has been saved Text:Your car is at %CARLOC Icon:mw_image_assistant_photo Number:0 Permanent:Off Priority:3 Actions:(1) ]

Kris Stuart

unread,
Aug 1, 2018, 5:54:05 PM8/1/18
to Tasker
So how do I import this as a profile to see?

Thanks

Duck Redbeard

unread,
Aug 1, 2018, 5:55:33 PM8/1/18
to Tasker
One more piece…

Nav To Parking Spot (407)
A1: Open Map [ Mode:Point Address:%CARLOC Lat,Long: Zoom:1 Label: ]


That is the task that runs when you click the notification.

Duck Redbeard

unread,
Aug 1, 2018, 5:57:04 PM8/1/18
to Tasker
You could just rebuild it while you read my post. Or copy the steps into a txt doc and save as parking.xml.tsk and import.

Easier and more educational to rebuild by hand.

Marta Hintz

unread,
Aug 1, 2018, 7:24:26 PM8/1/18
to Tasker
No he can't copy your description into tasker. You will need to export to XML for direct input, OR use the new tasker import that's in the beta.

Duck Redbeard

unread,
Aug 1, 2018, 7:29:50 PM8/1/18
to Tasker
Right… just realized that. It isn't that hard to build from scratch, the steps are simple.

Kris Stuart

unread,
Aug 2, 2018, 6:45:02 AM8/2/18
to Tasker
Simple if you know how I guess. Not even sure where to start wit the first step. 
Create new profile but not sure where the 'Secure Settings [ Configuration:GPS Enabled Timeout (Seconds):0 ] ' comes under 

Duck Redbeard

unread,
Aug 2, 2018, 7:56:49 AM8/2/18
to Tasker
Secure settings is an app. A plugin that I use to do the location settings change. It may be unnecessary these days off Tasker can do it natively.

João Dias

unread,
Aug 2, 2018, 7:58:27 AM8/2/18
to tas...@googlegroups.com
In Tasker, use the Location Mode action to do that.

Duck Redbeard

unread,
Aug 2, 2018, 8:03:07 AM8/2/18
to Tasker
Yes. Just updated my task steps. I am slowly removing the secure settings steps from my projects. Thanks for baking that stuff into tasker. I believe I started using that plugin because those changes required root access and Secure Settings was the only way back in the day.

Kris Stuart

unread,
Aug 7, 2018, 10:25:47 AM8/7/18
to Tasker
Ok so I had another go at this and get the following.........

Profile: BT Connected To Car (30)

State: BT Connected [ Name:XXXX XXX Address:XX:XX:XX:XX:XX:XX ]

Enter: BT Connected To Car (31)

A1: Variable Set [ Name:%XXXXXXX To:1 Recurse Variables:Off Do Maths:Off Append:Off ]

A2: Ringer Volume [ Level:10 Display:Off Sound:Off ]

A3: Media Volume [ Level:10 Display:Off Sound:Off ]

A4: Notification Volume [ Level:10 Display:Off Sound:Off ]

Exit: BT Disconnected From Car (32)

A1: Variable Set [ Name:%XXXXXXX To:0 Recurse Variables:Off Do Maths:Off Append:Off ]

A2: Music Play [ File:Notifications/TextToSpeech/BluetootDisconnectedCheckingLocation.mp3 Start:0 Loop:Off Stream:3 Continue Task Immediately:On ]

A3: Media Volume [ Level:10 Display:Off Sound:Off ]

A4: Notification Volume [ Level:5 Display:Off Sound:Off ]

A5: Notification Volume [ Level:5 Display:Off Sound:Off ]

A6: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]

A7: Perform Task [ Name:Location Check Priority:1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

A8: Get Location [ Source:GPS Timeout (Seconds):120 Continue Task Immediately:Off Keep Tracking:Off ] 


This all seems to work ok but I also have other profiles setup to do certain things when I am at a certain location (like mute all at work etc.) But I am finding that the next task for when I am at the location never seems to kick in until I wake up the device. This could be 10 seconds after I arrive or 5 mins it seems to wait until that action. Any way around this? 

Duck Redbeard

unread,
Aug 9, 2018, 11:30:27 AM8/9/18
to Tasker
I occasionally (but very rarely) have a gap in my tasks also. As long as the display is on, it does complete efficiently. Try putting the more important step earlier in the task. One reason mine fires correctly is because I typically have my display on when driving or when near my destination so the display is on at BT disconnect. I have seen that if I put my device in a holster or pocket (which causes display off) the task has a hiccup. I've just trained myself to let it finish and move a little slower.

Kris Stuart

unread,
Aug 9, 2018, 3:22:24 PM8/9/18
to Tasker
Is there any option to wake up the screen as part of a task? I had a look for it but was unable to fine it. 

Duck Redbeard

unread,
Aug 9, 2018, 5:18:06 PM8/9/18
to Tasker
AutoInput has a wake screen.

Kris Stuart

unread,
Aug 9, 2018, 5:24:22 PM8/9/18
to Tasker
I dont have autoinput as an available action. 

Rich B

unread,
Aug 9, 2018, 8:08:16 PM8/9/18
to Tasker
Autoinput is a separate plug-in that works with Tasker. You can download it from the Play Store.

Rich D

unread,
Aug 9, 2018, 8:37:44 PM8/9/18
to Tasker Google Groups Post

Autoinput is a separate plug-in that works with Tasker. You can download it from the Play Store.

To do it without a plug in you can use the action-> alert-> popup . Set the time out to 1 sec.

You will see the pop up flash for the second (usually not a issue for most) .
Reply all
Reply to author
Forward
0 new messages