node-tradfri-restapi
v1.5.2
Published
Wrapper to node-tradfri-argon package as a micro service/REST API to read and control IKEA TRÅDFRI Lights
Downloads
34
Readme
Node TRÅDFRI REST-API
What
A simple REST-API implementation of node-tradfri-argon with the following commands
/tradfri/deviceids
will provide an array of device ids/tradfri/groupids
will provide an array of group ids/tradfri/devices
will provide a full list of all devices including meta data/tradfri/groups
will provide a full list of all groups including devices id's and meta data/tradfri/all
will provide a full detailed list of groups and devices/tradfri/device/:deviceid/:state
will set the state of a device (on/off). E.g. /tradfri/device/17101/on/tradfri/group/:groupid/:state
will set the state of a device (on/off). E.g. /tradfri/device/11007/off/tradfri/register
will provide a PSK for defined client
First release is a bit of a quick one. Exceptions needs to be managed and include toggle as an option.
How
Setup libcoap as explained below
- Setup libcoap as explained below
- Rename
./config/default.json-sample
to./config/default.json
and update with the IKEA hub information - Run using node >4.4.7
- Register identity and put returned PSK to config
Compiling libcoap
Install libcoap as descibed below for Debian/Ubuntu/Raspbian: (credits to homebridge-tradfri)
$ apt-get install libtool git build-essential install autoconf automake
$ git clone --recursive https://github.com/obgm/libcoap.git
$ cd libcoap
$ git checkout dtls
$ git submodule update --init --recursive
$ ./autogen.sh
$ ./configure --disable-documentation --disable-shared
$ make
You'll find the coap-client binary in ./examples