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

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

Sonoff R3 DIY mode & why it sucks

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

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

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

IKEA TRADFRI Wireless dimmer in NodeRED

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

Smart Home

Best Arduino boards for home automation

0
Would you like to know what are the best Arduino boards for home automation? I pick 3 best boards from Arduino line up

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!

SwitchBot Sensors – there is more to these than you think!

0
SwitchBot Sensors are the latest devices from this ecosystem. Both: contact and motion sensor bring something new to the table

M5Stack Core Ink: the inkling for makers

0
I shall call it The Inkling - M5Stack Core Ink is a great ESP32 based development board for anyone interested in e-ink displays.

M5Stack UnitV2 is the easiest way learn to AI vision and Edge Computing

0
AI vision and Edge computing in a thumb sized device - M5Stack UnitV2 - it's easier than you think!