Scenes & schedules
Change a scene
PUT
/api/scenes/{id}Guest area “scenes”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.scenes); then it needs an unlock token.Changes its name, show or brightness.
Path parameters
idstringrequiredA scene id.
Request body application/json
namestringshowobjectThe show fields to set.
brightnessnumberResponses
200OKapplication/json
idstringrequirednamestringrequiredshowobjectThe show fields this scene sets (see Show).
brightnessnumber0 to 1403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
404No such id.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PUT 'http://localhost:8080/api/scenes/party' \
-H 'content-type: application/json' \
-d '{
"brightness": 0.5
}'const res = await fetch("http://localhost:8080/api/scenes/party", {
method: "PUT",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"brightness": 0.5
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.put(
"http://localhost:8080/api/scenes/party",
json={
"brightness": 0.5
},
)
print(res.json())Response
{
"id": "party",
"name": "Party mode",
"show": {
"mode": "auto",
"style": "party",
"palette": "auto"
},
"brightness": 1
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}{
"error": "No such scene"
}