{"_id":"57fdb17c4defec0e00642291","project":"5581248904ae5b0d0026289a","user":"557e2561eb75d80d00af3dab","version":{"_id":"57fdb17c4defec0e0064228b","project":"5581248904ae5b0d0026289a","__v":2,"createdAt":"2016-10-12T03:43:56.009Z","releaseDate":"2016-10-12T03:43:56.009Z","categories":["57fdb17c4defec0e0064228c","57fdb17c4defec0e0064228d","57fdb17c4defec0e0064228e","57fdb520bcc07b0e00d1ef41"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"__v":0,"category":{"_id":"57fdb17c4defec0e0064228c","project":"5581248904ae5b0d0026289a","version":"57fdb17c4defec0e0064228b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T07:40:58.578Z","from_sync":false,"order":0,"slug":"lifx-lan-protocol","title":"LIFX LAN Protocol"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-17T23:52:56.485Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"This documentation is intended for third-party developers creating client applications, which interact with LIFX lightbulbs over the LAN by sending and receiving, then parsing LIFX Protocol messages.\n\nThe LIFX Protocol consists of messages that are used to control and obtain the state of devices (specifically lightbulbs).\n\nEach message is composed of a header and a payload.\n\nHeaders contain the message size, type, routing, response flags and more. Payloads contain information germane to a specific message type.\n\nTo interact with LIFX lightbulbs over the Internet (Cloud or WAN), see the [LIFX HTTP API documention](http://lifx.readme.io/).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Transport Layer\"\n}\n[/block]\nThe LIFX Protocol utilizes UDP/IP for all messages covered by this documentation.\n\nNumeric data-type byte-order is [little-endian](http://en.wikipedia.org/wiki/Endianness#Little-endian)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Message Description\"\n}\n[/block]\nAll LIFX Protocol messages start with the header, which is covered in the [Header Description](doc:header-description).\n\nThe header contains the message type field.  There are two categories of messages detailed in this documentation:\n* Messages understood by all devices\n* Those messages specific to lightbulbs.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Protocol designers like to think ahead.  Don't get too excited ... LIFX only manufactures and sells network connected lightbulbs\"\n}\n[/block]\n\nThe message type determines the format of payload. The various message payloads are covered in the [Device Messages](doc:device-messages)  and [Light Messages](doc:light-messages) messages documentation.\n\nMost interactions consist of a number of messages transmitted between the client and the device. Some common message exchanges are shown in the [Workflow Diagrams](doc:workflow-diagrams).\n\nOften, device discovery is a good place to start. In which case, the [discovery workflow](doc:workflow-diagrams#discovery), along with the [Device::GetService](doc:device-messages#section-getservice-2) and the [Device::StateService](doc:device-messages#section-stateservice-3) messages are relevant.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Limits\"\n}\n[/block]\n* Maximum recommended message transmit rate to a device: 20 per second\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Terms and Conditions\"\n}\n[/block]\nUsing undocumented message types or field values, sending poorly formed messages or excessive message rates to LIFX devices and/or LIFX services may result in unexpected device or protocol message behavior.\n\nLAN Protocol. LiFi Labs, Inc. © 2015. All rights reserved. Usage of this documentation is bound by the [LIFX Developer Terms](http://www.lifx.com/pages/developer-terms-of-use).","excerpt":"","slug":"introduction","type":"basic","title":"Introduction"}
This documentation is intended for third-party developers creating client applications, which interact with LIFX lightbulbs over the LAN by sending and receiving, then parsing LIFX Protocol messages. The LIFX Protocol consists of messages that are used to control and obtain the state of devices (specifically lightbulbs). Each message is composed of a header and a payload. Headers contain the message size, type, routing, response flags and more. Payloads contain information germane to a specific message type. To interact with LIFX lightbulbs over the Internet (Cloud or WAN), see the [LIFX HTTP API documention](http://lifx.readme.io/). [block:api-header] { "type": "basic", "title": "Transport Layer" } [/block] The LIFX Protocol utilizes UDP/IP for all messages covered by this documentation. Numeric data-type byte-order is [little-endian](http://en.wikipedia.org/wiki/Endianness#Little-endian) [block:api-header] { "type": "basic", "title": "Message Description" } [/block] All LIFX Protocol messages start with the header, which is covered in the [Header Description](doc:header-description). The header contains the message type field. There are two categories of messages detailed in this documentation: * Messages understood by all devices * Those messages specific to lightbulbs. [block:callout] { "type": "info", "body": "Protocol designers like to think ahead. Don't get too excited ... LIFX only manufactures and sells network connected lightbulbs" } [/block] The message type determines the format of payload. The various message payloads are covered in the [Device Messages](doc:device-messages) and [Light Messages](doc:light-messages) messages documentation. Most interactions consist of a number of messages transmitted between the client and the device. Some common message exchanges are shown in the [Workflow Diagrams](doc:workflow-diagrams). Often, device discovery is a good place to start. In which case, the [discovery workflow](doc:workflow-diagrams#discovery), along with the [Device::GetService](doc:device-messages#section-getservice-2) and the [Device::StateService](doc:device-messages#section-stateservice-3) messages are relevant. [block:api-header] { "type": "basic", "title": "Limits" } [/block] * Maximum recommended message transmit rate to a device: 20 per second [block:api-header] { "type": "basic", "title": "Terms and Conditions" } [/block] Using undocumented message types or field values, sending poorly formed messages or excessive message rates to LIFX devices and/or LIFX services may result in unexpected device or protocol message behavior. LAN Protocol. LiFi Labs, Inc. © 2015. All rights reserved. Usage of this documentation is bound by the [LIFX Developer Terms](http://www.lifx.com/pages/developer-terms-of-use).