Ikea TRÅDFRI for Domoticz

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, Rob and Marke 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:
Domoticz 2020.1
Ikea Tradfri plugin v0.9.2

Prerequisites Ikea TRÅDFRI plugin

Tested with

  • 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.
    A very easy way to find the IP address of your Ikea Tradfri gateway is to use the “Fing” app on your phone.
    Fing app for Android (LINK)
    Fing app for Apple iPhone (LINK)
    See the image below for an example result on the app.
  • KEY is the security-key located on the bottom of the gateway (displayed at the orange bar in the picture below).
  • For example:
    python3 tradfricoap.py config gB2pK1YUFi5A2hMN
    python3 tradfricoap.py config gB2pK1YUFi5A2hMN

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
Configure the hardware device in Domoticz
Configure the hardware device in Domoticz

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 plugin uses this value to poll the state from the gateway. Thus it can take this amount of time for Domoticz to update the state of the Domoticz switches when you use the regular Ikea remotes.

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, 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. Configuring this value lower could make Domoticz start to ‘hammer’ the Ikea Tradfri gateway asking it for the latest states…

If you use Domoticz to change the states of the Ikea devices, and not for example with the Ikea remotes, you can also consider to switch this off (set Observe changes to “No”).

5. Enable devices

If everything is correctly installed and configured, you should now see a list of Ikea devices:

Example of Ikea devices in Domoticz
Example of Ikea devices in Domoticz

Sources & credits


  1. Hafi
    February 3, 2020

    Mooie plugin werkte op een Raspberry Pi 2B+ met Buster direct op een Raspberry Pi 3B+ is het niet te installeren omdat het een bestand mist.

  2. Rob Camphorst
    February 27, 2020

    Alle stappen werken prima met alleen een kleine wijzing voor stap 2 2. Configure and test Tradfri COAP:

    python3 tradfricoap.py config IP KEY werkte bij mij met python3 plugin.py config IP KEY
    En idem voor python3 tradfricoap.py list werkt bij mij met python3 plugin.py list

    Mogelijk dat dit in de tussentijd veranderd is? Maar verder helemaal blij met je uitleg 🙂



    • SANCLA
      February 28, 2020

      Dag Rob,

      Gelukkig heb je het werkend gekregen en dank je wel voor de feedback. Ik zal op korte termijn deze how-to reviewen, het kan dus inderdaad zo zijn dat door de ontwikkelingen van de IKEA plugin de stappen niet helemaal meer knoppen. Maar met Corona heb ik daar binnenkort misschien wel tijd voor ;-).

  3. Jan
    March 3, 2020

    Mooi stappenplan. Maar hier werkt het niet. Alhoewel ik wel de plugin te zien krijg in Domoticz.
    Ik krijg echter een foutmelding tijdens het stappen plan 2 Configureren en testen.

    Ik krijg bij beide commando’s (python3 tradfricoap.py config IP KEY
    python3 tradfricoap.py list) de volgens foutmelding :

    python3: can’t open file ‘tradfricoap.py’: [Errno 2] No such file or directory

  4. Mark Diesel
    March 5, 2020

    Op mijn Domoticz installatie werkte de plugin eerst niet ,
    ‘connection timed out’

    na het installeren van de coapcmd
    – bash /home/pi/domoticz/plugins/IKEA-Tradrfri/install_coapcmd.sh
    en het omzetten van de api
    – python3 plugin.py api coapcmd #use coapcmd

    Testen met:
    python3 plugin.py config IP KEY #geeft status info
    python3 plugin.py list # geeft device info

    In Domoticz heet de plugin nu IKEA Tradfri 0.91 ipv IKEA Tradfru plugin coap-version
    Deze kiezen in Hardware, daarna apparaten toevoegen via Devices/Apparaten

    Raspberry Pi ZeroW – Buster-

    March 5, 2020

    Thanks Rob Camphorst and Mark Diesel for the feedback!
    The guide has been updated accordingly to reflect the latest changes by the developer…

  6. Rien
    March 31, 2020

    Nice plugin. The first one that really works.

    Do you have adding light color planned for ikea lights that are able to change the white light color?. I use three ikea led panels in the living room and it would be great if its also possible to change the color temperature of them

    • SANCLA
      March 31, 2020

      Hey Rien,

      Thanks for leaving me a message!
      First, the developer of this plugin is moroen, he’s a lot better at coding then me.
      As a trade off I seem to be better at writing tutorials, documentation, etc.

      I personally have the colored light bulb from Ikea (this one) and a few white only bulbs that can change to warm white and dim.
      This works and integrates very well in Domoticz.
      I do not know if the panels are (already) supported with this plugin.

      However, I know that the developer is constantly developing this plugin further and further.
      You can always send his a message on the Domoticz forum or with Github (Github link is at the beginning of this tutorial).

  7. Marke
    May 11, 2020

    Thanks for the walkthrough. Helped a lot setting everything up. Toughest part was finding the IP address of the gateway!

    • SANCLA
      May 11, 2020

      Hi Marke,

      Thank you for the kind feedback!
      I adjusted the tutorial so it includes a better way to find the IP address of the Tradfri gateway.

Add a Comment