LIFX Developer Zone

SetStates consistent timeout failure with Z strip

I’m using the HTTP interface to control my Z strip and while I can successfully control the zones with SetState, it’s obviously slow and spammy. When using SetStates, I consistently get a failure of timed_out if there’s more than 1-2 entries in the array. After this happens, my device stops showing as “connected” in the device list until I reset it it at the outlet.

SetStates with 1 entry:

PUT https://api.lifx.com/v1/lights/states {“states”:[{“selector”:“id:d073d543e81f|1”,“brightness”:1,“color”:{“hue”:5.625,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1}]}
{
“results”: [
{
“operation”: {
“selector”: “id:d073d543e81f|1”,
“power”: “on”,
“color”: “hue:5.625 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “ok”,
“label”: “Derek’s Strip”
}
]
}
]
}

With 5 entries:

PUT https://api.lifx.com/v1/lights/states {“states”:[{“selector”:“id:d073d543e81f|0”,“brightness”:1,“color”:{“hue”:0,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1},{“selector”:“id:d073d543e81f|1”,“brightness”:1,“color”:{“hue”:5.625,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1},{“selector”:“id:d073d543e81f|2”,“brightness”:1,“color”:{“hue”:11.25,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1},{“selector”:“id:d073d543e81f|3”,“brightness”:1,“color”:{“hue”:16.875,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1},{“selector”:“id:d073d543e81f|4”,“brightness”:1,“color”:{“hue”:22.5,“saturation”:1},“fast”:true,“power”:“on”,“duration”:1}]}
{
“results”: [
{
“operation”: {
“selector”: “id:d073d543e81f|0”,
“power”: “on”,
“color”: “hue:0 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “timed_out”,
“label”: “Derek’s Strip”
}
]
},
{
“operation”: {
“selector”: “id:d073d543e81f|1”,
“power”: “on”,
“color”: “hue:5.625 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “timed_out”,
“label”: “Derek’s Strip”
}
]
},
{
“operation”: {
“selector”: “id:d073d543e81f|2”,
“power”: “on”,
“color”: “hue:11.25 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “timed_out”,
“label”: “Derek’s Strip”
}
]
},
{
“operation”: {
“selector”: “id:d073d543e81f|3”,
“power”: “on”,
“color”: “hue:16.875 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “timed_out”,
“label”: “Derek’s Strip”
}
]
},
{
“operation”: {
“selector”: “id:d073d543e81f|4”,
“power”: “on”,
“color”: “hue:22.5 saturation:1”,
“brightness”: 1,
“duration”: 1
},
“results”: [
{
“id”: “d073d543e81f”,
“status”: “timed_out”,
“label”: “Derek’s Strip”
}
]
}
]
}