Skip to Content
Commands Reference

Command Reference

TCP command methods for Yeelight devices. See Protocol for transport framing, discovery, and flow animation format.


Main Channel

Available on all devices.

MethodParametersDescription
set_power"on"|"off", "smooth"|"sudden", msPower on/off
set_bright1-100, "smooth"|"sudden", msBrightness
set_ct_abxkelvin(2700-6500), "smooth"|"sudden", msColor temperature
set_rgbrgb_int, "smooth"|"sudden", msRGB color
set_hsvhue(0-359), sat(0-100), "smooth"|"sudden", msColor via HSV
start_cf / stop_cfsee Flow AnimationsAnimations
toggleToggle power
set_defaultSave as default

set_rgb and set_hsv are only available on devices that report them in the SSDP support field.


Background Channel (bg_*)

Only on devices with a background channel (report bg_set_power in support).

MethodParametersDescription
bg_set_power"on"|"off", "smooth"|"sudden", msPower on/off
bg_toggleToggle
bg_set_bright1-100, "smooth"|"sudden", msBrightness
bg_set_rgbrgb_int, "smooth"|"sudden", msBoth sides same color, resets segment state
bg_set_hsvhue(0-359), sat(0-100), "smooth"|"sudden", msColor via HSV
bg_set_ct_abxkelvin(1700-6500), "smooth"|"sudden", msColor temperature
bg_start_cfcount, action, flow_expressionStart animation
bg_stop_cfStop animation
bg_set_defaultSave as default

dev_toggle — toggles both main and background channels simultaneously.


Segment Control lamp15 / YLTD003 only

These commands are unique to the lamp15 model (YLTD003). No other Yeelight device reports set_segment_rgb in its support field.

All data on this section was determined empirically — the official spec does not document segment control.

The lamp has three independent control surfaces:

#ZoneTypeCommands
1Front light (screen bias)CT, no RGBset_power, set_bright, set_ct_abx
2Rear strip — both sides at onceRGB + CTbg_set_rgb, bg_set_power, bg_set_bright
3Rear strip — left and right sidesRGB + CTset_segment_rgb

set_segment_rgb

set_segment_rgb(left_rgb, right_rgb)
  • left_rgb, right_rgb = r * 65536 + g * 256 + b
  • Brightness is controlled by bg_set_bright, not by RGB magnitude
  • RGB magnitude is ignored — only hue/saturation matter
  • rgb(1,0,0) and rgb(255,0,0) produce identically bright red
  • 0x000000 produces undefined behavior — avoid it
  • Calling bg_set_rgb afterward overrides and resets per-side state

Properties (get_prop)

{ "id": 1, "method": "get_prop", "params": ["power", "bright", "ct", "bg_power", "bg_rgb", "bg_bright"] }
PropertyDescription
powerFront light: "on" / "off"
brightFront light brightness (1–100)
ctFront light color temp (Kelvin, not RGB)
flowing"1" if animation active
bg_powerRear strip: "on" / "off"
bg_brightRear strip brightness (1–100)
bg_rgbRear strip color as rgb_int
bg_ctRear strip CT (Kelvin, not RGB)
bg_color_mode"1"=RGB, "2"=CT, "3"=HSV
bg_flowing"1" if rear animation active
active_mode"0"=normal, "1"=night light
nameDevice name

ct and bg_ct are Kelvin values — do not treat as RGB integers.


Utilities

MethodParametersDescription
set_name"name"Rename device
cron_add0, minutesAuto-off timer
cron_get0Read timer
cron_del0Delete timer

Supported Methods

The full list of 34 methods reported by get_prop is available in python-miio specs.yaml . Notable absence: set_music — TCP music mode is not available on lamp15.


Known Limitations (lamp15)

These limitations apply only to lamp15 / YLTD003 segment control.

No per-side brightness. set_segment_rgb has no brightness parameter, and RGB magnitude is normalized away. Both sides always share the brightness set by bg_set_bright.

bg_set_rgb resets segments. Once called, per-side values from set_segment_rgb are gone.

Rate limit: ~10 cmd/sec. Exceeding it silently drops commands or closes the connection. For high-frequency effects, use UDP mode (undocumented).

Last updated on