Skip to Content
CLI

CLI — yeelight-cli

A terminal tool for controlling Yeelight devices. Install globally:

npm install -g yeelight-cli

Discovery

ylc discover # SSDP multicast — lists all devices on the LAN ylc scan # TCP subnet scan — finds devices without SSDP

discover uses UDP SSDP multicast and is instant (~3s timeout). scan probes all 254 hosts on your /24 subnet over TCP — use it when SSDP is blocked on the network.


Status

ylc status # auto-discover + show state ylc status --ip 192.168.0.27 ylc status --ip 192.168.0.27 --raw # dump all raw get_prop values ylc status --ip 192.168.0.27 --commands # show device support list (SSDP only)

Control commands

All control commands accept --ip <address>. Without --ip, the device is auto-discovered via SSDP.

ylc power on ylc power off --ip 192.168.0.27 ylc brightness 50 ylc br 75 # alias ylc ct 4000 # color temperature in Kelvin (1700–6500) ylc color "#ff6400" # hex ylc color 255 100 0 # r g b ylc toggle # toggle main + background at once ylc segment "#ff0000" "#0000ff" # left / right strip colors (lamp15 only) ylc name "Desk Light" # set device name ylc timer set 30 # auto power-off in 30 minutes ylc timer status ylc timer cancel ylc adjust brightness 20 # relative adjust ylc adjust ct -10 ylc adjust color

Background channel

Append --bg to target the background channel on dual-zone devices:

ylc brightness 40 --bg ylc ct 3000 --bg ylc color "#0088ff" --bg ylc power off --bg

Transitions

--duration <ms> sets a smooth transition time (default: 0, immediate):

ylc brightness 30 --duration 1000 ylc ct 2700 --duration 2000 --bg

Interactive mode

Full TUI for live device control — pick a device and adjust all properties interactively.

ylc interactive ylc i # alias ylc interactive --scan tcp # use TCP scan instead of SSDP ylc interactive --ip 192.168.0.27 # skip discovery, connect directly ylc interactive --debug # log tx/rx frames to debug.log

Keyboard shortcuts inside interactive mode:

KeyAction
/ Navigate
EnterSelect / confirm
Esc / BackspaceBack
qQuit

Global options

FlagDefaultDescription
--ip <address>autoDevice IP — skip auto-discovery
--bgoffTarget background channel
--duration <ms>0Transition duration
--timeout <ms>3000SSDP discovery timeout
--scan <ssdp|tcp>ssdpDiscovery method (interactive only)
--debugoffLog tx/rx frames (interactive only)
--rawoffDump raw props (status only)
--commandsoffShow support list (status only)
-h, --helpShow help
-V, --versionShow version

Run ylc <command> --help for command-specific options.

Last updated on