Lights & show
Set the zones
PUT
/api/zonesGuest area “effects”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.effects); then it needs an unlock token.Replaces the zones (at most 32). A zone follows the show, shows its own effect, the ambient look, or is off. Shapes join a zone with their zone field.
Request body application/json
zonesobject[]required0 to 32 items
Responses
200OKapplication/json
object[]
idstringnamestringmodestringOne of
"follow" "effect" "ambient" "off"effectstring | nullFor mode effect.
brightnessnumber0 to 1400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PUT 'http://localhost:8080/api/zones' \
-H 'content-type: application/json' \
-d '{
"zones": [
{
"id": "z1",
"name": "Desk",
"mode": "effect",
"effect": "aurora",
"brightness": 0.7
}
]
}'const res = await fetch("http://localhost:8080/api/zones", {
method: "PUT",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"zones": [
{
"id": "z1",
"name": "Desk",
"mode": "effect",
"effect": "aurora",
"brightness": 0.7
}
]
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.put(
"http://localhost:8080/api/zones",
json={
"zones": [
{
"id": "z1",
"name": "Desk",
"mode": "effect",
"effect": "aurora",
"brightness": 0.7
}
]
},
)
print(res.json())Response
[
{
"id": "z1",
"name": "Desk",
"mode": "effect",
"effect": "aurora",
"brightness": 0.7
}
]{
"error": "Zone \"Desk\": pick an effect"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}