Sonoff RF Bridge with ESPHOME?

Good afternoon, sorry for my ignorance but I put this code inside the EspHome code? If so, could you show me how?

I have installed my ESPHome dev environment on macOS and run it from the command line in a virtual environment. If you are doing it in the same way, then here is what you need to do to add the fixed code:

  • In the virtual environment find file lib/python3.7/site-packages/esphome/components/rf_bridge/rf_bridge.cpp
  • In that file find the line void RFBridgeComponent::send_code(RFBridgeData data) {
  • Remove this line and the next 10 lines up until and including the line that contains }
  • Copy above code fix into that file.
  • Clean build directory: esphome your_config.yaml clean
  • Build and upload OTA: esphome your_config.yaml run

Thanks, I will do this

Hi, do you have any idea why the RM433 remote from Sonoff does not work well with Sonoff bridge?
It always generate very different codes, so it’s difficult to create automations.


This is the event automation, and this is the event generated:


But I can’t use reliably sync, low, high.
Is this how it is supposed to work?

sync, low, high are nor reliable to use. That’s inherent to RF433.

Thanks, so I can reliably use just “code”? This was not mentioned anywere, it looked strange to me.

Code is reliable. sync, low, high are dependent on a number of things, including how good the reception was, interference of other RF433 devices that were transmitting at the same time, etc, etc…

Can anyone vouch for the consistency of this? I’m the latest ESPHome dev on an RF Bridge with a KERUI D025 door/window sensor and notice that the RF Bridge seems to catch only 60-70% of the sensor’s activity.

I’ve written up how I flashed the RF Bridge with ESPHome to control a ceiling fan:

Special thanks to @JeeCeetje again for finding that bug and providing a fix.

1 Like

ESPurna onto the device. However, all these options require making some hardware changes. Luckily ESPHome recently added support for the Sonoff RF Bridge into its development version and this does not even require any hardware modifications. ESPHome is my preferred custom firmware option due to its great integration in Home Assistant and general ease of use.

ESPurna doesn’t require hardware change to run on an RFBridge, you can do an hardware mod to extend the list of supported protocols but it is not compulsory. As a side note it was the first firmware to support RFBridge and opened the path to all the others.

2 Likes

Lots of great info here, was able to add 7 motion sensors and 3 door sensors (with on and off states) to my RF Bridge!

Been running some custom code on a Raspberry Pi for a year now as Tasmota was too much of a delay as some of you noticed, but this is very quick, no delay that is noticeable so hopefully I can make the switch.

Thanks for the clarification. I’ll amend my blog post.

1 Like

Good morning, I would like a help as I do this procedure in Hassio because every time I do it directly in the esphome component when and after compiling I see that the rf_bridge file remains in the wrong way ie I update but when I compile it assumes the wrong again

Sorry, I don’t use that add-on and don’t exactly know what the file structure looks like.
Maybe someone else could help here?

When compiling, the add-on cleans all code as a first step, so any manual changes are reverted. Better to use the command line.

I’ve always found the first time flash to be problematic with ESPHome.

I suggest compiling the binary and then using the flasher utility. After that OTA will work fine.

I have documented the full steps here for how to modify the Sonoff RF Bridge and how to use ESPHome with it, including two state binary sensors, incase anyone gets stuck. Hopefully it will help someone:

5 Likes

Nice write up and very helpful.

I did this a while ago, however, I’ve found that once the number of added devices exceeds around 15, the bridge becomes unstable and constantly connects and disconnects from the HA API.

I currently have 5 Tasmota RF bridges and around 50 sensors. I use this approach to manage the 5 bridges and it works well, but I’d rather have an ESPHome solution.

The API disconnect issue is well known and, as yet, is unsolved in all applications.

Thank you for the feedback and also the heads up! I was not aware of that, I have 14 devices currently would you believe so that’s just a stroke of luck. I’m hoping to add more though soon so I’ll need to find a work around for that.

Hey guys wondering if anyone can help.

Have a sonoff RF bridge that I have loaded tasmota on. I’ve following the instructions and have made the hardware modifications.

I have tried to upload the esp-home binary file I have compiled but I get an error. “Upload Failed, upload buffer miscompare”.

screenshot_649

Has anyone else encountered this error? Any ideas about how I proceed from here?