{"_id":"57fec79458a93b0e00ed6a6f","project":"5581248904ae5b0d0026289a","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"},"category":{"_id":"57fdb17c4defec0e0064228e","project":"5581248904ae5b0d0026289a","__v":0,"version":"57fdb17c4defec0e0064228b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-18T03:15:52.144Z","from_sync":false,"order":3,"slug":"message-types","title":"Protocol Messages"},"user":"557e2561eb75d80d00af3dab","__v":2,"githubsync":"","parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":["584dd1917cd82b1900c09ff7"],"next":{"pages":[],"description":""},"createdAt":"2016-10-12T23:30:28.199Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Enumerated Types\"\n}\n[/block]\n### Application Request\n\nThis type allows you to provide hints to the device about how the changes you make should be performed. For example you can send multiple zones and have them all apply at once. Application Request is stored as an unsigned 8-bit integer.\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Value\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"NO_APPLY\",\n    \"0-1\": \"0\",\n    \"0-2\": \"Don't apply the requested changes until a message with APPLY or APPLY_ONLY is sent.\",\n    \"1-0\": \"APPLY\",\n    \"1-1\": \"1\",\n    \"1-2\": \"Apply the changes immediately and apply any pending changes.\",\n    \"2-0\": \"APPLY_ONLY\",\n    \"2-1\": \"2\",\n    \"2-2\": \"Ignore the requested changes in this message and only apply pending changes.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Extended Multizone\"\n}\n[/block]\nThis is the new API for LIFX Z/Beam and is only supported by the second generation that have a new enough firmware on them. The firmware version for a product that enables this API can always be found in the product definition found at https://github.com/LIFX/products\n\n### SetExtendedColorZones - 510\n\nThis messages lets you change all the zones on your device in one message.\n\nThe index field is the zone we start applying the colors from. The first zone is 0.\n\nThe colors is 82 HSBK values and `colors_count` number of colors from this array will be applied sequentially from the `index`'d zone on the device.\n\n| Field | Type |\n|-------|------|\n| duration | unsigned 32-bit integer |\n| apply | Application Request |\n| index | unsigned 16-bit integer |\n| colors_count | unsigned 8-bit integer |\n| colors | 82 HSBK values |\n\n### GetExtendedColorZones - 511\n\nThis message will ask the device to return a StateExtendedColorZones containing all of it's colors.\n\n### StateExtendedColorZones - 512\n\nReturned after you send the device a GetExtendedColorZones or SetExtendedColorZones message. \n\nIn this message, `count` is total number of zones this device has; `index` is the zone this message starts from; `colors_count` is the number of colors in the `colors` that map to zones on the device. Currently all multizone products only have up to 82 zones.\n\n| Field | Type |\n|-------|------|\n| count | unsigned 16-bit integer |\n| index | unsigned 16-bit integer |\n| colors_count | unsigned 8-bit integer |\n| colors | 82 HSBK values |\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Original API\"\n}\n[/block]\nThis API is the original multizone API for controlling your LIFX Z/Beam. All LIFX Z/Beam products support this API.\n\n### SetColorZones - 501\n\nThis message is used for changing the color of either a single or multiple zones. The changes are stored in a buffer and are only applied once a message with either `APPLY` or `APPLY_ONLY` set.\n\n| Field | Type |\n|-------|------|\n| start_index | unsigned 8-bit integer |\n| end_index | unsigned 8-bit integer |\n| color | HSBK |\n| duration | unsigned 32-bit integer |\n| apply | Application Request |\n\n### GetColorZones - 502\n\nGetColorZones is used to request the zone colors for a range of zones. The bulb will respond with either StateZone or StateMultiZone messages as required to cover the requested range. The bulb may send state messages that cover more than the requested zones. Any zones outside the requested indexes will still contain valid values at the time the message was sent.\n\n| Field | Type |\n|-------|------|\n| start_index | unsigned 8-bit integer |\n| end_index | unsigned 8-bit integer |\n\n### StateZone - 503\n\nThe StateZone message represents the state of a single zone with the `index` field indicating which zone is represented. The `count` field contains the count of the total number of zones available on the device.\n\n| Field | Type |\n|-------|------|\n| count | unsigned 8-bit integer |\n| index | unsigned 8-bit integer |\n| color | HSBK |\n\n### StateMultiZone - 506\n\nThe StateMultiZone message represents the state of eight consecutive zones in a single message. As in the StateZone message the `count` field represents the count of the total number of zones available on the device. In this message the `index` field represents the index of `color[0]` and the rest of the colors are the consecutive zones thus the index of the `color[n]` zone will be `index + n`.\n\n| Field | Type |\n|-------|------|\n| count | unsigned 8-bit integer |\n| index | unsigned 8-bit integer |\n| color[0] | HSBK |\n| color[1] | HSBK |\n| color[2] | HSBK |\n| color[3] | HSBK |\n| color[4] | HSBK |\n| color[5] | HSBK |\n| color[6] | HSBK |\n| color[7] | HSBK |","excerpt":"","slug":"multizone-messages","type":"basic","title":"MultiZone Messages"}

MultiZone Messages


[block:api-header] { "type": "basic", "title": "Enumerated Types" } [/block] ### Application Request This type allows you to provide hints to the device about how the changes you make should be performed. For example you can send multiple zones and have them all apply at once. Application Request is stored as an unsigned 8-bit integer. [block:parameters] { "data": { "h-0": "Name", "h-1": "Value", "h-2": "Description", "0-0": "NO_APPLY", "0-1": "0", "0-2": "Don't apply the requested changes until a message with APPLY or APPLY_ONLY is sent.", "1-0": "APPLY", "1-1": "1", "1-2": "Apply the changes immediately and apply any pending changes.", "2-0": "APPLY_ONLY", "2-1": "2", "2-2": "Ignore the requested changes in this message and only apply pending changes." }, "cols": 3, "rows": 3 } [/block] [block:api-header] { "title": "Extended Multizone" } [/block] This is the new API for LIFX Z/Beam and is only supported by the second generation that have a new enough firmware on them. The firmware version for a product that enables this API can always be found in the product definition found at https://github.com/LIFX/products ### SetExtendedColorZones - 510 This messages lets you change all the zones on your device in one message. The index field is the zone we start applying the colors from. The first zone is 0. The colors is 82 HSBK values and `colors_count` number of colors from this array will be applied sequentially from the `index`'d zone on the device. | Field | Type | |-------|------| | duration | unsigned 32-bit integer | | apply | Application Request | | index | unsigned 16-bit integer | | colors_count | unsigned 8-bit integer | | colors | 82 HSBK values | ### GetExtendedColorZones - 511 This message will ask the device to return a StateExtendedColorZones containing all of it's colors. ### StateExtendedColorZones - 512 Returned after you send the device a GetExtendedColorZones or SetExtendedColorZones message. In this message, `count` is total number of zones this device has; `index` is the zone this message starts from; `colors_count` is the number of colors in the `colors` that map to zones on the device. Currently all multizone products only have up to 82 zones. | Field | Type | |-------|------| | count | unsigned 16-bit integer | | index | unsigned 16-bit integer | | colors_count | unsigned 8-bit integer | | colors | 82 HSBK values | [block:api-header] { "type": "basic", "title": "Original API" } [/block] This API is the original multizone API for controlling your LIFX Z/Beam. All LIFX Z/Beam products support this API. ### SetColorZones - 501 This message is used for changing the color of either a single or multiple zones. The changes are stored in a buffer and are only applied once a message with either `APPLY` or `APPLY_ONLY` set. | Field | Type | |-------|------| | start_index | unsigned 8-bit integer | | end_index | unsigned 8-bit integer | | color | HSBK | | duration | unsigned 32-bit integer | | apply | Application Request | ### GetColorZones - 502 GetColorZones is used to request the zone colors for a range of zones. The bulb will respond with either StateZone or StateMultiZone messages as required to cover the requested range. The bulb may send state messages that cover more than the requested zones. Any zones outside the requested indexes will still contain valid values at the time the message was sent. | Field | Type | |-------|------| | start_index | unsigned 8-bit integer | | end_index | unsigned 8-bit integer | ### StateZone - 503 The StateZone message represents the state of a single zone with the `index` field indicating which zone is represented. The `count` field contains the count of the total number of zones available on the device. | Field | Type | |-------|------| | count | unsigned 8-bit integer | | index | unsigned 8-bit integer | | color | HSBK | ### StateMultiZone - 506 The StateMultiZone message represents the state of eight consecutive zones in a single message. As in the StateZone message the `count` field represents the count of the total number of zones available on the device. In this message the `index` field represents the index of `color[0]` and the rest of the colors are the consecutive zones thus the index of the `color[n]` zone will be `index + n`. | Field | Type | |-------|------| | count | unsigned 8-bit integer | | index | unsigned 8-bit integer | | color[0] | HSBK | | color[1] | HSBK | | color[2] | HSBK | | color[3] | HSBK | | color[4] | HSBK | | color[5] | HSBK | | color[6] | HSBK | | color[7] | HSBK |