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

Sonoff Zigbee Bridge – review

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

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

Smart Home

I damaged the cheapest Smart Socket with power metering for you

0
Sonoff S60 has an exeptional price for a smart socket with a power meter - I decided to check it out and see how flashable it is

The end of Tasmota? Sonoff SwitchMan M5 Matter

0
These are one of the least expensive Matter devices to automate your lights. Will Sonoff SwitchMan M5 Matter put an end to Tasmota?

Meros TRV to the rescue?

0
I got my hands on another TRV - this time from Meross. I heard good things about the brand so I wanted to see if Meross TRV would be good to manage smart heating.

Aqara brings Thread sensors but…

0
Aqara brings new Thread sensors to their ecosystem. First sensors to support Matter this way are Aqara Motion and Light Sensor P2 and Aqara Contact Sensor P2

Multi-lights for your ceiling from Aqara

0
This is the biggest light I held in my hands so far. It's ZigBee and it comes from Aqara - meet Aqara Ceiling Light T1M