{"__v":1,"_id":"55f28173f9f3991900f38a1a","category":{"__v":1,"_id":"55f28172f9f3991900f38a15","pages":["55f28173f9f3991900f38a17","55f28173f9f3991900f38a18","55f28173f9f3991900f38a19","55f28173f9f3991900f38a1a","55f28173f9f3991900f38a1b","55f28173f9f3991900f38a1c"],"project":"54ebb40d6423300d003672c0","version":"55f28172f9f3991900f38a13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T04:27:26.544Z","from_sync":false,"order":1,"slug":"overview","title":"Overview"},"project":"54ebb40d6423300d003672c0","user":"557e2561eb75d80d00af3dab","version":{"__v":2,"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","createdAt":"2015-09-11T07:23:30.065Z","releaseDate":"2015-09-11T07:23:30.065Z","categories":["55f28172f9f3991900f38a14","55f28172f9f3991900f38a15","55f28172f9f3991900f38a16","55f66acb297b37170058accb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-17T04:59:55.137Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Lights are a shared, physical device and each light maintains its own persistent connection to LIFX servers. That means individual lights may respond differently to each other. Reasons may include being physically powered off or being unreachable over the internet. When LIFX detects that a light is unreachable it marks it as offline. The light returns to normal after reconnecting to LIFX servers.\n\nClients can use the status of each light to determine corrective action. Generally it's easiest to make the request again, except when performing effects. Effects are visually loud and extra care should be taken to prevent disturbing the user.\n\nStatuses are returned in the response body from endpoints that perform actions on lights.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Light Reachability Status Codes\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Status\",\n    \"h-1\": \"Reason\",\n    \"0-0\": \"`ok`\",\n    \"1-0\": \"`timed_out`\",\n    \"2-0\": \"`offline`\",\n    \"0-1\": \"Light accepted the request and will begin processing.\",\n    \"1-1\": \"Light is unlikely to have accepted the request. LIFX servers did not get an acknowledgment from the light.\",\n    \"2-1\": \"Light did not accept the request because it is physically powered off or unreachable over the internet.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example Response\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"results\\\": [\\n    {\\n      \\\"id\\\": \\\"d3b2f2d97452\\\",\\n      \\\"label\\\": \\\"Left Lamp\\\",\\n      \\\"status\\\": \\\"timed_out\\\"\\n    },\\n    {\\n      \\\"id\\\": \\\"da2c63c353b8\\\",\\n      \\\"label\\\": \\\"Right Lamp\\\",\\n      \\\"status\\\": \\\"offline\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"Dealing with unreachable devices.","slug":"reachability","type":"basic","title":"Reachability"}

Reachability

Dealing with unreachable devices.

Lights are a shared, physical device and each light maintains its own persistent connection to LIFX servers. That means individual lights may respond differently to each other. Reasons may include being physically powered off or being unreachable over the internet. When LIFX detects that a light is unreachable it marks it as offline. The light returns to normal after reconnecting to LIFX servers. Clients can use the status of each light to determine corrective action. Generally it's easiest to make the request again, except when performing effects. Effects are visually loud and extra care should be taken to prevent disturbing the user. Statuses are returned in the response body from endpoints that perform actions on lights. [block:api-header] { "type": "basic", "title": "Light Reachability Status Codes" } [/block] [block:parameters] { "data": { "h-0": "Status", "h-1": "Reason", "0-0": "`ok`", "1-0": "`timed_out`", "2-0": "`offline`", "0-1": "Light accepted the request and will begin processing.", "1-1": "Light is unlikely to have accepted the request. LIFX servers did not get an acknowledgment from the light.", "2-1": "Light did not accept the request because it is physically powered off or unreachable over the internet." }, "cols": 2, "rows": 3 } [/block] [block:api-header] { "type": "basic", "title": "Example Response" } [/block] [block:code] { "codes": [ { "code": "{\n \"results\": [\n {\n \"id\": \"d3b2f2d97452\",\n \"label\": \"Left Lamp\",\n \"status\": \"timed_out\"\n },\n {\n \"id\": \"da2c63c353b8\",\n \"label\": \"Right Lamp\",\n \"status\": \"offline\"\n }\n ]\n}", "language": "json" } ] } [/block]