Trying to understand Bluetooth "Intent Received" etc

countallloss38

New member
Hey Guys,

I'm trying to understand how to interact with Bluetooth devices on Macrodroid. There are several macros out there that display or even speak bluetooth device battery level. That is very cool, but I would like to try to make some variations on that theme and frankly, I don't understand *at all* how intent received works.

For example, several of the macros seem to use the android.bluetooth.device.action.BATTERY_LEVEL_CHANGED. That is great, but I wonder what other possibilities there are. For example, is there a way to read battery level at times other than when the level has changed? What other triggers are available?

Here is what I'd like to do. I suspect my bluetooth earbuds are not holding a charge as long as they used to. So, what I'd like to do is log how long they are connected, how long they're connected and playing audio etc. However, I don't seem to be able to get this info. Any insight folks could give on this would be greatly appreciated!
 
Last edited:

Endercraft

Well-known member
Here is what I'd like to do. I suspect my bluetooth earbuds are not holding a charge as long as they used to. So, what I'd like to do is log how long they are connected, how long they're connected and playing audio etc. However, I don't seem to be able to get this info. Any insight folks could give on this would be greatly appreciated!
Enter_macro_name_.png
 

countallloss38

New member
Thanks Endercraft!

This definitely makes sense. However, it doesn't quite do what I'm looking for, because I'd also like to record the bluetooth battery level at the beginning and end. It is true that, as I think about it, that might not strictly be necessary, especially considering the fact that my bluetooth devices don't report a very granular battery level to begin with. I could simply make a log post upon connecting and disconnecting listing connected time and play time. Maybe I even make a log post whenever battery level changes as well. Thanks for the input!
 

Endercraft

Well-known member
Thanks Endercraft!

This definitely makes sense. However, it doesn't quite do what I'm looking for, because I'd also like to record the bluetooth battery level at the beginning and end. It is true that, as I think about it, that might not strictly be necessary, especially considering the fact that my bluetooth devices don't report a very granular battery level to begin with. I could simply make a log post upon connecting and disconnecting listing connected time and play time. Maybe I even make a log post whenever battery level changes as well. Thanks for the input!
I never tested these Bluetooth intents, but from what I have read, you can only get the battery level with an intent (you can't really get it at any time unless you save to a variable everytime the battery changes).
 

countallloss38

New member
I never tested these Bluetooth intents, but from what I have read, you can only get the battery level with an intent (you can't really get it at any time unless you save to a variable everytime the battery changes).
Got it. That is a bummer, but it is what it is. Of course, I usually disconnect my earbud when it starts to tell me its level is low anyway, so again, maybe these logs are all I need. Thanks for your help!
 
Top