HowTo: Node Red – Integrate 433Mhz wireless wall button

A another The 433Mhz wireless wall switch is a practical find during my forays into the world of electronic products. It can be easily integrated into NodeRed or any other SmartHome system using the RF bridge.

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 material:

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


The wall switch

The radio wall switch essentially consists of a flat housing incl. three easily accessible touch surfaces.

Top view of the wall switch including the supplied adhesive strips.
Rear view of the wall switch. The wall pushbutton can also be mounted with screws through the slotted holes on the back.
View of the wall switch with opened housing. Opening the housing is necessary, among other things, to change the battery. However, this also works when the wall switch is already mounted on a wall.
An L828 12V battery is required to operate the wall switches. This type of battery is also known as MN27, A27, V27GA, L828 and GP27A.
Close-up of the circuit board.
Close-up of the electronic components.
Mounting example for the wall switch. I have glued the wall switches on the inside of the door frame, because I did not want to stick them on the wallpaper. So the buttons can be removed again when moving out without removing the complete wallpaper with. 🙂

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, Mini pushbutton or SOS button is used. 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 use this code, but you have to set the RF codes of the push buttons of your wall switch. This is described in the next step.

Of course you also have to update the configuration for your MQTT server and if necessary the topic under which you receive the RESULTS of your RF bridge.

Node code overview
[{"id":"31d6699d.0dce56","type":"function","z":"169c0bb.fea38f4","name":"Button-Press left detected","func":"if (msg.payload.RfReceived!==undefined)
{
    if (msg.payload.RfReceived.Data==="RfData")
    {
        msg.payload=1;
        return msg;
    } 
}","outputs":1,"noerr":0,"x":850,"y":3460,"wires":[["257f3901.e15e46"]]},{"id":"257f3901.e15e46","type":"debug","z":"169c0bb.fea38f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":3460,"wires":[]},{"id":"bb0242e1.88c8c","type":"comment","z":"169c0bb.fea38f4","name":"Wall Switch","info":"","x":390,"y":3420,"wires":[]},{"id":"57e050ec.b8da4","type":"function","z":"169c0bb.fea38f4","name":"Button-Press middle detected","func":"if (msg.payload.RfReceived!==undefined)
{
    if (msg.payload.RfReceived.Data==="RfData")
    {
        msg.payload=1;
        return msg;
    } 
}","outputs":1,"noerr":0,"x":860,"y":3540,"wires":[["80d70cd8.e9fa5"]]},{"id":"80d70cd8.e9fa5","type":"debug","z":"169c0bb.fea38f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":3540,"wires":[]},{"id":"dbc8c01a.24266","type":"function","z":"169c0bb.fea38f4","name":"Button-Press left detected","func":"if (msg.payload.RfReceived!==undefined)
{
    if (msg.payload.RfReceived.Data==="RfData")
    {
        msg.payload=1;
        return msg;
    } 
}","outputs":1,"noerr":0,"x":850,"y":3620,"wires":[["67d1b87a.34e048"]]},{"id":"67d1b87a.34e048","type":"debug","z":"169c0bb.fea38f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1090,"y":3620,"wires":[]},{"id":"34c8a696.75339a","type":"mqtt in","z":"169c0bb.fea38f4","name":"","topic":"tele/RfBridge/RESULT","qos":"2","broker":"c94e86db.dfcde8","x":440,"y":3540,"wires":[["cf0b5a42.f4e4e8"]]},{"id":"cf0b5a42.f4e4e8","type":"json","z":"169c0bb.fea38f4","name":"","property":"payload","action":"","pretty":false,"x":640,"y":3540,"wires":[["57e050ec.b8da4","31d6699d.0dce56","dbc8c01a.24266"]]},{"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 also set the RF code of your wireless pushbutton. This RF code is a unique ID for each button and also different for each 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 one of the buttons on your wall switch, the radio message sent by it including the RF code is displayed in the console of your RF bridge. You have to copy/remember this RF code (marked in blue in the screenshot), because you have to enter it into one of the imported nodes.
Switch to the NodeRed configuration view and open the menu of the function node "Button-Press detected". 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.