Light message types

June 11, 2015 · View on GitHub

LIFX Developer Home | LAN Protocol. LiFi Labs, Inc. © 2015. All rights reserved. Usage of this documentation is bound by the [LIFX Developer Terms] (http://developer.lifx.com/terms.html).

Light message types

Index

Overview

Light messages control and acquire the state of a specific type of device, such as a lightbulb. The state is comprised of the label, power level and color.

There are a duplicate set of device power related messages, Device::GetPower, Device::StatePower and Device::SetPower, which are extended for lights by adding a duration field to Light::SetPower.

The Protocol header message type field value (decimal) appears after each message name in this document. Each section below describes the payload that is appended to the message header. Some messages do not require a payload.

Message field data types

HSBK

HSBK is used to represent the color and color temperature of a light.

The color is represented as an HSB (Hue, Saturation, Brightness) value.

The color temperature is represented in K (Kelvin) and is used to adjust the warmness / coolness of a white light, which is most obvious when saturation is close zero.

  • Hue: range 0 to 65535
  • Saturation: range 0 to 65535
  • Brightness: range 0 to 65535
  • Kelvin: range 2500° (warm) to 9000° (cool)
FieldType
hueunsigned 16-bit integer
saturationunsigned 16-bit integer
brightnessunsigned 16-bit integer
kelvinunsigned 16-bit integer

For user interface purposes, the hue is typically scaled to between 0° and 360°. Saturation and brightness are typically scaled to between 0% and 100%.

Light messages

Get - 101

Sent by a client to obtain the light state. No payload required. Causes the device to transmit a State message.

SetColor - 102

Sent by a client to change the light state.

FieldType
reservedunsigned 8-bit integer
colorHSBK
durationunsigned 32-bit integer

The duration is the color transition time in milliseconds.

If the Frame Address res_required field is set to one (1) then the device will transmit a State message.

State - 107

Sent by a device to provide the current light state.

FieldType
colorHSBK
reservedsigned 16-bit integer
powerunsigned 16-bit integer
labelstring, size: 32 bytes
reservedunsigned 64-bit integer

See color, label and power level.

GetPower - 116

Sent by a client to obtain the power level. No payload required. Causes the device to transmit a StatePower message.

SetPower - 117

Sent by a client to change the light power level.

FieldType
levelunsigned 16-bit integer
durationunsigned 32-bit integer

The power level must be either 0 or 65535.

The duration is the power level transition time in milliseconds.

If the Frame Address res_required field is set to one (1) then the device will transmit a StatePower message.

StatePower - 118

Sent by a device to provide the current power level.

FieldType
levelunsigned 16-bit integer