Home & sleep
Start the sleep timer
POST
/api/sleepBrightness or link key. Like the
brightness guest area, or with the wake-up link key (x-tempolight-key header, ?key= or key in the body), which opens the wake and sleep calls only.Fades the lights out and turns them off. A brightness or power change cancels it. Answers the home status (also status.home).
Request body application/json optional
minutesinteger1 to 180 (default: the sleep setting).
1 to 180keystringThe wake-up link key, instead of the header or ?key=.
Responses
200OKapplication/json
wakeobject | nullnextWakestring | null <date-time>An ISO date and time.
sleepobject | nullplanobject | null400The 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/sleep' \
-H 'content-type: application/json' \
-d '{
"minutes": 30
}'const res = await fetch("http://localhost:8080/api/sleep", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"minutes": 30
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/sleep",
json={
"minutes": 30
},
)
print(res.json())Response
{
"wake": null,
"nextWake": "2026-11-05T06:30:00.000Z",
"sleep": {
"start": "2026-11-04T22:00:00.000Z",
"end": "2026-11-04T22:30:00.000Z",
"progress": 0.2,
"left": 1440
},
"plan": null
}{
"error": "minutes is 1 to 180"
}{
"error": "Locked: add ?key=<your wake-up link key> (Home & sleep page) or unlock with the PIN"
}