ITEAD contacted me about testing some new equipment and write an unbiased blog post about it. I usually reject all such offers, but this one worked for me. Why? Well, all the stuff they offered was on my shopping list anyway! And my home is quite literally chock full of Sonoff relays, lamps, etc.

So the first thing I started to play with was the SONOFF RF BRIDGE 433. The bridge makes it possible to control switches, doorbells, curtain openers, etc. that uses 433MHz communication frequency. I’m not interested in using the original firmware because I prefer to do my home automation setup in Node-RED. Here’s how it works.

SONOFF RF BRIDGE 433 Upgrade Firmware

USB TTL to Serial Adapter photoSo I decided to try the ESPURNA firmware that works with the SONOFF RF BRIDGE 433. I’ve used Tasmota and ESPEasy on other Sonoff devices but thought that this could be an excellent excuse to try out ESPURNA. There’s a great tutorial on how to flash the new firmware here. Here’s a picture on the guts of the unit. As per usual, you need a USB TTL to Serial Adapter that works with 3.3 volts. You can find them easily on eBay.

The Sonoff RF Bridge opened up, showing its two hand-wound 433 MHz coil antennas, the ESP8266 module and the serial header used for flashing

There is already a soldered header with 3.3 volts, RX, TX and GND available, so they are making it easy to install any firmware of your choosing, instead of the factory one. Great stuff! There’s a switch close to the programming header that needs to be set to off position to disconnect the ESP8285 from the SiLabs 8-bit microcontroller that does all de encoding/decoding of signals. Don’t forget to set it to on again after uploading the firmware!

Connecting Devices Via 433MHz

So I bought some extra 433 switches and remote control. I also got a door sensor, but that one was dead as a doornail (no pun intended), so I have to get it replaced. But no problem getting the remote control to work inside Node-RED. All you have to do is to go to the web interface for the device, select “RFBRIDGE” and press “LEARN” for the on and off switches. The SONOFF RF BRIDGE 433 will beep, and you can press the button, and the hexadecimal code will show up and then you just press the “save” button. ESPurna’s RFBRIDGE configuration page, with Learn, Save and Forget buttons beside the 18-character on and off codes for each switchThe firmware does have six switches, but it can be increased up to a hundred if you modify some settings in the ESPURNA firmware. But there is another way. A way to be able to both receive and send ANY code you want! Directly from Node-RED!

Adding SONOFF RF BRIDGE 433 To Node-RED

To add the switches to Node-RED is easy. I’ve named my RF Bridge SONOFF_RFBRIDGE; you have to replace all the instances to the name you have given your RF Bridge. Add an MQTT node and set the topic to SONOFF_RFBRIDGE/relay/0 and you’ll get a payload of 1 or 0 depending on the switch state of switch 0. To activate a switch via the RF Bridge, just send a “1” or “0” to your MQTT node with the topic DEVICENAME/relay/0. The relays become 0-5.

A Node-RED mqtt in node named SONOFF_RFBRIDGE, subscribed to topic SONOFF_RFBRIDGE/relay/# at QoS 2

I’ve put in SONOFF_RFBRIDGE/relay/# as my topic because using a hash sign receives all codes. I use a Switch Node to get six different outputs to make it a bit tidier. Then it’s easy to add nodes to the switch I’m interested in.

A Node-RED switch node splitting SONOFF_RFBRIDGE/relay/0 through /5 into six separate outputs

But What If Six Switches Isn’t Enough?

Well, I’m glad you asked. Because there is a “raw” input and output of 433MHz messages that you can use to tap any codes. That means that you can receive and send any command you like! How cool is that!

To receive all the RF codes, just create an MQTT node with the topic SONOFF_RFBRIDGE/rfin which will give you all the decoded 433MHz messages in hexadecimal. If you want to send a specific code, create an MQTT Out node and set the topic to SONOFF_RFBRIDGE/rfout/set. Now you just have to send the command directly to that node. Quite interesting possibilities there.

Does It Work With All 433MHz Equipment?

A white Nexa 433 MHz remote control with five pairs of on and off buttons and a channel selectorI’ve only tried ITEAD’s remote control, a NEXA remote and a bunch of mains relays and everything works perfectly. I’ve already connected several mains power switches to it to control lighting, and it works without a hitch. I will install door and window detectors later on and update the article.

So there you have it, an excellent bridge between WiFi and 433MHz controlled equipment, all inside the comfy Node-RED environment. Only your imagination is stopping you now.

Excellent!