Bluetooth Device Disconnected Trigger not working?

Post your questions and help other users.

Moderator: Martin

Post Reply
Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Bluetooth Device Disconnected Trigger not working?

Post by Econdoc » 01 Jun 2019 17:43

I have paired two different devices with Bluetooth. A "Bluetooth Device Disconnected" trigger is set for each. Neither trigger fires when Bluetooth is turned off. What am I doing wrong?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Bluetooth Device Disconnected Trigger not working?

Post by Desmanto » 01 Jun 2019 19:31

Does it work with Bluetooth Device Connected? Try to use option All devices, and see if it works. Try to make sure the phone is not in airplane mode and enable the location service (at least network mode/battery saving mode).
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Bluetooth Device Disconnected Trigger not working?

Post by Econdoc » 01 Jun 2019 20:39

Here is my full report:
Location is on, airplane is off.
Bluetooth Device Disconnected Trigger does not work with either specific device or all devices when Bluetooth is disabled from quick tiles. It does not work when Bluetooth state is disabled with "Set Bluetooth State:Off" in Automagic.

Bluetooth Device Connected Trigger works fine.

Is this my phone (OnePlus6t), my OS (OxygenOS 9), or Automagic?

Thanks

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Bluetooth Device Disconnected Trigger not working?

Post by Desmanto » 02 Jun 2019 15:55

So the bluetooth disconnected trigger only works when you disconnect the bluetooth devices manually from the bluetooth setting, but not when switching off bluetooth. At mine, it is working fine for both, either manual disconnection or turning off bluetooth. My device is RN5 whyred (shown at my signature).

This is probably the OxygenOS. As I am using RR 7.0.2 Pie 9.0, AM 1.37 and it is working fine. Or maybe by any chance, are you using AM 1.38 EAP version?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Bluetooth Device Disconnected Trigger not working?

Post by Econdoc » 05 Jun 2019 11:02

Yes, you have it right. If I power off the device the trigger responds, otherwise not. I am not using EAP. I will find a a work-around. Seems like I do a lot of that! :?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Bluetooth Device Disconnected Trigger not working?

Post by Desmanto » 05 Jun 2019 14:36

Maybe you can save the state of the connected bluetooth devices to glovar when connected, as bluetooth connected trigger works fine. You can add another trigger bluetooth state off, then check for this glovar using expression. If it has the name of the bluetooth device, execute your main flow (that you want if the bluetooth device is disconnected). Empty the glovar afterward (to denotes it has been disconnected). At another time, if you don't have any connected device, glovar will be empty. So even if you turn off bluetooth, it won't execute the main flow, as the glovar is empty.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply