Skip to content
achevaletPublic

About

Control generic MELK-* (ELK-BLEDOM) Bluetooth LED strip controllers from Linux: CLI, GUI, music sync, timers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

melk-ble

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.

Requirements

  • Linux with BlueZ, Python 3.10+ (sudo apt install python3-venv)
  • GUI: sudo apt install python3-tk
  • Music sync: PipeWire (pw-record, from pipewire-bin)
  • Python deps (bleak) are installed by install.sh

Install

./install.sh                                  # or: ./install.sh --address AA:BB:CC:DD:EE:FF

Installs for the current user only, no root needed:

  • the app and a Python venv in ~/.local/share/melk-ble/
  • melk and melk-gui commands 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.

Command line

# 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, ...)

GUI

melk-gui [-a AA:BB:CC:DD:EE:FF]    # or from the application menu

Tabs: 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.

Protocol notes

  • Write characteristic FFF3 (service FFF0), write-without-response; 9-byte frames 7E … EF. FFF4 notifies but this firmware does not report state.
  • MELK units need a "login" after connecting: 7E 07 83 then 7E 04 04.
  • Command bytes follow the MELK-OA21 profile 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

License

MIT, see LICENSE. Protocol details and effect tables are derived from elkbledom (MIT).

About

Control generic MELK-* (ELK-BLEDOM) Bluetooth LED strip controllers from Linux: CLI, GUI, music sync, timers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages