Command Reference
TCP command methods for Yeelight devices. See Protocol for transport framing, discovery, and flow animation format.
Main Channel
Available on all devices.
| Method | Parameters | Description |
|---|---|---|
set_power | "on"|"off", "smooth"|"sudden", ms | Power on/off |
set_bright | 1-100, "smooth"|"sudden", ms | Brightness |
set_ct_abx | kelvin(2700-6500), "smooth"|"sudden", ms | Color temperature |
set_rgb | rgb_int, "smooth"|"sudden", ms | RGB color |
set_hsv | hue(0-359), sat(0-100), "smooth"|"sudden", ms | Color via HSV |
start_cf / stop_cf | see Flow Animations | Animations |
toggle | — | Toggle power |
set_default | — | Save as default |
set_rgbandset_hsvare only available on devices that report them in the SSDPsupportfield.
Background Channel (bg_*)
Only on devices with a background channel (report bg_set_power in support).
| Method | Parameters | Description |
|---|---|---|
bg_set_power | "on"|"off", "smooth"|"sudden", ms | Power on/off |
bg_toggle | — | Toggle |
bg_set_bright | 1-100, "smooth"|"sudden", ms | Brightness |
bg_set_rgb | rgb_int, "smooth"|"sudden", ms | Both sides same color, resets segment state |
bg_set_hsv | hue(0-359), sat(0-100), "smooth"|"sudden", ms | Color via HSV |
bg_set_ct_abx | kelvin(1700-6500), "smooth"|"sudden", ms | Color temperature |
bg_start_cf | count, action, flow_expression | Start animation |
bg_stop_cf | — | Stop animation |
bg_set_default | — | Save 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_rgbin itssupportfield.All data on this section was determined empirically — the official spec does not document segment control.
The lamp has three independent control surfaces:
| # | Zone | Type | Commands |
|---|---|---|---|
| 1 | Front light (screen bias) | CT, no RGB | set_power, set_bright, set_ct_abx |
| 2 | Rear strip — both sides at once | RGB + CT | bg_set_rgb, bg_set_power, bg_set_bright |
| 3 | Rear strip — left and right sides | RGB + CT | set_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)andrgb(255,0,0)produce identically bright red0x000000produces undefined behavior — avoid it- Calling
bg_set_rgbafterward overrides and resets per-side state
Properties (get_prop)
{
"id": 1,
"method": "get_prop",
"params": ["power", "bright", "ct", "bg_power", "bg_rgb", "bg_bright"]
}| Property | Description |
|---|---|
power | Front light: "on" / "off" |
bright | Front light brightness (1–100) |
ct | Front light color temp (Kelvin, not RGB) |
flowing | "1" if animation active |
bg_power | Rear strip: "on" / "off" |
bg_bright | Rear strip brightness (1–100) |
bg_rgb | Rear strip color as rgb_int |
bg_ct | Rear 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 |
name | Device name |
ctandbg_ctare Kelvin values — do not treat as RGB integers.
Utilities
| Method | Parameters | Description |
|---|---|---|
set_name | "name" | Rename device |
cron_add | 0, minutes | Auto-off timer |
cron_get | 0 | Read timer |
cron_del | 0 | Delete 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).