No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 226 commits behind ggravlingen:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
opentradfri
script
tests
.gitignore
Dockerfile
DockerfileRPI
LICENSE
README.md
requirements_test.txt
setup.cfg
setup.py

README.md

Open Tradfri

This is a Python class to communicate with the IKEA Tradfri (Trådfri) ZigBee-based Gateway.

This is an implementation based on analysis I found here by vidarlo.

A lot of work was also put in by Paulus Schoutsen (@balloob) who took the initial code concept into this class library.

Installation

In order to use the code, you first need to install libcoap as per the following instructions:

$ apt-get install libtool

$ 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
$ sudo make install

Stand-alone

If you want to test this library stand-alone:

$ python3 -i -m opentradfri IP KEY

Where the following variables are substituted:

  • IP is the IP-address to your gateway.
  • KEY is written on the back of your IKEA Tradfri Gateway.

Examples of commands in the prompt:

List all lights:

lights

Set brightnes of item 1 to 50 in lights list:

lights[1].set_light_brightness(50)

Docker

There is a Docker script available to bootstrap a dev environment. Run ./script/dev_docker and you will build and launch a container that is ready to go. After launching, follow the above instructions to test the library stand-alone.