Intent - battery percentage of a bluetooth device

paps93fr

New member
MD Intent wiki documentation said there is an intent when the battery percentage of a bluetooth device changes. But it doesn't say more.

What is that intent? And, is it possible to get the device battery percentage too, not only the information it have changed?

I've an installed app named BatOn which do that for me but I need to trigger for its notifications. It will be more efficient to get that information directly with an intent in MD.
 

Endercraft

Moderator (& bug finder :D)
 

AMG47

New member
Doing exactly this has been my project off and on for a while. The LACK of info on this amazes me. I found very little and had to experiment, reverse engineer and damage my brain but I have something that seems to work fairly well. Try starting with this trigger.

When BT device connects or changes, battery level goes in strBatteryLevel. When BT turns off, strBatteryLevel is -1.
BT_Device_MAC holds the address of the device so you can ID WHICH device is triggering. I use a lookup routine to turn that into a description such as "Earbuds" or "Headset 1".

MacroDroid BT Intent 1.jpg
 

paps93fr

New member
Doing exactly this has been my project off and on for a while. The LACK of info on this amazes me. I found very little and had to experiment, reverse engineer and damage my brain but I have something that seems to work fairly well. Try starting with this trigger.

When BT device connects or changes, battery level goes in strBatteryLevel. When BT turns off, strBatteryLevel is -1.
BT_Device_MAC holds the address of the device so you can ID WHICH device is triggering. I use a lookup routine to turn that into a description such as "Earbuds" or "Headset 1".

View attachment 7725
Thanks ! I'll try it soon.
 
Top