Notification when Bluetooth Battery is low

nuentes

New member
When I connect to my headphones via bluetooth, the OS reports the battery percentage under the Bluetooth settings. I literally always forget to check this manually, and so I end up running my headphones battery until empty, ruining the walk that I'm on. I'd like a simple notification on my phone when my battery reports below 50% so that I remember to recharge them.

There was a similar request regarding Tasker, and someone provided the Intent that provides this info.

This was also a Macrodroid feature request previously, but it appears this could simply be done with an intent, rather than added as a feature. However, I'm not sure how to do that, and I've never messed with Intents before. Would anybody be able to help me make a macro for this?
 

FrameXX

Well-known member
You can try BlueTask plugin. It has option to get bluetooth device battery into variable. It never worked for me. But maybe it will for you.

About that intent it would propably look like this. But i am not sure with that extra name.

I actually don't how that extra intent trigger work. I have also problems with receiving intents with extras from some of my app.

Need the field with "extra value to match" be filled with something?
Anyone help?
Screenshot_20210303-192756.png
 
Last edited:

nuentes

New member
It looks like Bluetask actually works for me. I had to put in some delays, but I ran a successful test, and it did indeed put the correct value in the variable. Unfortunately, the variable is formatted as a string rather than an integer, so it's a plaintext "70", so I can't run perform basic math checks on it. But luckily my headphones report only in 10% increments, so I just made a rule for if the battery is "10" or "20" or "30" or "40" or "50", then notify me. Looks like this will do the trick. Thanks a bunch!
 
Last edited:

FrameXX

Well-known member
It looks like Bluetask actually works for me. I had to put in some delays, but I ran a successful test, and it did indeed put the correct value in the variable. Unfortunately, the variable is formatted as a string rather than an integer, so it's a plaintext "70", so I can't run perform basic math checks on it. But luckily my headphones report only in 10% increments, so I just made a rule for if the battery is "10" or "20" or "30" or "40" or "50", then notify me. Looks like this will do the trick. Thanks a bunch!

You can (✿◠‿◠).
Check my issue. I also thought I can't.
 

MacroDroidDev

Administrator
Staff member
You can set a string variable into an integer.

Use the Set Variable action for an integer variable hit the ... button on expression and use the string variable value option.
 

chaoscreater

Active member
It looks like Bluetask actually works for me. I had to put in some delays, but I ran a successful test, and it did indeed put the correct value in the variable. Unfortunately, the variable is formatted as a string rather than an integer, so it's a plaintext "70", so I can't run perform basic math checks on it. But luckily my headphones report only in 10% increments, so I just made a rule for if the battery is "10" or "20" or "30" or "40" or "50", then notify me. Looks like this will do the trick. Thanks a bunch!

Do you mind sharing your macro/template?
 

chaoscreater

Active member
Actually, nevermind, I got this working using the Android intent. Credit goes to dont_turtle for this, thread found here:

I have uploaded my template to the community. You can just download it and edit. I encourage more people to do this, as it is much easier than to look at screenshots and texts and try to replicate them.
 
Top