Bluetooth button capture not working

Discussion in 'Tasker' started by syndac, Sep 15, 2016.

  1. syndac

    syndac New Member

    Joined:
    Jan 29, 2016
    Messages:
    6
    Likes Received:
    0
    I recently started using this bluetooth car receiver: https://smile.amazon.com/gp/product/B01I498OE2

    The bottom button play/pauses any music or answers/ends a call (if ringing). I've been trying to get Tasker and AutoVoice to intercept that to launch AutoVoice or Google Now search without much luck. It doesn't seem to transmit the normal bluetooth buttons/inputs.

    I have set up Tasker profiles for each of the following buttons (both short and long press, with Grab checked) that let me know if the button was grabbed by displaying a toast:
    State>Hardware>Media Button>Play
    State>Hardware>Media Button>Pause / Stop
    Event>Plugin>AutoVoice>BT Pressed
    Event>Plugin>AutoVoice>BT Pressed (2)

    In AutoVoice, I also have AutoVoice Recognize BT and AutoVoice Recognize BT Secondary checked.

    Despite all of this, the button will only perform it's default, intended function. I can't seem to figure out how to intercept and use it. Any ideas?
     
  2. syndac

    syndac New Member

    Joined:
    Jan 29, 2016
    Messages:
    6
    Likes Received:
    0
  3. MysticGolem

    MysticGolem New Member

    Joined:
    Feb 26, 2016
    Messages:
    19
    Likes Received:
    0
    Syndac I have used Media Next and Media Previous in my automation, I have not tested Media Play, however I do believe it may be possible but I haven't tested the Media Play button.
    Now in Android 4.4.4 you can use a loop in Tasker to constantly Media Grab. Then you can intercept Media Next, Media Previous and Media Play. This works even when the screen is off.
    In Android 5.0+, it still works (screen off or on) however if there is music already playing, Tasker is unable to intercept anything. The only way to intercept in 5.0+ when music is already playing is to use AutoInput and it does work but the screen has to be on.

    Here's the concept.
    Create loop with and have the interval set to 4 seconds (you can use a faster one if you want). In this loop you call Media Grab. This way it ensures your phone is constantly grabbing the media controls for interception.
    Then when you press the Next, Previous or Play button on your Bluetooth device you can set a provide to determine if the any of those media buttons have been pressed (physical hardware) and do a custom Tasker task.
    My combination of Tasker and Autovoice works perfectly in 4.4.4, screen off or on and even if music is constantly playing or not. In Android 5.0 and up, I can still do the same thing except when music is playing, then I've lost all abilities to intercept and my Media Grab Loop doesn't allows Tasker to intercept hardware media buttons like it did in 4.4.4.
    The great thing about AutoInput is that it does work extremely well when the screen is on...but doesn't work when the screen if off.
    I've read it several times on the forums that AutoInput can't function when the screen is off and this is unfortunate.

    I hope this helps.
     

Share This Page