Scenes & schedules
Save a scene
POST
/api/scenesGuest 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.{name} saves the current look as a scene; or give its show and brightness.
Request body application/json
namestringUp to 60 characters
showobjectThe show fields to set; left out: the current show.
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.
Request
curl -X POST 'http://localhost:8080/api/scenes' \
-H 'content-type: application/json' \
-d '{
"name": "Movie night"
}'const res = await fetch("http://localhost:8080/api/scenes", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"name": "Movie night"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/scenes",
json={
"name": "Movie night"
},
)
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."
}