Add your own functionality if IKEA haven't made the feature you need.
It is able to control all lights and plugs across all rooms or scenes.
Endpoint | Request object | Description |
---|---|---|
/rooms | none | Get all rooms info |
/rooms/get-single-room | room-request | Get a single room info |
/rooms/set-room | room-request | Set a scene in a room |
/devices | none | Get all devices paired with the bridge |
/devices/get-single-device | device-request | Get a single device |
/devices/set-device | device-request | Control color, brightness and on/off state |
/masterswitch | confirmation-request | Turns off everything |
/masterswitch/all-on | confirmation-request | Turns on everything |
The api takes different JSON request objects, Depending on the operation.
Used to get information of the room and control the scenes in the room
{
"room": {
"name": "Living Room",
"scene": "Relax"
}
}
"name"
- The name of the room
"scene"
- The scene to set
Used to get information of a device and control the device
{
"deviceNameOrId": "65537",
"action": {
"name": "brightness",
"value": "37"
}
}
"deviceNameOrId"
- Pass either the name or id of the device
"name"
- Name of the commmand you want, can be one of: "on" | "off" | "toggle" | "brightness" | "color" | "hue" | "saturation" | "colorTemp"
.
"value"
- The value of the action. e.g. for brightness pass a value betweeen 0-100
and for colors it could be "f1e0b5"
.
"transitionTime"
- Applies to action names: "brightness" | "color" | "hue" | "saturation" | "colorTemp"
default is 0.5 seconds.
Used to confirm the masterswitch.
{
"confirmation": true
}
"confirmation"
- Should always be true
"force"
- Optional: Control individual devices as opposed to individual groups
BRIDGE_KEY
- The security key on the back of the bridge.SERVER_PORT
- The port the server should run on.NODE_ENV
- Either production or development.
To comply with IKEA's requests, the security code is not stored permanently in the application. Instead, the conf
package is used to store it locally in a different folder.
Heavily inspiret by: https://github.com/wschenk/tradfri-cli
and the article from the same author: https://willschenk.com/articles/2019/controlling_ikea_tradfri_with_node/
And a big thanks to this lib: https://github.com/AlCalzone/node-tradfri-client
Thanks alot, couldn't have done it without that!