Scenes & schedules
Add a schedule
POST
/api/schedulesAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.At a time (19:00, or sunset+30 once a location is set) on some weekdays, apply a scene, turn the lights on or off, or set a brightness.
Request body application/json
namestringUp to 60 characters
timestringHH:MM, or sunrise/sunset with an optional offset in minutes (needs a location in Settings).
daysinteger[]Weekdays, 0 = Sunday.
actionobjectenabledbooleanDefault
trueResponses
200OKapplication/json
idstringrequiredt…
nextstring | null <date-time>The next time it runs (ISO).
namestringUp to 60 characters
timestringHH:MM, or sunrise/sunset with an optional offset in minutes (needs a location in Settings).
daysinteger[]Weekdays, 0 = Sunday.
actionobjectenabledbooleanDefault
true400The 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 POST 'http://localhost:8080/api/schedules' \
-H 'content-type: application/json' \
-d '{
"name": "Evening",
"time": "sunset+30",
"days": [
1,
2,
3,
4,
5
],
"action": {
"type": "scene",
"scene": "chill"
},
"enabled": true
}'const res = await fetch("http://localhost:8080/api/schedules", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"name": "Evening",
"time": "sunset+30",
"days": [
1,
2,
3,
4,
5
],
"action": {
"type": "scene",
"scene": "chill"
},
"enabled": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/schedules",
json={
"name": "Evening",
"time": "sunset+30",
"days": [
1,
2,
3,
4,
5
],
"action": {
"type": "scene",
"scene": "chill"
},
"enabled": True
},
)
print(res.json())Response
{
"id": "t8f2k1",
"name": "Evening",
"time": "sunset+30",
"days": [
1,
2,
3,
4,
5
],
"action": {
"type": "scene",
"scene": "chill"
},
"enabled": true,
"next": "2026-11-04T17:12:00.000Z"
}{
"error": "Time must look like 18:30, sunset or sunrise-15"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}