Oral-B BLUETOOTH CONNECTED TOOTHBRUSH

RE: Battery Level

does
gatttool -b {$mac} --char-read --uuid=0x2A19 -t public
or
gatttool -b {$mac} --char-read --uuid=0x2A19 -t random
return a HEX value (replace {$mac} with the MAC Address? Is so that’s reading the bluetooth battery level (I use this for my BLE Bike light, Smart Watch, and other bike sensors)

I have a bit of a convoluted setup of Home Assistant doing the following:-

  • The Bluetooth LE Device Tracker detects the device comes into range
  • This runs a REST command when the BLE device comes into range calling a webpage on my PiHole server
  • This writes a flag file to disk
  • Every 60 seconds a cron task looks for these flag files and if one exists runs the gattool command (public version and if that fails random - it’s a mixed bag as to which works)
  • The output of this command is written to a JSON file
  • This also calls http://hassip:8123/api/states/sensor.{$sensor} to update Home Assistant.
  • Another cron runs every 10 minutes resubmitting the data from the JSON Files to Home Assistant (so you don’t have to wait for the device to be used again when HASS restarts - they appear within 10 minutes)

It’s convoluted as I needed to use a Bluetooth Adapter which isn’t already in use for presence detection so it uses the Bluetooth Adapter on my UniFi Controlled / Pi Hole Machine. All the devices I have keep the BLE Active for 10 minutes so this works fine for me.

Coupled with a few other ways of gathering battery level gives a centralised display of battery levels https://i.imgur.com/GoEdK9n.png