Skip to content

Python script using gatttool to wirelessly controll (turn ON/OFF) UE boom bluetooth speaker and getting its current battery level

Notifications You must be signed in to change notification settings

Felix-Pi/UE_BOOM_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

UE_BOOM_controller

Python script for controlling (turn ON/OFF) ue boom speaker and getting its current battery level

Tested on ue boom version 1

Prerequisites

gatttool

Usefull links:

Usage

boom = Boom('DEVICE_MAC', 'CLIENT_MAC')
#DEVICE_MAC: speakers MAC address, format: XX:XX:XX:XX:XX:XX
#CLIENT_MAC: MAC address of a device that already has been connected to the speaker, format: XX:XX:XX:XX:XX:XX

boom.on() #turns speaker on

boom.off() #turn speaker off

battery_level = boom.get_battery() #returns speakers battery level

Gatttool usage


Usage: sudo gatttool [OPTIONS]

Paramater:
  SPEAKER_MAC    speakers mac address, format: XX:XX:XX:XX:XX:XX
  CLIENT_MAC     mac address of a client that has already been connected to speaker,
                 format: XXXXXXXXXXXX
  
Commands:  
  on
    sudo gatttool -i hci0 -b SPEAKER_MAC --char-write-req -a 0x0003 -n CLIENT_MAC01
 
  off
    sudo gatttool -i hci0 -b SPEAKER_MAC --char-write-req -a 0x0003 -n CLIENT_MAC02
    
  battery_level
    sudo gatttool -i hci0 -b SPEAKER_MAC --char-read --uuid 0x2a19
  

Credits

  • Source of gatttool commands (reddit)

About

Python script using gatttool to wirelessly controll (turn ON/OFF) UE boom bluetooth speaker and getting its current battery level

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages