HomeHome AutomationUsing IKEA TRADFRI dimmers in NodeRED

Using IKEA TRADFRI dimmers in NodeRED

Let's dim EVERYTHING!

Some time ago, I purchased a set of IKEA smart things. I wanted to use nice looking remotes with my Xiaomi MiHome ecosystem, but it turns out only IKEA lightbulbs were supported and I ended up not using IKEA stuff much due to its limitations. Thanks to your recommendations I got the CC2531 USB Zigbee sniffer and now I can use the IKEA Zigbee bulbs and remotes with anything I want.

IKEA TRADFRI dimmers in NodeRED

Before you can actually use any of the IKEA products, you will have to purchase the CC2531 USB Zigbee sniffer and flash it. Don’t worry, all you need is a Raspberry Pi a couple of wires and 3 min of your time. It’s worth the time and effort. Once this is done, install Zigbee2MQTT, pair your device and you are ready to play!

In this article, I will show you how to use the IKEA TRADFRI dimmer in NodeRED to dim a light or a group of lights. The script is very simple.

Replicating the dimmer in NodeRED

When IKEA TRADFRI dimmer is turned, it produces MQTT payload. This payload contains more information, but for the purpose of this tutorial I only need the value of "brightness". The IKEA TRADFRI dimmer updates frequently, which is also something we have to deal with.

IKEA TRADFRI dimmer in NodeRED reports back to MQTT IN node under the topic: zigbee2mqtt/dimmer1 (Zigbee2MQTT default topic/device_name). Each time the movement is detected a new MQTT message is sent. These messages can reach higher than ideal posting rate without changing any values. This will clog the system and frankly speaking, we don’t need that much resolution to create a responsive controller.

Buy USB Zigbee Stick CC2531

Buy it using these links to support NotEnoughTech.

To prevent the overflow I used 2 nodes RBE and Delay (set in rate limit mode). RBE blocks duplicated values from posting, while the rate limit, sends 2 messages per second. It works well.

IKEA TRADFRI dimmer sends a string, which once translated to JSON, stores the information we need in msg.payload.brightness. I can use a function node to submit a correct payload back via MQTT OUT to zigbee2mqtt/spotlight1/set :

var brightness = msg.payload.brightness;
 msg.payload = {
     "brightness": brightness
 }
 return msg;

I could submit the payload directly, but I have noticed that my Zemismart Downlight was more responsive if one value was submitted.

Conclusion

Using IKEA TRADFRI dimmers in NodeRED is very easy. If you change the colour using a smart assistant, you will be able to dim the lights of that colour. If you would like to override that – with each payload add the colour value to use the IKEA TRADFRI dimmer to revert the colour back and then adjust the brightness. If you have any questions, just leave it in this Reddit thread.

Project Download

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

PayPal

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

Patreon

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

image/svg+xml

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

client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image
client-image

Learn NodeRED

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

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

Best Automation Projects

Tuya SDK for beginners: Intro to Tuya Cloud API

0
Working with Tuya Cloud API. A guide to Cloud automation for beginners, get started with REST!

NEST your old thermostat under $5

0
Nest-ing up your older thermostat under $5

Nora – Google Assistant in NodeRED

0
Integrate Google Assistant with NodeRED thanks to Nora - NodeRED home automation

DIY Smart Washing Machine – for about 15 bucks!

0
Learn how to add washing machine notifications to your Google Home on the cheap

Sonoff Zigbee Bridge – review

0
Sonoff line up will soon include Sonoff Zigbee Bridge and more Zigbee sensors - here is the first look

Smart Home

Remotes aren’t done with us yet: SwitchBot Remote

0
If you hate having 20 remotes hidden in your sofa, or your parents despise talking to Alexa to turn the lights on - SwitchBot Universal Remote is here to deal with all this!

We’ve seen this before: SwitchBot K10+ PRO

0
This is an odd one. Building on the success of SwitchBot K10+ they released SwitchBot K10+ PRO - but is the experience actually better?

Is this the smart panel we have waited for?

0
ITEAD has released a new smart panel: Sonoff NSPanel Pro 120 - have they learned the lesson from the terrible launch of the original Pro? Let's see what's new.

Aqara FP1E detects motionless humans

0
This isn't exactly a new device, it's an interaction of the original Aqara presence sensor. Aqara FP1E brings Matter, ZigBee and new triggers to your smart home

SwitchBot S10: cleaning re-imagined!

0
SwitchBot S10 promises unattended vacuuming and mopping so you can focus on things you love and care for. Does it deliver?