BT battery level

Mike9761

New member
Hi, if I have my watch connected, ear buds and SPen all BT.
How do I get the BT Device name and battery level for each to monitor the battery level for each.
Thanks
 

MacroDroidDev

Administrator
Staff member
Sorry it's not possible to monitor Bluetooth device battery level with MacroDroid directly. There may be some plugin that can do this but I am not aware of any.
 

Yogi

Member
Hi, if I have my watch connected, ear buds and SPen all BT.
How do I get the BT Device name and battery level for each to monitor the battery level for each.
Thanks
There could be the chance to use a broadcast trigger "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED"
I got it working with the app Automate (I use also for macros) "Broadcast Receive" and the outputvariable under extras shows
the battery level or -1 if disconnected.

But I didn't get it working with MDs Trigger "Intent Received"
Could someone of the Android Profis jump in and help?

This is a part of the Automate Forum:
Simply set the Action field to "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED",
assign a name to the Extras output variables, e.g. extras
The battery level value should then accessible as extras["android.bluetooth.device.extra.BATTERY_LEVEL"]
For me this works with my earbuds, connecting to BT it triggers the "Broadcast Recceive" and gives the current value of the battery level.
Then after some time it gives an trigger if the battery level falls down to 90 or 80 or.... 10% or is disconnected (-1)

Afaik the trigger sends on his "own", so not possible to send and get the actual level.
But this trick should be enough for most purposes.

Also my ear buds show the battery level below "bluetooth on" tile where you can toggle BT
maybe there is the chance to get it from there.

Anyway no idea for multiple devices...
Hope it helps,
Regards,
Fritz
 
Last edited:

Endercraft

Moderator (& bug finder :D)
There could be the chance to use a broadcast trigger "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED"
I got it working with the app Automate (I use also for macros) "Broadcast Receive" and the outputvariable under extras shows
the battery level or -1 if disconnected.

But I didn't get it working with MDs Trigger "Intent Received"
Could someone of the Android Profis jump in and help?

This is a part of the Automate Forum:

For me this works with my earbuds, connecting to BT it triggers the "Broadcast Recceive" and gives the current value of the battery level.
Then after some time it gives an trigger if the battery level falls down to 90 or 80 or.... 10% or is disconnected (-1)

Afaik the trigger sends on his "own", so not possible to send and get the actual level.
But this trick should be enough for most purposes.

Also my ear buds show the battery level below "bluetooth on" tile where you can toggle BT
maybe there is the chance to get it from there.

Anyway no idea for multiple devices...
Hope it helps,
Regards,
Fritz
 

Yogi

Member
Thanks, got it working, also the answer for the name of the id of the BT device (create manually a dictionary)
 

Yogi

Member
Please share the working macro details 🙏🏻
Just for test purpose....
You have to create dictionary variable BT with Bluetooth ID as key and a description as value to get this test running.
Hope it helps
 

Attachments

  • BT_test.macro
    3.9 KB · Views: 6
Top