Home Home Automation IKEA TRADFRI light bulbs in NodeRED

IKEA TRADFRI light bulbs in NodeRED

Using IKEA light bulbs in NodeRED never been so easy!

I have been missing a short write up to how to use the IKEA light bulbs in NodeRED, so it’s time to share some knowledge. I actually had to go and visit my local IKEA again to get the colour light bulb (LED1624G9) as I only had the ones that support dimming (LED1622G12). While I was there I picked up a smart socket with a Zigbee remote, so expect the write up soon.

Adding IKEA light bulbs in NodeRED (Zigbee2MQTT)

I actually run into a hitch when adding the lights, I’m not entirely sure what caused it but I was not able to control my colour light bulb. In all honesty, I’m not sure what fixed it either, but after 3-5 successful power-off cycles on both Zigbee2MQTT & IKEA light bulb side, I was able to make the devices to talk to each other again.

To reset the light bulb, you have to flip it on and off 6 times (start with ON position) fairly quickly – see this video. Then wait for a brief flash, which will confirm that the procedure has been done correctly. Before you can add the bulb, power it off, then on again. Your Zigbee USB stick should be able to see it.

Once you have paired all IKEA bulbs (you can see this if you start Zigbee2MQTT in terminal:

cd /opt/zigbee2mqtt
npm start

you should edit the configuration.yaml file and name the new devices to something you will remember. It’s a good practice (since the IKEA bulbs look-alike) to use a permanent pen to mark the bulbs too! You can learn more about flashing the CC2531 and adding more devices in the corresponding links.

Let’s talk NodeRED

Both IKEA light bulbs are controllable in NodeRED. I have the E27 600lm colour bulb (LED1624G9) and dimmable E27 1000lm 2700k (LED1622G12). There is an added benefit of actually having a couple of Zigbee lights in your house as they expand the mesh network.

Getting the IKEA light bulb status

To control the bulbs, you will need to know the assigned name of the bulb (also your Zigbee default topic) and the command structure. Every now and then the device will post an update to the topic (zigbee2mqtt\bulbname) which will look like this:


You can force the update by sending the payload:

 {   "state": "" } 

to zigbee2mqtt/bulbname/get. Note that the colour is received in X,Y values. You can read more about conversion here.

Setting IKEA light bulbs in NodeRED

To set the bulb to your desired settings, you will need to use this topic structure: zigbee2mqtt/bulbname/set. Then pass one or more arguments from this JSON file:

 {"state": "ON", // Or "OFF", "TOGGLE"
  "brightness": 255,
  "color_temp": 155,
  "transition": 3,
  "alert": "select",               // values (select,none,lselect) blink
  "color": {"x": 0.123,            // XY color 
            "y": 0.123}                
  "color": { "r": 46,              // RGB Colour
             "g": 102,
             "b": 193} 
  "color":  {"hex": "#547CFF"}     // HEX color  
  "color":  {"hue": 360,           // Hue and/or saturation color
             "saturation": 100} 

Despite the colour being provided as XY 1931 colour space, we can set the colours with RGB or HEX. Only pick one of the “color” setters in the payload above.

Let’s create an interactive picker that we can use to set IKEA light bulbs in NodeRED to different colours. The nodeRED dashboard comes with colour picker, so this won’t be very hard. All I need is a slider to control the brightness and I can pass the values over.

First, I have to store the colour values in a flow variable. Each time the bulb updates, I want to make sure I have this value at my disposal as changing the brightness without this causes errors.

var color = msg.payload.color;
 flow.set("ikeabulbc1_color", color);
 return msg;

Then I’m ready to deploy a slider linked to the following function node:

var x = msg.payload;
 var color = flow.get("ikeabulbc1_color");
 msg.payload = {"brightness": x,
     "color" : color
 return msg;

To change the colour, all I need is a colour value in HEX to be passed over to my function node:

var x = msg.payload;
 msg.payload = {"color": {"hex":"#"+x}}
 return msg;

A payload formatted like this will send the colour value to IKEA light bulb. Set this up for each bulb you own and you are all set.

Buy USB Zigbee Stick CC2531

Buy it using these links to support NotEnoughTech.


Thanks to Zigbee2MQTT you can mix and match your IKEA light bulbs in NodeRED with different ways of driving it. It’s simple and the set up above only takes a couple of minutes to establish. Let me know if you have any questions in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.


Nothing says "Thank you" better than keeping my coffee jar topped up!


Support me on Patreon and get an early access to tutorial files and videos.


Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

Smart Ideas with

Automate your space in with these ecosystems and integrate it with other automation services

Learn NodeRED

NodeRED for beginners: 1. Why do you need a NodeRED server?

To server or not to server? That's a very silly question!

Best Automation Projects

ESP8266 WIFI lights under $5

Your Sonoff device can't do this!

Free wireless doorbell (Amazon Dash button hack)

The most terrifying situation I can imagine* is missing a parcel

New Amazon Dash Buttons

You can teach new buttons old tricks!

ESP8266 ceiling light – demo

Testing the ESP8266 as a WIFI light controller

Try Tasker and Raspberry Pi for your home automation needs!

Raspberry Pi can help you with your Tasker profiles

Smart Home

Army of robots: SwitchBot Curtain

An army of SwitchBot Curtains - adorable CurtainBots to open and close practically any curtains!

Zemismart Roller Shade Driver

Frustrated with UK's roller measurements I reached out for Zemismart Roller Shade Driver

Most affordable smart lightbulbs: Sonoff B02 & B05

ITEAD just dropped a range of very affordable smart Sonoff lightbulbs

Creepy Alexa for Halloween

Turning Amazon Echo into a Creepy Alexa monster for Halloween

How to make Sonoff ZB Mini and ZigBee2MQTT work together

It's time to make Sonoff ZB Mini and ZigBee2MQTT work together!