Devices & room
Find devices
POST
/api/discoverAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Looks for WLED controllers (mDNS and a network scan), Govee lights, OpenRGB devices on this computer and LIFX, WiZ, Kasa, Yeelight and Twinkly lights. Each says whether it is added already. Takes a few seconds.
Request body application/json optional
scanbooleanAlso scan the network (default true).
hostsstring[]Extra addresses to try.
Responses
200OKapplication/json
object[]
hoststringipstringnamestringledsintegerkindstringLeft out for WLED.
indexintegerOpenRGB only.
addedbooleanAlready one of your devices.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/discover' \
-H 'content-type: application/json' \
-d '{
"scan": true
}'const res = await fetch("http://localhost:8080/api/discover", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"scan": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/discover",
json={
"scan": True
},
)
print(res.json())Response
[
{
"host": "wled-desk.local",
"ip": "192.168.1.42",
"name": "WLED-Desk",
"leds": 120,
"added": false
}
]{
"error": "Settings are locked. Unlock with the PIN in Settings."
}