{"_id":"55f28173f9f3991900f38a24","category":{"_id":"55f28172f9f3991900f38a16","__v":3,"pages":["55f28173f9f3991900f38a1d","55f28173f9f3991900f38a1e","55f28173f9f3991900f38a1f","55f28173f9f3991900f38a20","55f28173f9f3991900f38a21","55f28173f9f3991900f38a22","55f28173f9f3991900f38a23","55f28173f9f3991900f38a24","55f28173f9f3991900f38a25","55f28173f9f3991900f38a26","55f28173f9f3991900f38a27","55f63d46fe4cce21005c785e","55f65cc16be5ea0d00bbbf4c"],"project":"54ebb40d6423300d003672c0","version":"55f28172f9f3991900f38a13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-17T05:23:31.147Z","from_sync":false,"order":2,"slug":"api-endpoints","title":"API Endpoints"},"version":{"_id":"55f28172f9f3991900f38a13","project":"54ebb40d6423300d003672c0","__v":2,"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"},"user":"557e2561eb75d80d00af3dab","__v":11,"editedParams2":true,"githubsync":"","editedParams":true,"project":"54ebb40d6423300d003672c0","parentDoc":null,"updates":["5620f0616e20d40d00731053","5718fa41f8f7de1900683fef","577e17d447a9ab0e003dffe7","58697553c0741a2d0015c560","586975931b0bc03700ec2398"],"next":{"pages":[],"description":""},"createdAt":"2015-07-20T01:36:41.057Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -X PUT \"https://api.lifx.com/v1/scenes/scene_id:55a0db9d-3ea7-4973-9b15-b149215bd4db/activate\" \\\n     -H \"Authorization: Bearer [[app:Token]]\"","language":"curl"},{"language":"php","code":"<?php\n\n$scene = '55a0db9d-3ea7-4973-9b15-b149215bd4db';\n$link = \"https://api.lifx.com/v1/scenes/scene_id:$scene/activate\";\n$authToken = \"[[app:Token]]\";\n\n$headers = array('Authorization: Bearer ' . $authToken);\n\n$ch = curl_init($link);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n$response = curl_exec($ch);\n\n?>"},{"code":"import requests\n\ntoken = \"[[app:Token]]\"\nscene = '55a0db9d-3ea7-4973-9b15-b149215bd4db'\n\nheaders = {\n    \"Authorization\": \"Bearer %s\" % token,\n}\n\nresponse = requests.put('https://api.lifx.com/v1/scenes/scene_id:%s/activate' % scene, headers=headers)","language":"python"}]},"method":"put","results":{"codes":[{"name":"","status":"2XX","language":"json","code":"{\n  \"results\": [\n    {\n      \"status\": \"ok\",\n      \"label\": \"Left\",\n      \"id\": \"d073d501cf2c\"\n    },\n    {\n      \"status\": \"ok\",\n      \"label\": \"Right\",\n      \"id\": \"d073d500e948\"\n    },\n    {\n      \"status\": \"ok\",\n      \"label\": \"Left\",\n      \"id\": \"d073d501a6ed\"\n    },\n    {\n      \"status\": \"ok\",\n      \"label\": \"Right\",\n      \"id\": \"d073d5017c04\"\n    }\n  ]\n}"}]},"settings":"","auth":"required","params":[{"_id":"55ac50a95863b817008ae37f","ref":"","in":"path","required":true,"desc":"The UUID for the scene you wish to activate","default":"","type":"string","name":"scene_uuid"},{"_id":"55c2b3e3e61e860d00312324","ref":"","in":"body","required":false,"desc":"Time in seconds to transition from the current light state to the scene state.","default":"1.0","type":"double","name":"duration"},{"_id":"592f72307fd3210025f6d5b7","ref":"","in":"body","required":false,"desc":"Any of *\"power\", \"infrared\", \"duration\", \"intensity\", \"hue\", \"saturation\", \"brightness\"* or *\"kelvin\"*, specifying that these properties should not be changed on devices when applying the scene.","default":"","type":"array_string","name":"ignore"},{"_id":"592f731362a2c90037f73e42","ref":"","in":"body","required":false,"desc":"A `state` object as per  [Set State](doc:set-state) specifying properties to apply to all devices in the scene, overriding those configured in the scene.","default":"","type":"object","name":"overrides"},{"_id":"5b57d22058555d0003a9e581","ref":"","in":"body","required":false,"desc":"Execute the query [fast](#fast-mode), without initial state checks and wait for no results.","default":"false","type":"boolean","name":"fast"}],"url":"/scenes/scene_id::scene_uuid/activate"},"isReference":false,"order":10,"body":"Activates a scene from the users account\n[block:api-header]\n{\n  \"title\": \"Fast Mode\"\n}\n[/block]\nThe API is designed to ensure consistent transitions for devices from one state to another.  For many operations, this involves having an accurate view of the current state of the device before taking any action, so we need to ask it for its state first.  Other transitions, in order to be smooth, require intermediate state changes; for example, to switch on and set to blue a light that is off and set to red, we first switch it to blue, wait for that to succeed, then switch it on, to avoid jarring transitions.\n\nAs this involves various network hops to the device, this process is slower than many traditional web APIs.  There are use-cases where this is unnecessary, for example those in which the client has a pretty good idea of the current state and just wants to send one state change message to the device.\n\nTo speed things up for such use-cases, when setting `fast=true`, we do none of checks described above, and just send the targets the end-state messages.  Because we don't wait around for a reply from the device in fast mode, you'll just get `202 Accepted` with no body if your request was valid.","excerpt":"","slug":"activate-scene","type":"endpoint","title":"Activate Scene"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

scene_uuid:
required
string
The UUID for the scene you wish to activate

Body Params

duration:
double1.0
Time in seconds to transition from the current light state to the scene state.
ignore:
array of strings
Any of *"power", "infrared", "duration", "intensity", "hue", "saturation", "brightness"* or *"kelvin"*, specifying that these properties should not be changed on devices when applying the scene.
overrides:
object
A `state` object as per [Set State](doc:set-state) specifying properties to apply to all devices in the scene, overriding those configured in the scene.
fast:
booleanfalse
Execute the query [fast](#fast-mode), without initial state checks and wait for no results.

Examples


Result Format


Documentation

Activates a scene from the users account [block:api-header] { "title": "Fast Mode" } [/block] The API is designed to ensure consistent transitions for devices from one state to another. For many operations, this involves having an accurate view of the current state of the device before taking any action, so we need to ask it for its state first. Other transitions, in order to be smooth, require intermediate state changes; for example, to switch on and set to blue a light that is off and set to red, we first switch it to blue, wait for that to succeed, then switch it on, to avoid jarring transitions. As this involves various network hops to the device, this process is slower than many traditional web APIs. There are use-cases where this is unnecessary, for example those in which the client has a pretty good idea of the current state and just wants to send one state change message to the device. To speed things up for such use-cases, when setting `fast=true`, we do none of checks described above, and just send the targets the end-state messages. Because we don't wait around for a reply from the device in fast mode, you'll just get `202 Accepted` with no body if your request was valid.

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}