Has anyone managed to get the Sonoff RF bridge working with the rf_bridge component in esphome?
I initially flashed to Tasmota, updated to Portisch firmware and was able to see codes coming from my remote. Now after flashing to esphome I’m simply not registering anything from remote in logs etc.
I think my remote needs to use the advanced codes from Portisch firmware (it’s an arlec ceiling light/fan remote), but esphome logs show nothing. According to the esphome documentation, there is support using start_advanced_sniffing etc.
I found with my device that the code shifted a little bit with each press and I was getting a double trigger of the action, i.e. the light would toggle on , then off from the single captured code, when sent via console. It just took quite a few trial and error until I captured a code that worked correctly.
Using Sonoff RF bridge to listen/receive from a Sainlogic WS020T weather station. Running Tasmota, loaded Portisch firmware to the EMF chip, issued rfraw 177 console comand, captured several data messages, with ultimate goal to decode/parse them. Found robopenguins web page which led to their message parsing Python code.
With the RF bridge successfully receiving codes, and robopenguin’s Python parsing code as a guide, I flashed ESPhome to the bridge. Now, I come here seeking a small bit of guidance and direction. I would like to parse the received 433 MHz hex data into several ESPHome template sensor values. I presume using lambdas and short bits of C code is the method to do this. Could anyone please offer an example/suggestion?
# Get average wind speed in m/s
def get_avr_wind_speed(msg):
return msg[4] / 10.
# Get gust wind speed in m/s
def get_gust_wind_speed(msg):
return msg[5] / 10.
Hi @FredTheFrog, I don’t know about the weather station, but I’ve been playing around a bit with rf_bridge lately and can share what I’ve found.
I’m not sure to understand your use case, but if what you what is to receive codes, a prior condition is that the protocol used by your device is understood by Portisch. Otherwise no events will be fired in ESPHome, nor std nor advanced.
A couple of days ago I sent a PR (#1819) so that you can sniff raw codes directly with ESPHome, equivalent to Tasmota’s rfraw 177.
But this will only allow to get all raw codes in the log, but won’t fire any events if protocol is not supported. This is mainly to learn codes to later use for sending (and replace some remote).
As you said you had to get the codes that way I assume they are not being decoded.
So, are you seeing the decoded codes in the log? If not, have you activated advanced sniffing?
If yes, the triggers with lambdas should work.
If after that you are still not seeing decoded codes I fear it will be uphill.
Some further changes and a new PR would allow to add a trigger on raw codes and then decode in HA, but I don’t think it’ll work well, as raw sniffing is unstable and the mode stops pretty soon.
So the alternative would be to add the new protocol to Portisch (or fix raw sniffing also in Portisch)
I added a couple of template switches to call start_advanced_sniffing and stop_advanced_sniffing and now I see their actions in the Very_Verbose log. Unfortunately, I still don’t see any recognition of the B1 messages I know are originating from the weather station which should be heard by the RF Bridge.
Being the impatient person I am, I downloaded your changes into a custom_component folder and attempted to build them. Had to change to the ESPHome dev version to get them compiled, but it’s now bucket sniffing and I’m seeing the WS020T data messages:
[04:07:09][D][switch:021]: 'Bucket Sniffing ON' Turning ON.
[04:07:09][D][rf_bridge:205]: Raw Bucket Sniffing on
[04:07:09][D][rf_bridge:036]: Action OK
[04:07:18][D][rf_bridge:100]: Received RFBridge Bucket: AA B1 03 01FE 03E8 03B6 A08191 55
[04:20:56][D][rf_bridge:100]: Received RFBridge Bucket: AA B1 04 01CC 0078 00E6 0190 B092A1 55
Being away from work for a few days, I tried adding a trigger and return of the data to @ianchi 's code mods this morning. Apparently, there’s some very special little nit-pick of code I’m missing, because my addition of a trigger for “on_bucket_received” just refuses to be recognized in the ESPHome GUI
I saw there were some recent changes/fixes in Tasmota and/or Portisch to resolve the issue of reading raw codes stopping after some time. Apparently there were a couple of memory leaks that caused this failure, and someone submitted patches for them. So there’s hope, yet. One thing I noticed about the raw messages coming back from the WS020T weather station. The RF Bridge frequently adds a series of repeating bytes to the end of the message before the closing ‘55’ byte. In my mind, these extra bytes can very safely be ignored. My thought was to simply ignore the complete message when the byte count was not the correct length or did not start with the bytes AA B1.
Yes, I saw that fork with the work on memory leak fixes, but there are a bunch of other changes also. And no PR to send them upstream.
On the other hand, the Portisch repo has been idle for a while.
I couldn’t find any reference or comments on how that fork’s firmware was performing.
I didn’t understand your comment on strange B1 codes. Can you post some examples?
Notice the extra ‘18’ and repeating ‘19’ bytes in several messages? I considered this may simply be an artifact from decoding the 433 MHz data stream? Here are two messages from ESPHome and RFBridge that show the same data pattern:
[09:09:18][D][rf_bridge:100]: Received RFBridge Bucket: AA B1 02 0366 04C4 908080 55
[09:17:37][D][rf_bridge:100]: Received RFBridge Bucket: AA B1 03 03FC 021C 037A A80809 55
Newbie here, i got pretty much where you got, but have no clue where to go next:
I can see the messages from my WS-6147 Weather Station via a enhanced Sonoff RF Bridge as follows:
I then tried https://bbconv.hrbl.pl/ without really knowing what I was doing…And without gaining any insight.
Can someone point me in the right direction where to decode the data into something i can use in Homeassistant?
Does someone made the RFbridge work on Advanced mode or bucket sniffing? I’ve an RFBridge working with ESPHome, but only for standard codes (Sonoff PIR and door sensors).
Advanced mode does not seem to work at all, and bucket sniffing not even compiles.
I was able to read RAW codes with tasmota without issue, but would like to use ESPHome.
I am in a weird situation where it seems I can read RF codes with Tasmota but not ESPHome.
I did the following steps :
Stock RF Bridge (No hardware hack)
Flashed Tasmota with FTDI usb adapter
Flashed RF chip with success
At this point I can execute “rfraw 177” in console and receive codes from an RF remote.
Frome there, I upload my ESPHOME again using the FTDI usb adapter.
It gets an IP, the API connect to HomeAssistant … but I cannot read any codes !
I press buttons on my remote and the RF red led does not come up and I don’t receive any events.
@jmbinette
which version of sonoff rf bridge do you have?
Black one?
White one with a led which you had to bend?
White one without led but with a button?
Withe one without led and without button?
I have the last one version 2.2 which I am not sure I can flash the rf chip