Changing a device

The LIFX protocol supports Set messages which are used to change metadata or the visual appearance of a device. These messages also return State messages like the Get messages do when you specify res_required=1.

Note however that if your Set messages changes the visual appearance of the light it is likely you'll get the state of the device before your change.

Device

SetPower - Packet 21

This packet lets you set the current level of power on the device.

Will return one StatePower (22) message

level: Uint16
If you specify 0 the light will turn off and if you specify 65535 the device will turn on.

SetLabel - Packet 24

This packet lets you set the label on the device. The label is a string you assign to the device and will be displayed as the name of the device in the LIFX mobile apps.

Will return one StateLabel (25) message

label: 32 bytes String
The string you want to assign.

SetReboot - Packet 38

This packet will instruct the device to perform a reboot similar to if it had been power cycled.

SetLocation - Packet 49

This packet lets you set the location information on the device.

Will return one StateLocation (50) message

location: 16 Bytes
16 bytes representing a UUID of the location. You should have the same UUID value for each device in this location
label: 32 bytes String
The name of the location.
updated_at: Uint64
The time you updated the location of this device as an epoch in nanoseconds.

SetGroup - Packet 52

This packet lets you set the group information on the device.

Will return one StateGroup (53) message

group: 16 Bytes
16 bytes representing a UUID of the group. You should have the same UUID value for each device in this group
label: 32 bytes String
The name of the group.
updated_at: Uint64
The time you updated the group of this device as an epoch in nanoseconds.

Light

SetColor - Packet 102

This packet lets you set the HSBK value for the light. For devices that have multiple zones, this will set all Zones on the device to this color.

Will return one LightState (107) message

reserved6: 1 Reserved bytes
hue: Uint16
saturation: Uint16
brightness: Uint16
kelvin: Uint16
duration: Uint32
The time it will take to transition to the new HSBK in milliseconds.

SetWaveform - Packet 103

This packet lets you set the HSBK and Waveforms value for the light. For devices that have multiple zones, this will treat all the zones on the device as one.

Will return one LightState (107) message

reserved6: 1 Reserved bytes
transient: BoolInt
See Waveforms
hue: Uint16
saturation: Uint16
brightness: Uint16
kelvin: Uint16
period: Uint32
See Waveforms
cycles: Float
See Waveforms
skew_ratio: Int16
See Waveforms
waveform: Uint8 using Waveform Enum
See Waveforms

SetLightPower - Packet 117

This is the same as SetPower (21) but allows you to specify how long it will take to transition to the new power state.

Will return one StateLightPower (118) message

level: Uint16
If you specify 0 the light will turn off and if you specify 65535 the device will turn on.
duration: Uint32
The time it will take to transition to the new state in milliseconds.

SetWaveformOptional - Packet 119

This behaves like SetWaveform (103) but allows you to keep certain parts of the original HSBK values during the transition.

Will return one LightState (107) message

reserved6: 1 Reserved bytes
transient: BoolInt
See Waveforms
hue: Uint16
saturation: Uint16
brightness: Uint16
kelvin: Uint16
period: Uint32
See Waveforms
cycles: Float
See Waveforms
skew_ratio: Int16
See Waveforms
waveform: Uint8 using Waveform Enum
See Waveforms
set_hue: BoolInt
Use the hue value in this message
set_saturation: BoolInt
Use the saturation value in this message
set_brightness: BoolInt
Use the brightness value in this message
set_kelvin: BoolInt
Use the kelvin value in this message

SetInfrared - Packet 122

This packet lets you change the current infrared value on the device

Will return one StateInfrared (121) message

This packet requires the device has the infrared capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

brightness: Uint16
The amount of infrared emitted by the device. 0 is no infrared and 65535 is the most infrared.

SetHevCycle - Packet 143

This packet lets you start or stop a HEV cycle on the device.

Will return one StateHevCycle (144) message

This packet requires the device has the hev capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

enable: BoolInt
Set this to false to turn off the cycle and true to start the cycle
duration_s: Uint32
The duration, in seconds that the cycle should last for. A value of 0 will use the default duration set by SetHevCycleConfiguration (146).

SetHevCycleConfiguration - Packet 146

This packet lets you set default values for a HEV cycle on the device

Will return one StateHevCycleConfiguration (147) message

This packet requires the device has the hev capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

indication: BoolInt
Set this to true to run a short flashing indication at the end of the HEV cycle
duration_s: Uint32
This is the default duration that is used when SetHevCycle (143) is given 0 for duration_s.

MultiZone

SetColorZones - Packet 501

Set a segment of your strip to a HSBK value. If your devices supports extended multizone messages it is recommended you use those messages instead.

Will return one StateMultiZone (506) message

This packet requires the device has the Linear Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

start_index: Uint8
The first zone in the segment we are changing.
end_index: Uint8
The last zone in the segment we are changing
hue: Uint16
saturation: Uint16
brightness: Uint16
kelvin: Uint16
duration: Uint32
The amount of time it takes to transition to the new values in milliseconds.
apply: Uint8 using MultiZoneApplicationRequest Enum

SetMultiZoneEffect - Packet 508

Start a multizone Firmware Effect on the device.

Will return one StateMultiZoneEffect (509) message

This packet requires the device has the Linear Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

instanceid: Uint32
A unique number identifying this effect.
type: Uint8 using MultiZoneEffectType Enum
reserved6: 2 Reserved bytes
speed: Uint32
The time it takes for one cycle of the effect in milliseconds.
duration: Uint64
The time the effect will run for in nanoseconds.
reserved7: 4 Reserved bytes
reserved8: 4 Reserved bytes
parameters: 32 Bytes
This field is 8 4 byte fields which change meaning based on the effect that is running. When the effect is MOVE only the second field is used and is a Uint32 representing the DIRECTION enum. This field is currently ignored for all other multizone effects.

SetExtendedColorZones - Packet 510

This message lets you change the HSBK values for all zones on the strip in one message.

Will return one StateExtendedColorZones (512) message

This packet requires the device has the Extended Linear Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

duration: Uint32
The time it takes to transition to the new values in milliseconds.
apply: Uint8 using MultiZoneExtendedApplicationRequest Enum
Whether to make this change now
zone_index: Uint16
The first zone to apply colors from. If the light has more than 82 zones, then send multiple messages with different indices to update the whole device.
colors_count: Uint8
The number of colors in the colors field to apply to the strip
colors: 82 Color structures
The HSBK values to change the strip with.

Relay

SetRPower - Packet 817

Set the power state of a relay on a switch device. Current models of the LIFX switch do not have dimming capability, so the two valid values are 0 for off and 65535 for on.

Will return one StateRPower (818) message

This packet requires the device has the Relays capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

relay_index: Uint8
The relay on the switch starting from 0.
level: Uint16
The new value of the relay

Tile

SetUserPosition - Packet 703

Allows you to specify the position of this device in the chain relative to other device in the chain.

You can find more information about this data by looking at Tile Positions.

This message has no response packet even if you set res_required=1.

This packet requires the device has the Matrix Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

tile_index: Uint8
The device to change. This is 0 indexed and starts from the device closest to the controller.
reserved6: 2 Reserved bytes
user_x: Float
user_y: Float

Set64 - Packet 715

This lets you set up to 64 HSBK values on the device.

This message has no response packet even if you set res_required=1.

This packet requires the device has the Matrix Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

tile_index: Uint8
The device to change. This is 0 indexed and starts from the device closest to the controller.
length: Uint8
The number of devices in the chain to change starting from tile_index
reserved6: 1 Reserved bytes
x: Uint8
The x co-ordinate to start applying colors from. You likely want this to be 0.
y: Uint8
The y co-ordinate to start applying colors from. You likely want this to be 0.
width: Uint8
The width of the square you're applying colors to. This should be 8 for the LIFX Tile and 5 for the LIFX Candle.
duration: Uint32
The time it will take to transition to new state in milliseconds.
colors: 64 Color structures
The HSBK values to assign to each zone specified by this packet.

SetTileEffect - Packet 719

This packet will let you start a Firmware Effect on the device.

Will return one StateTileEffect (720) message

This packet requires the device has the Matrix Zones capability. You may use GetVersion (32), GetHostFirmware (14) and the Product Registry to determine whether your device has this capability

reserved8: 1 Reserved bytes
reserved9: 1 Reserved bytes
instanceid: Uint32
A unique number identifying this effect.
type: Uint8 using TileEffectType Enum
speed: Uint32
The time it takes for one cycle of the effect in milliseconds.
duration: Uint64
The time the effect will run for in nanoseconds.
reserved6: 4 Reserved bytes
reserved7: 4 Reserved bytes
parameters: 32 Bytes
This field is 8 4 byte fields and is currently ignored by all firmware effects.
palette_count: Uint8
The number of values in palette that you want to use.
palette: 16 Color structures
The HSBK values to be used by the effect. Currently only the MORPH effect uses these values.