Rf bridge with non-sonoff rf devices

Hi
I have recently installed a new sonoff rf bridge and follow the instructions to hack to tasmota (both esp firmware and Portisch firmware) - see https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-RF-Bridge-433

I have no problems with sonoff-based devices ( PIR, rf-switch, windows sensor) as they produce a clear code, something like: EB5C4E
However, I have a number of rf switches, and so I do sniff the data ( rfraw 177 on device console), then convert to B0 code using the python scrip provided
However, I’m now stuck
I have tried the code on the rf-bridge console and works, but I don’t know how to integrate on HA, on the instructions there is only some info for openHAB

On the sonoff console I run:
RfRaw AA B0 2C 04 08 1B26 0122 0294 2666 38192A192929292929292A1929292929292A192929292A19292A192A19292A192929 55

this is the B0 code, and the light goes on, so is the right code

The configuration.yaml, should look something like this:

  • platform: mqtt
    name: “Bedroom light”
    state_topic: “tele/sonoffrf/RESULT”
    command_topic: “cmnd/sonoffrf/RESULT”
    value_template: ‘{{value_json.RfReceived.Data}}’ ### this is wrong
    payload_on: "AA B0 2C 04 08 1B26 0122 0294 2666 38192A192929292929292A1929292929292A192929292A19292A192A19292A192929 55 "
    payload_off: "AA B0 2C 04 08 1B26 0122 0294 2666 38192A192929292929292A1929292929292A192929292A19292A192A19292A192929 55 "
    qos: 1

on the value template I’ve read I should put something like “rfraw”, or similar, but can’t find any examples
Can somebody help?

Thanks

Actually, it seems I’m getting there
I saw another post in this forum, and found out how to do it:

on the configuration.yaml , switches section:

- platform: mqtt

name: “Bedroom light”
state_topic: “tele/sonoffrf/RESULT”
command_topic: “cmnd/sonoffrf/backlog”
payload_on: “rfraw AA B0 2E 05 08 1B1C 0186 00A0 029E 2666 481A3B2A3A3A3A3A3A3A3A3B2A3B2A3B2A3B2A3A3A3A3B2A3A3B2B2B2A3B2B2B2A3A 55;rfraw 177”
payload_off: “rfraw AA B0 2C 04 08 1B26 0122 029E 26DE 38192A19292929292929292A192A192A19292A1929292A19292929292A1A1A1A1929 55;rfraw 177”

  • platform: mqtt
    name: “Celing Sala”
    state_topic: “tele/sonoffrf/RESULT”
    command_topic: “cmnd/sonoffrf/backlog”
    payload_on: “rfraw AA B0 2C 04 08 1B26 0118 0294 265C 38192A192929292929292A1929292929292A192929292A19292A192A19292A192929 55;rfraw 177”
    payload_off: “rfraw AA B0 2C 04 08 1B1C 0122 0294 26DE 38192A192929292929292A192929292929292A1929292A1929292A1A19292A192929 55;rfraw 177”

It seems to work, although for some reason the “off” doesn’t , so will need some more sniffing and tests

Ok
I have been playing with the codes to turn off the switches, but can’t make it happen!
I can turn on the switches, but turning off doesn’t want to work
I have tried sending the codes directly to the sonoff bridge - via console - and they all work, but not from HA
it is as if HA is not sending the codes.
As per the above configuration, I have
payload_on
payload_off
What am I missing?
thanks

@javiermi Will this help you: