"Bluetooth Device Did Disconnect" does not work


Describe the bug
I created an automation to put the computer to sleep 10 seconds after the Logitech MX Ergo trackball is turned off. Unfortunately, for some reason BTT does not see that the device is disconnected. Surely this is not the script's fault, because the script itself works, and replacing the script with another action does not trigger it either. I tried setting the trigger with both the name and MAC address - it didn't help.

Edit: It doesn’t work with any Bluetooth device. I checked with Logitech MX Ergo and Microsoft Number Pad.


Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):


Screenshots
If applicable, add screenshots to help explain your problem. (You can just paste or drag them here)


Device information:

  • Type of Mac: MacBook Pro M2 Pro
  • macOS version: 14.3.1 (23D60) - also did not work on 14.2
  • BetterTouchTool version: 4.427

Additional information (e.g. crash logs, related issues, etc.):

Ia this really connected over bluetooth, or is it connected via the Logitech unifying receiver?

Over Bluetooth.
I'm updating because it doesn’t work with any Bluetooth device.

do the connect triggers work for you? Could you post a screenshot of the configuration?

Sadly, no.
Here are a JSON and screenshot of my config.

[
  {
    "BTTLastUpdatedAt" : 1709840513.0501111,
    "BTTTriggerType" : 788,
    "BTTTriggerTypeDescription" : "Bluetooth Device Did Disconnect: Address: D9:5E:A9:F2:0A:52, ",
    "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
    "BTTUUID" : "35568D97-4444-4FAF-96B1-52B4D3BF71B2",
    "BTTPredefinedActionType" : 366,
    "BTTPredefinedActionName" : "Empty Placeholder",
    "BTTAdditionalConfiguration" : "",
    "BTTEnabled" : 1,
    "BTTEnabled2" : 1,
    "BTTOrder" : 11,
    "BTTAdditionalActions" : [
      {
        "BTTLastUpdatedAt" : 1709990748.7333789,
        "BTTTriggerType" : -1,
        "BTTTriggerParentUUID" : "35568D97-4444-4FAF-96B1-52B4D3BF71B2",
        "BTTIsPureAction" : true,
        "BTTTriggerClass" : "BTTTriggerTypeOtherTriggers",
        "BTTUUID" : "F3669C5E-7681-42AD-9CC8-199E3E03D1DF",
        "BTTPredefinedActionType" : 172,
        "BTTPredefinedActionName" : "Run Apple Script (blocking)",
        "BTTAdditionalActionData" : {
          "BTTScriptType" : 0,
          "BTTAppleScriptRunInBackground" : false,
          "BTTTouchBarAppleScriptString" : "set dialogResult to display dialog \"Wyłączono MX Ergo. Komputer wkrótce przejdzie w stan uśpienia.\" buttons {\"Anuluj\", \"Uśpij teraz\"} default button 2 giving up after 10 with icon caution\r\rif gave up of dialogResult then\r\ttell application \"System Events\" to sleep\relse if button returned of dialogResult is \"Anuluj\" then\r\treturn\relse\r\ttell application \"System Events\" to sleep\rend if\r",
          "BTTTouchBarAppleScriptUsePath" : false
        },
        "BTTInlineAppleScript" : "set dialogResult to display dialog \"Wyłączono MX Ergo. Komputer wkrótce przejdzie w stan uśpienia.\" buttons {\"Anuluj\", \"Uśpij teraz\"} default button 2 giving up after 10 with icon caution\r\rif gave up of dialogResult then\r\ttell application \"System Events\" to sleep\relse if button returned of dialogResult is \"Anuluj\" then\r\treturn\relse\r\ttell application \"System Events\" to sleep\rend if\r",
        "BTTEnabled" : 1,
        "BTTEnabled2" : 1,
        "BTTOrder" : 3
      }
    ]
  }
]

Could you check whether BTT got the bluetooth permissions in System Settings => Security & Privacy?

(it should ask, but if it has asked in the past it won't do it again)

Yes, it has

weird. Could you check whether in the newest BTT log in ~/Library/Application Support/BetterTouchTool/Logs" you find entries that begin with "connected bt name" or "disconnected bt name" ?

so it seems to see the device, but it has a different address: DA:3B:7C:2C:95:DC (- or : doesn't matter)

Now I see and you are right, while earlier I used the information that is written out in the System Report. Today, this device has a different address, and I guess that's not possible. This is weird

Mhh, maybe macOS changes or randomizes these addresses. In that case I need to look for another solution.

I changed to detection by name, but it still does not work

I have the same issue:
Environment:

  • MBP M1 Pro with Sonoma 14.4. (also didn't work with 14.3.1)

I want an automation that switches the source of my displays as soon as I switch my Logitech MX Master 3S or MX Keyboard to another PC. Both are connected via Blueetooth to my Mac (not via the BOLT dongle).
The MX Master 3S (as well as the keyboard) has 3 preset buttons on the bottom to switch between different PCs. When I press that button, the BT connection gets disconnected, what is also shown in the BT settings of macOS.
But unfortunately the disconnection does not trigger an action.

In the example a HUD message should be displayed when the mouse is disconnected.

The same issue is also when I try to trigger an action when a device is connected.

SCR-20240309-nsha

Try to remove the vendor id & product id, it seems kind of random whether they are made available to BTT or not. Matching for only the address should be the best option. I did some reading on this topic and it looks like the address should never change. (I have been testing it mostly with the MX Master 3)

I'll be testing with some other devices tomorrow.

In your case the logs also don't seem to contain any disconnected messages, right? Only the connect events seem to trigger.

Is BTT already launched when the device is connected? (It registers the disconnect event once a device connects, in the next alpha I'll add an additional disconnect event registration when BTT starts)

I removed vendor and product ID, but didn't work.

and your MX Master is also connected via bluetooth and not via the logitech unifying receiver?

Yes, but that shouldn't matter. I removed the dongle, so both devices are connected via BT.

4.437 alpha adds the disconnect initialization on BTT launch, maybe that helps in some cases