Tasker - Bluetooth Info Task

217 views
Skip to first unread message

Erik Carlin

unread,
May 31, 2023, 12:04:16 PM5/31/23
to Tasker
Hello Crew, 

Posted on Reddit but see this forum is active too - wondering if this makes logical sense in the world of Tasker. I am attempting to trigger a different set of actions based on which car I go into. Two are powered by Android Auto and using I am using BuzzKill to capture the notification. Using the variable %title from it to do things with. I am just not sure if I do BT info on RX I am going to get the info I need for the other if statements etc. 

Thanks for the help. Here is the Reddit post info:

Bluetooth Info and Action

Hello crew,

I've spent some time on this task and I'm wondering if this a proper use of the Bluetooth info action etc. Specifically, if this works as I feel it might. The other option is to create variables for each car I go into and check if conditions based on variable values.... Curious if this logically makes sense with Tasker. Appreciate any insight :)

    Profile: Car Audio
    Settings: Cooldown: 15
     State: BT Connected [ Name:LEXUS RX/LEXUS IS/LEXUS NX Address:* ]
   
   
   
    Enter Task: Car Audio Entry
    Settings: Abort Existing Task
   
    <Task was called by %caller1>
    A1: Anchor
   
    A2: Variable Set [
         Name: %BuzzKillActivated
         To: %caller1
         Structure Output (JSON, etc): On ]
   
    A3: Wait Until [
         MS: 0
         Seconds: 1
         Minutes: 0
         Hours: 0
         Days: 0 ]
        If  [ %TRUN !~ *leaving* ]
   
    <Check if task ran within the last 10 seconds
    Current Time: %TIMES
    Last Run Time: %LastRun>
    A4: If [ %TIMES-%LastRun < 10 ]
   
        <Stop - task ran within the last 10 seconds
        Runtime is %qtime>
        A5: Stop [ ]
   
    A6: End If
   
    <% title variable set from buzzkill %title = %androidauto ?>
    A7: Variable Set [
         Name: %androidauto
         To: %title
         Structure Output (JSON, etc): On ]
   
    <Wait if I just left home>
    A8: Wait [
         MS: 0
         Seconds: 3
         Minutes: 0
         Hours: 0
         Days: 0 ]
        If  [ %TIMES-%JustLeftHome < 5 ]
   
    A9: Bluetooth Info [
         Type: Single Device
         Device: LEXUS RX
         Timeout (Seconds): 5 ]
   
    A10: If [ %androidauto ~ *android auto* ]
   
        <Android Auto Triggered>
        A11: Anchor
   
        A12: Perform Task [
              Name: AA Task
              Priority: %priority+1
              Structure Output (JSON, etc): On ]
   
        A13: Goto [
              Type: Action Label
              Label: end ]
   
    A14: Else
        If  [ %bt_name ~ *is* ]
   
        <Lexus IS triggered>
        A15: Anchor
   
        A16: Tasker Function [
              Function: WireGuardSetTunnel(true,RaspberryPi ) ]
   
        A17: WiFi [
              Set: Off ]
   
    A18: Else
        If  [ %bt_name ~ *rx*/*nx* ]
   
        <Lexus RX/NX triggered>
        A19: Anchor
   
        A20: Tasker Function [
              Function: WireGuardSetTunnel(false,RaspberryPi) ]
   
        A21: WiFi [
              Set: On ]
   
    A22: Else
   
        A23: Tasker Function [
              Function: WireGuardSetTunnel(true,RaspberryPi ) ]
   
        A24: WiFi [
              Set: Off ]
   
    A25: End If
   
    <end>
    A26: Anchor
   
    A27: Variable Clear [
          Name: %BuzzKillActivated ]
   
    A28: Media Volume [
          Level: 15 ]
   
    A29: Notification Volume [
          Level: 7 ]
   
    A30: Variable Set [
          Name: %LastRun
          To: %TIMES
          Structure Output (JSON, etc): On ]
   
   
   
    Exit Task: Car Audio Exit
    Settings: Abort Existing Task
   
    A1: WiFi [
         Set: Off ]
   
    A2: Tasker Function [
         Function: WireGuardSetTunnel(true,RaspberryPi ) ]
   
    A3: Notification Volume [
         Level: 7 ]
   
    A4: Variable Set [
         Name: %CarExitTime
         To: %TIMES
         Structure Output (JSON, etc): On ]


Reply all
Reply to author
Forward
0 new messages