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 with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

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

Sonoff R3 DIY mode & why it sucks

Long awaited Sonoff R3 DIY mode is even worse than I expected.

IKEA TRADFRI Wireless dimmer in NodeRED

Thanks to NodeRED you can use IKEA TRADFRI Wireless Dimmer to interact with everything

NEST your old thermostat under $5

Nest-ing up your older thermostat under $5

Things they don’t tell you about IKEA Trådfri

There are things you should know about IKEA Tradfri before you make your purchase

Alexa and NodeRED integration

Hey Alexa, turn the lights on!

Smart Home

Shelly 1PM: “PM” stands for Printer Manager

I decided not to use my Shelly 1PM with lights. I had a much better idea in mind! I'm going to show you how to get your printer ready for automatic ON/OFF and print price calculations including electricity used.

Monitor 2 gangs at once with Shelly 2.5

Taking a closer look at Shelly 2.5 switch with 2 switch/gang support and individual power metering

Sonoff DUALR3 has a hidden secret

Hands on on new product from ITEAD: Sonoff Dual R3

M5Paper received UIFlow support

Much desired support for UIFlow for M5Paper has arrived! If you needed an extra reason to get it, now it's the time.

PIR sensor like no other: Shelly Motion

Shelly enters IoT sensor space with their Shelly Motion - a WiFi enabled PIR sensor that can last up to 3 years!