topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 25, 2024, 10:42 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: [REQUEST] Program that shows the battery life of connected Bluetooth devices  (Read 7598 times)

Zero3K

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 300
    • View Profile
    • Donate to Member
It would be nice if someone could make a program that shows the battery life of connected Bluetooth devices like how https://github.com/M...oothLEBatteryMonitor does so (but made in Delphi/C++ and able to show the battery life of Bluetooth devices along with Bluetooth Low Energy devices).

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Windows already does this, for all supported devices. (older BT devices don't support this feature)

Go to Settings/Devices and you should see a list that looks something like this:

Screenshot - 8_6_2023 , 4_42_47 PM.png[REQUEST] Program that shows the battery life of connected Bluetooth devices

If you don't see your device in the list, it hasn't been paired with your PC.
If you see it in the list but no battery indicator, then your device doesn't support it, and no 3rd party program will make it support it. (it most likely is using an older version of BT)




Zero3K

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 300
    • View Profile
    • Donate to Member
I want a program that sits in the system tray and provides a pop-up/regular window which shows the device(s) that are connected and their power level.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
This may be useful for you, to write your own. (or maybe not)

https://learn.micros...ator-display-in-syst

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,643
    • View Profile
    • Donate to Member
To expand on it a little:

Code: PowerShell [Select]
  1. # BLEPower.ps1
  2. # Credit to:
  3. # https://stackoverflow.com/questions/71736070/how-to-get-bluetooth-device-battery-percentage-using-powershell-on-windows
  4.  
  5. Get-PnpDevice -FriendlyName "*" | Where-Object { $_.InstanceId -match 'BTH' } | ForEach-Object {
  6.   $local:test = $_ | Get-PnpDeviceProperty -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | Where-Object Type -ne Empty;
  7.     if ($test) {
  8.       "$($_.FriendlyName): $(Get-PnpDeviceProperty -InstanceId $($test.InstanceId) -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2' | ForEach-Object Data)%"
  9.     }
  10. }

NOTE: Apostrophes (') have been turned into ' above.

Code: Text [Select]
  1. PS T:\> .\BLEPower.ps1
  2. Basilisk X HyperSpeed: 15%
  3. Air-Fi Touch Hands-Free AG: 100%
  4. MI Portable Bluetooth Speaker Hands-Free AG: 90%
  5. QCY-Q26 Hands-Free AG: 100%
  6. PS T:\>

Note:
 - some peripherals don't report battery usage correctly, eg. the MI Portable Bluetooth Speaker Hands-Free AG above always reports 90%,
 - you need to check the device is connected since Windows retains the battery levels even when devices are disconnected, (see here: StackOverflow).

Zero3K

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 300
    • View Profile
    • Donate to Member
I want it to be like the one at https://www.bluetoothgoodies.com/ but in Delphi/C++.

KodeZwerg

  • Honorary Member
  • Joined in 2018
  • **
  • Posts: 718
    • View Profile
    • Donate to Member
I want it to be like the one at https://www.bluetoothgoodies.com/ but in Delphi/C++.
Are you asking for a program, as stated in your first post (written in Delphi or C++), or do you ask for programs source code, since a program you have found already.

Zero3K

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 300
    • View Profile
    • Donate to Member
I am asking for a program.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,643
    • View Profile
    • Donate to Member
I am asking for a program.

Given the following on the site you refer to:
Many devices that uses vendor-specific protocols are also supported.

Unless you expect someone to spend their time snooping Bluetooth protocols between various vendor devices, anything other than what can be reported by the Windows API, (and any BT devices a prospective coder might have), isn't likely to happen.

Zero3K

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 300
    • View Profile
    • Donate to Member
I just want a generic one.