The IKEA TRADFRI button E1743 is one of the most used buttons in my SmartHome. It is very cheap at (currently) 6 euros per piece and at the same time the quality is very good and the scope of delivery is decent.
The practical thing about it is that it can be used to control up to four functions. The two buttons can be tapped briefly or held down for a long time. Each event is differentiated, which means that, for example, up to four devices can be switched (toggled).
These four functions can also be used, for example, to switch and dim a lamp. It is switched on or off by briefly pressing a button. The dimming function can then be activated with a long press of the button.
Ultimately, you can use the NodeRed code offered below to determine which functions you want to assign to the different button functions of the IKEA Tradfri button. 🙂
How to connect the button to your Zigbee network and with Node Red can evaluate is described in the following article.
I know the following tips are always somehow annoying and seem unnecessary. But unfortunately, many people who knew "better" have already lost eyes, fingers or other things or injured themselves due to carelessness. In comparison, a data loss is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth an injury or other trouble.
Affiliate links/advertising links
The links to online stores listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.com will receive a commission from the respective online store or provider. For you the price does not change. If you make your purchases through these links you support Nerdiy.com to be able to offer more useful projects in the future. 🙂
Before you start this article, you should have prepared a Raspberry Pi so that it can be reached via the network and controlled via SSH. Of course, zigbee2mqtt and NodeRed should also be installed and configured.
The following articles describe what needs to be done to prepare the Raspberry Pi.
- RaspberryPi - Setup for Nerdiys!
- RaspberryPi – The first configuration!
- RaspberryPi - Controlling the RaspberryPi via SSH
- NodeRed - Installing NodeRed on the RaspberryPi
- Zigbee - Installing zigbee2mqtt on the Raspberry Pi
- Zigbee - register devices, sensors and actuators with zigbee2mqtt
In the following lists you will find all the parts you need to implement this article.
|1x||Screwdriver set Buy at Amazon|
|1x||SD card reader Buy at Amazon|
Log into the NodeRed configuration interface
Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.
Enable Zigbee2mqtt Dashboard
In my opinion, the easiest way to add new devices to your Zigbee network is to use the zigbee2mqtt dashboard. In case you haven't activated this yet, you will find helpful hints in the article Zigbee - Administration of Zigbee2mqtt via the dashboard.
Register the button at zigbee2mqtt
Before you can evaluate the button using NodeRed and react to a button press, you must of course integrate the button into your Zigbee network.
I have a little more detail on how to integrate devices into your own Zigbee network in the article Zigbee – register devices or sensors and actuators with zigbee2mqtt described. The following two steps summarize this briefly.
To put the Tradfri button into pairing mode, you have to insert the battery and the marked button on the back
- Press 4 times
The LED in the button should then flash and the button should connect to your Zigbee network shortly afterwards.
You can track the status of the connection process in the zigbee2mqtt log.
Import node code
The dashboard node should already be installed and configured so that you can also control your Zigbee device via the NodeRed dashboard. You can find information about this in the following article.
If you also want to be automatically reminded of a dead battery in your Zigbee button via pushbullet, you should also have the pushbullet node installed. You can find information about this in the following article.
After that, all you have to do is import the NodeCode linked below into your NodeRed environment. Information on how to import NodeRed code can be found in the article NodeRed - Import and export node code .
As always, you can find the NodeRed code in the Nerdiy Git repository under the following link:
Of course you still have to adapt the code to your button. In order for this to work correctly, you still have to enter the IEEE address or the "friendly name" of your button in the NodeRed code.
To do this, open the properties of the marked node and enter your IEEE address in the marked area under "Payload...".
In order for the update function to work via the NodeRed dashboard, you must also enter the address here in the marked area.
At the point marked here you can also adjust the message that is sent as soon as the charge level of the button's battery falls below 20%.
If you want to use several of these buttons, you should change the name of the marked variable.
This is not absolutely necessary but helpful if you want to save the state of charge in an external variable.
You can of course also use the newly registered Zigbee device via the zigbee2mqtt Dashboard control or read out.
In the following category I have also listed other Zigbee devices which can be controlled or read out with the NodeRed code offered there.
More articles on the topic
I have summarized other articles on the subject of Zigbee and zigbee2mqtt in the following category. There you will also find articles on various Zigbee devices and how they look like NodeRed can be controlled.
Have fun with the project
I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are also always welcome 🙂 .
P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do it because I enjoy it, but if you think it's cool that I share the info about it with you, I'd appreciate a small donation to the coffee fund 🙂 .
I would like to use NodeRed to control the lamps that I have controlled so far with the E1743 switch. How do I fix that?
what lights are you controlling? Do you know your current code? above https://pastebin.com/ provide? 🙂