Protocol Reference
| Property | Value |
|---|---|
| Transport | TCP |
| Port | 55443 |
| Encoding | UTF-8 plain text, no encryption |
| Message delimiter | \r\n |
| Discovery | SSDP over UDP multicast |
| Rate limit | ~10 commands/sec (TCP mode) |
LAN control must be explicitly enabled in the Yeelight mobile app: Device → Settings → LAN Control
Official PDF spec (incomplete): Yeelight Inter-Operation Spec (PDF)
Device Discovery (SSDP)
Devices are discovered via SSDP (UPnP-style multicast).
M-SEARCH request — send as UDP to 239.255.255.250:1982:
M-SEARCH * HTTP/1.1\r\n
HOST: 239.255.255.250:1982\r\n
MAN: "ssdp:discover"\r\n
ST: wifi_bulb\r\n
\r\nResponse — HTTP/1.1 headers:
| Header | Example | Description |
|---|---|---|
Location | yeelight://192.168.1.5:55443 | IP and port for TCP connection |
id | 0x000000000484af7d | Unique device identifier (hex) |
model | lamp15 | Logical model name (not hardware SKU) |
name | My Light Bar | User-assigned name |
power | on | Current power state |
bright | 100 | Current brightness (1–100) |
ct | 4000 | Current color temperature (Kelvin) |
rgb | 16711680 | Current RGB as integer |
support | get_prop set_power ... | Space-separated list of supported methods |
The support field is the authoritative source for what commands a device accepts.
Command Format
Request
{ "id": 1, "method": "set_bright", "params": [50, "smooth", 500] }Response (success)
{ "id": 1, "result": ["ok"] }Response (error)
{ "id": 3, "error": { "code": -1, "message": "unsupported method" } }Push notifications (unsolicited)
{ "method": "props", "params": { "power": "on", "bright": "75" } }Sent by the device whenever state changes from any source (physical button, another app, etc.).
Capability System
Capability detection is based on which methods appear in the support SSDP field. The model field identifies the logical device type — see Devices for the full compatibility matrix.
| Group | Methods | Capability |
|---|---|---|
| Color | set_rgb, set_hsv | Main channel supports RGB |
| Color temp | set_ct_abx | Main channel supports CT |
| Flow | start_cf, stop_cf | Main channel supports animations |
| Background | bg_set_power, bg_set_rgb… | Device has a background channel |
| Music mode | set_music | TCP music mode supported |
| Segment | set_segment_rgb | Per-side control (lamp15-specific) |
| UDP/Chroma | udp_sess_new, udp_chroma_sess_new | Razer Chroma integration |
Flow Animations
start_cf(count, action, flow_expression)
bg_start_cf(count, action, flow_expression)| Parameter | Values |
|---|---|
count | 0 = infinite, N = repeat N times |
action | 0 = restore, 1 = stay on last frame, 2 = turn off |
| frame | duration_ms, mode, value, brightness (mode: 1=RGB, 2=CT, 7=sleep) |
Example — rainbow loop on background channel:
{
"method": "bg_start_cf",
"params": [0, 0, "2000,1,16711680,100,2000,1,65280,100,2000,1,255,100"]
}Music Mode
Music mode inverts the TCP connection direction: the lamp connects to a server the app opens. This removes the rate limit entirely.
{ "method": "set_music", "params": [1, "192.168.1.100", 54321] }Gated by set_music in the support field. lamp15 does not support music mode.
In music mode: the lamp does not respond to get_prop — state must be tracked locally.
UDP / Chroma Mode
For high-frequency reactive effects, the device has an undocumented UDP session mode used by Razer Synapse internally.
| Method | Description |
|---|---|
udp_sess_new | Open a UDP session |
udp_sess_keep_alive | Keepalive |
udp_chroma_sess_new | Razer Chroma variant |
Protocol not publicly documented.
LAN Control Availability
Xiaomi forced Yeelight to remove LAN control from some devices post-sale:
| Device | Firmware | Status |
|---|---|---|
| bslamp2 | 2.0.6_0041+ | Removed. Toggle disappeared from Yeelight app. |
“lan control feature is from yeelight, xiaomi company takes it as a risk, so we have to disable it.” — Yeelight staff, forum.yeelight.com Feb 2021
Always use SSDP discovery as the source of truth — if a device doesn’t respond to M-SEARCH, LAN is either disabled or removed.
For the full command method reference see Commands Reference.