Devices & room

Add a device

POST/api/devices
Admin. Needs an unlock token (x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.

Adds a controller by kind: WLED by address (its LED count is read from it), a virtual room, Govee, OpenRGB, Hue (press the link button first), Nanoleaf (hold the power button first), LIFX, WiZ, Kasa, Yeelight, Twinkly, or a DMX universe. It is placed in the room by itself. Answers the device; adding one that is already there answers that one.

Request body application/json

object
hoststringrequired
namestring
ddpPortinteger
ledsinteger
forceboolean

Add it even when it doesn't answer.

Responses

200OKapplication/json
idstringrequired

d…

namestringrequired
hoststringrequired

Its address (virtual for a virtual room).

kindstring

Left out for WLED.

One of "govee" "openrgb" "hue" "nanoleaf" "lifx" "wiz" "kasa" "yeelight" "twinkly" "dmx"
ledsinteger
ddpPortinteger
enabledboolean
virtualboolean
protocolstring
One of "ddp" "e131" "artnet"
universeinteger
maxAmpsnumber
0 to 500
mAperLednumber
5 to 200
goveeModestring
One of "color" "segments"
goveeSegmentsinteger
lightLatencyMsinteger

This light's own delay set by hand, 0-500 ms (light timing). Left out: estimated.

0 to 500
lightobject

Smart lights: what was found (for example zones) and their options.

hueobject

Hue bridges only.

nanoleafobject

Nanoleaf only.

fixturesobject[]

DMX devices only.

healthobject | null
400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequired

What went wrong, in a sentence for people.

403Locked, or not allowed.application/json
errorstringrequired

What went wrong, in a sentence for people.

Request
curl -X POST 'http://localhost:8080/api/devices' \
  -H 'content-type: application/json' \
  -d '{
  "host": "192.168.1.42",
  "name": "Desk strip"
}'
Response
{
  "id": "d4k2x9",
  "name": "Desk strip",
  "host": "192.168.1.42",
  "ddpPort": 4048,
  "leds": 120,
  "enabled": true
}
Edit on GitHub