Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Any way to display the battery status of my bluetooth devices?

May
397
4
Hi ,

I'm looking for a way to display the battery status of my bluetooth devices. I see no obvious candidate among the bluetooth functions or BTMonitor. Any tips?
 
BTW. when I do a echo %@btradioclass[0], I get this dialogue:
IPWorks-Bluetooth-2020-Beta.jpg



Something issue at my end?
 
Somewhere Windows has that information. It is shown in the Bluetooth Device panel in my tray under Show Bluetooth Network Devices. Any Idea what's the relevant function library?
 
A search on GitHub returned a couple of interest...



Joe
 
Here is a Powershell Script that says it will show Bluetooth Device Battery Level...


Joe
 
This Powershell Script shows me the battery remaining on my Bluetooth speaker...
Code:
Get-PnpDevice -FriendlyName "*Tribit XSound Go*" | ForEach-Object {
    $local:test = $_ |
    Get-PnpDeviceProperty -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' |
        Where Type -ne Empty;
    if ($test) {
        "To query battery for $($_.FriendlyName), run the following:"
        "    Get-PnpDeviceProperty -InstanceId '$($test.InstanceId)' -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | % Data"
        ""
        "The result will look like this:";
        Get-PnpDeviceProperty -InstanceId $($test.InstanceId) -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | % Data
    }
}

After running...
Code:
R:\>pshell r:\test.ps1
To query battery for Tribit XSound Go Hands-Free AG, run the following:
    Get-PnpDeviceProperty -InstanceId 'BTHENUM\{0000111E-0000-1000-8000-00805F9B34FB}_LOCALMFG&000F\8&495D9F9&0&F44EFD00C255_C00000000' -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | % Data

The result will look like this:
80

It returns the same result as the Windows 10 GUI...
1709050183755.png


Joe

Ref: How to get Bluetooth device battery percentage using PowerShell on windows?
 
Last edited:
I've found a working powershell command (all 1 line):

Get-PnpDevice -FriendlyName 'cherry' | Select-Object Class,FriendlyName,@{L="Battery";E={(Get-PnpDeviceProperty -DeviceID $_.PNPDeviceID -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2').Data}}

You'll have to know the "FriendlyName" of your BT device. When in doubt, try the manufacterer. It would ne nice to have that available in TCMD, too.
 
This worked for me under TCC:

1710493363427.png


Code:
Get-PnpDevice -Class 'Bluetooth' | ForEach-Object {
    $local:test = $_ |
    Get-PnpDeviceProperty -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' |
        Where Type -ne Empty;
    if ($test) {
        "Battery percentage of $($_.FriendlyName) is: ";
        Get-PnpDeviceProperty -InstanceId $($test.InstanceId) -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | % Data
    }
}
 

Similar threads

Back
Top