A Python script to control this bluetooth LED light strip.
Tested with: Python 3.9 on Windows and Mac OS
- bleak (https://github.com/hbldh/bleak) for bluetooth communication with the LED strip
- MSS (https://github.com/BoboTiG/python-mss) for screen capture
- Pillow (https://python-pillow.org/) for image processing
- colour (https://github.com/vaab/colour) for color manipulations
To discover the bluetooth address of the LED light strip, run:
python scanner.py
which will list the address and name of nearby devices.
To control the device, run:
python control.py --address ADDRESS [--demo] [--interval INTERVAL]
where:
--address ADDRESS
,-a ADDRESS
: bluetooth mac address of light strip--demo
,-d
: use in demo mode (cyclic rainbow)--interval INTERVAL
,-i INTERVAL
: color update interval (secs)
If --demo
is not set, the script will capture the dominant screen color of the machine in which the script is being
invoked, and set that color to the light strip at the provided fixed time interval.
I followed the instructions on this post to discover the BLE control characteristics of the light strip by using the official Android app and then checking the BLE communication logs via Wireshark.