HowTo: Node Red – Integrate 433Mhz mini button

On my (almost daily) forays through the wonders of the electronic product world, I recently came across this little guy:

A 433Mhz wireless button, about two euros in size, which is powered by a CR2024 battery and can be discreetly placed in pretty much any location. It has just one button and a signal LED, making it strongly reminiscent of the Amazon Dash buttons.

Thanks to NodeRed and the Sonoff RF Bridge, it can be easily integrated into your SmartHome. This means that smart lamps or sockets can finally be switched directly "on site".

How this works and what you have to consider is explained in the following article.


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, 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 injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Helpful articles:
Of course, NodeRed should already be installed so that you can use this configuration. In addition, the Sonoff RF Bridge should already be prepared.
How to prepare this and a RaspberryPi for it and then install NodeRed on it is described in the following articles.

The following articles describe what has to be done to prepare the RaspberryPi so far:
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH

NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install new nodes
Sonoff - 433Mhz Rf Bridge with Tasmota firmware flashing

Required tool:
-no-

Required material:

In the following list you will find all the parts you need to implement this article.


Log into the NodeRed configuration interface

Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.

View of the login dialog. Here you have to enter the login data that you specified during the configuration of the login. You can find information about this in the article NodeRed - set up user login.

The mini push-button

At its core, the push-button consists of three housing parts and a circuit board with a CR2024 button cell attached to it.

Here is a size comparison with a one-euro coin.
The large button and the LED below it are clearly visible. The LED confirms a button press by briefly lighting up red.
The housing can be opened - to change the battery, for example - by loosening the two Phillips screws on the underside.
The button (in the middle) and the previously mentioned red LED (in the upper area of the board) can then be seen on the front of the board.
The CR2024 battery holder can be seen on the back. Experience has shown that these last quite a long time, as the button only consumes energy for the brief moment it is pressed.
Close-up of the electronics. Unfortunately, as is so often the case with items from Asia, the names of the ICs have been removed or are not recognizable.

Log into the NodeRed configuration interface

Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.

View of the login dialog. Here you have to enter the login data that you specified during the configuration of the login. You can find information about this in the article NodeRed - set up user login.

Import node code

The following node code is similar to the code used for the window contact or wall switch. It triggers an action as soon as a radio message with the appropriate data field is received via the Sonoff RF Bridge flashed with the Tasmota firmware. You can accept the code in this way, but you still need to set the RF code of your wireless switch. This is described in the next step.

How to import your NodeCode is described in the article NodeRed - import and export node code described.

In addition, you must of course update the configuration for your MQTT server and, if necessary, the topic under which you receive the RESULTS from your RF bridge.

Node code overview
[{"id":"63d46c34.db4434","type":"function","z":"169c0bb.fea38f4","name":"Button-Press detected","func":"if (msg.payload.RfReceived!==undefined)
{
    if (msg.payload.RfReceived.Data==="RfCode")
    {
        msg.payload=1;
        return msg;
    } 
}","outputs":1,"noerr":0,"x":840,"y":3240,"wires":[["699ae5dd.9440cc"]]},{"id":"699ae5dd.9440cc","type":"debug","z":"169c0bb.fea38f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1070,"y":3240,"wires":[]},{"id":"47af449c.7be14c","type":"comment","z":"169c0bb.fea38f4","name":"433Mhz-Mini-Switch","info":"","x":430,"y":3160,"wires":[]},{"id":"21d35009.da61c","type":"mqtt in","z":"169c0bb.fea38f4","name":"","topic":"tele/RfBridge/RESULT","qos":"2","broker":"c94e86db.dfcde8","x":440,"y":3240,"wires":[["7bef088d.ab9cb8"]]},{"id":"7bef088d.ab9cb8","type":"json","z":"169c0bb.fea38f4","name":"","property":"payload","action":"","pretty":false,"x":640,"y":3240,"wires":[["63d46c34.db4434"]]},{"id":"c94e86db.dfcde8","type":"mqtt-broker","z":"","name":"Server-Mqtt","broker":"server","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Reading out and setting the correct RF code

In order for the above-mentioned node code to work, you must set the RF code of your wireless push-button. This RF code is a unique ID for each push-button and is also different for each push-button.

Open the console of your RF-Bridge. Here you will be informed about current events on your RF-Bridge. Among other things, received RF codes are also displayed there.
As soon as you press the button on your radio button, the radio message sent by it, including the RF code, is displayed in the console of your RF-Bridge. You must now copy/remember this RF code (marked in blue in the screenshot), as you must now enter it in one of the imported nodes.
To do this, switch to the Nodered configuration view and open the menu for the "Button-Press detected" function node. There you replace the part RfCode by your previously memorized RF code.

After that click on Done, sends the changes to the NodeRed server and from now on you should get a notification via the debug node every time you press the button.

If you don't receive any, please check if you need to update the topic under which you receive the RESULTS of your RF bridge.


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 always welcome. 🙂

PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert

This site uses Akismet to reduce spam. Learn how your comment data is processed.