Step-by-step how-to guide install the Ikea Tradfri plugin on Raspberry Pi with the latest Raspbian Buster image and Domoticz.
This guide has been updated on March 5th 2020 to reflect the latest changes and designs by developer moroen.
Thank you Mark Diesel and Rob Camphorst for the feedback!
This how-to is part of a bigger series of Domoticz how-to’s on sancla.com
This tutorial has been verified with:
Ikea Tradfri plugin v0.9.2
Prerequisites Ikea TRÅDFRI plugin
- Running Domoticz installation with stable Raspbian Buster release and SSH access.
See my previous post for a how-to:
- Raspberry Pi 4 (MEM 2GB with 16GB sd-card)
- Raspbian Buster Lite 4.19, Februari 2020
- Domoticz Stable 2020.1 (compile date 22-3-2020)
- Ikea tradfri plugin v0.9.2
1. Install packages and requirements
Connect to your running Raspberry Pi with Raspbian with SSH.
Then execute these command (it’s easier to copy-paste them into your SSH session if your clients supports this -> PUTTY!):
sudo systemctl stop domoticz.service sudo apt update -y && sudo apt upgrade -y sudo apt install golang python3 python3-dev python3-pip -y cd /home/pi/domoticz/plugins/ rm -rf IKEA-Tradfri/ git clone https://github.com/moroen/IKEA-Tradfri-plugin.git IKEA-Tradfri cd IKEA-Tradfri sudo -H pip3 install --upgrade pip sudo -H pip3 install --upgrade setuptools sudo -H pip3 install -U py3coap sudo systemctl start domoticz.service
2. Configure and test Tradfri COAP:
python3 plugin.py config IP KEY python3 plugin.py list
- IP is the address of the gateway.
See the Raspbian and Domoticz how-to for how to find IP addresses:
- KEY is the security-key located on the bottom of the gateway (displayed at the orange bar in the picture below).
WITHOUT THE “-” DASHES !
- For example:
python3 tradfricoap.py config 192.168.0.123 gB2pK1THFi5A2hMN
3. Restart Domoticz
sudo systemctl restart domoticz.service
4. Enable IKEA-Tradfri in Domoticz
Go to your Domoticz webinterface and then to hardware, to enable the new Ikea hardware device. Fill in the hardware configuration as follows (the screenshot is for indication and has other values!):
- Enabled: Enabled
- Name: IKEA Tradfri
- Type: IKEA Tradfri Plugin – pycoap version
- Data Timeout: Disabled
- Add groups as devices: Yes
- Observe changes: Yes
- Polling interval (seconds): 30
- Transition time (tenth of a second): 10
- Debug: False
Regarding the polling interval seconds:
To observe changes when switched using another method than domoticz (for an Ikea remote for example), enable “Observe changes” and specify a poll interval in seconds.
The minimum poll interval is 5, and the interval should be a multiple of 5 seconds. Using a too short interval tends to freeze the Ikea gateway itself, requiring cycling the power of the gateway to restore communication. A polling interval of 30 seconds or greater seems to be fine and reduce the occurrence of freezes.
5. Enable devices
If everything is correctly installed and configured, you should now see a list of Ikea devices: