Control generic MELK-* Bluetooth LED strip controllers (ELK-BLEDOM family, the ones sold with the Lotus Lamp X / duoCo Strip apps) from Linux: a command-line tool, a Tkinter GUI, and music sync to whatever the PC is playing.
Tested with a MELK-OC21W controller (incl. its built-in microphone).
Developed and tested on Linux (BlueZ, PipeWire); the CLI and GUI may work on Windows/macOS via bleak, untested.
- Linux with BlueZ, Python 3.10+ (
sudo apt install python3-venv) - GUI:
sudo apt install python3-tk - Music sync: PipeWire (
pw-record, frompipewire-bin) - Python deps (bleak) are installed by
install.sh
./install.sh # or: ./install.sh --address AA:BB:CC:DD:EE:FFInstalls for the current user only, no root needed:
- the app and a Python venv in
~/.local/share/melk-ble/ melkandmelk-guicommands in~/.local/bin/- a MELK LED Controller entry in the desktop application menu
The last controller that connected is remembered in ~/.config/melk-ble/config.json, and
both the GUI and melk reconnect to it automatically. --address sets it up front.
Re-run after git pull to update; ./install.sh --uninstall removes everything
(settings are kept). Without installing, run ./melk.py / ./melk_gui.py directly after
pip install -r requirements.txt.
Like most generic BLE peripherals, the controller most likely accepts only one Bluetooth connection at a time and stops advertising while connected (not verified on every model). If it can't be found, make sure no phone app or other program is connected to it. The physical remote is unaffected: it uses IR/RF, not Bluetooth.
# device: -a ADDR, else $MELK_ADDRESS, else the last connected one, else first MELK*/ELK-* found
melk scan # find the controller
melk on | off
melk color ff8800 # or: color 255 136 0
melk brightness 40 # 0-100
melk white 100 # controller's white (same as the remote's White button)
melk ct 2700 # colour temperature, 1800-7000 K
melk effects [filter] # list the 220 built-in effects
melk effect fire_3 # by name or number
melk speed 70
melk music beat # sync to PC audio: spectrum | pulse | beat | rainbow
melk timer on 07:30 weekdays
melk timer off 23:00 all
melk shell # interactive, keeps the connection open
melk -h # everything else (sync-time, mic, raw, info, ...)melk-gui [-a AA:BB:CC:DD:EE:FF] # or from the application menuTabs: Light (power, white, colour presets/picker/RGB, brightness, white level, colour temperature), Effects (simple view with ▼/▲ per effect family, or the full filterable list; speed), Music (PC audio sync with live meter; controller mic), Timers.
- Write characteristic
FFF3(serviceFFF0), write-without-response; 9-byte frames7E … EF.FFF4notifies but this firmware does not report state. - MELK units need a "login" after connecting:
7E 07 83then7E 04 04. - Command bytes follow the
MELK-OA21profile of elkbledom.
| Function | Frame |
|---|---|
| on / off | 7e 04 04 f0 00 01 ff 00 ef / 7e 04 04 00 00 00 ff 00 ef |
| colour | 7e 00 05 03 RR GG BB 00 ef |
| brightness | 7e 04 01 PP 01 ff ff 00 ef |
| white | 7e 07 05 01 PP ff 02 01 ef |
colour temp (native; on single-white strips it just shows white, so ct emulates it with RGB) |
7e 06 05 02 WW CC ff 08 ef |
| effect | 7e 05 03 NN 06 ff ff 00 ef |
| speed | 7e 04 02 PP ff ff ff 00 ef |
| clock | 7e 00 83 hh mm ss DOW 00 ef |
| timer | 7e 00 82 hh mm 00 (00 on / 01 off) (days|0x80 enabled) ef |
MIT, see LICENSE. Protocol details and effect tables are derived from elkbledom (MIT).