Step-by-step how-to guide install the Ikea Tradfri plugin on Raspberry Pi with the latest Raspbian Buster image and Domoticz.
As of the beginning of January, developer moroen changed a few things with this plugin. The ‘old’ “IKEA-Tradfri-plugin” is no longer used, but is completely switched to the new “pycoap” based plugin. With that change there are also new instructions to install and activate this plugin.
This how-to as published on this website has been adjusted accordingly and has been tested with the latest software versions. If you still encounter problems or errors despite this, please let me know so that I can adjust this guide accordingly…
See the specific instructions documented by this developer, on where this post is based on:
This how-to is part of a bigger series of Domoticz how-to’s on sancla.com!
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, September 2019
- Domoticz Stable 4.10717
- Ikea tradfri and pycoap plugin dated January 14th, 2020
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 -r requirements.txt sudo systemctl start domoticz.service
2. Configure and test Tradfri COAP:
python3 tradfricoap.py config IP KEY python3 tradfricoap.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 (or 10 for quicker response, less stable!)
- 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 gateway, 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.
However, with the Raspberry Pi 4 packing a lot of hardware performance, a lower value tends to work fine to. But when stacking a lot of rules, programs, plugins and devices, this could become an problem again so don’t forget to remember this particular configuration page…
5. Enable devices
If everything is correctly installed and configured, you should now see a list of Ikea devices: