Help with MQTT and rfraw

I am trying to set a rf switch to work with sonoff rf bridge
I have managed to send the data to turn the switch on, but from the GUI (via configuration.yaml) can’t make it switch off
I can push the payload via MQTT developer tools, like this:
topic:
cmnd/sonoffrf/backlog
payload:
rfraw AA B0 2E 05 08 1AFE 0154 00D2 02D0 26FC 481A3B1A3A3A3A3A3A3A3A3B1A3B1A3B1A3A3B1A3A3A3B1A3A3A3A393B1B1B1B1A3A 55
Then click on “Publish”, this switches the switch off, however the configuration.yaml doesn’t work for the switch off:
- 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 2E 05 08 1AFE 0154 00D2 02D0 26FC 481A3B1A3A3A3A3A3A3A3A3B1A3B1A3B1A3A3B1A3A3A3B1A3A3A3A393B1B1B1B1A3A 55;rfraw 177”
So it seems the MQTT manual public DOES work, but from the configuration.yaml doesn’t
What am I doing wrong?

Hi did you find the Solution ?

I have similar problem. First I could turn the rf switch ON and OFF via developer tools publish by sending commands to Sonoff rf bridge.
Later I added the entry in configuration.yaml for swtich- platform mqtt.
I am able to only turn ON the switch and the state of switch (ON,OFF) does not change in home assistant. It remains always off. So clicking again on toggle entity sends ON command to already ON rf bridge which does not do anything.

May I know why have you added rfraw 177 as next instruction in payload on/off ?

- platform: mqtt
    name: "rf switch"
    state_topic: "stat/sonoffbridge/RESULT"  
    value_template: "{{ value_json.RfRaw }}"
    command_topic: "cmnd/sonoffbridge/Backlog"
    payload_on: "Rfraw AAB0......payloadhere.....55"
    payload_off: "Rfraw AAB0......payloadhere.....55"
    availability_topic: "tele/sonoffbridge/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

I can’t remember how I resolved it , however this is my current configuration and is working flawlessly:

  • platform: mqtt
    name: “Spare switch”
    state_topic: “tele/sonoffrf/RESULT”
    value_template: ‘{{value_json.RfReceived.Data}}’
    payload_on: “36E358”
    payload_off: “36E358off”
    qos: 1
    off_delay: 1

  • platform: mqtt
    name: “Kevins switch”
    state_topic: “tele/sonoffrf/RESULT”
    value_template: ‘{{value_json.RfReceived.Data}}’
    payload_on: “6535B8”
    payload_off: “6535B8off”
    qos: 1
    off_delay: 1

  • platform: mqtt
    name: “Main bedroom switch”
    state_topic: “tele/sonoffrf/RESULT”
    value_template: ‘{{value_json.RfReceived.Data}}’
    payload_on: “8E1708”
    payload_off: “8E1708off”
    qos: 1
    off_delay: 1

  • platform: mqtt
    name: “Sala Main switch”
    state_topic: “tele/sonoffrf/RESULT”
    value_template: ‘{{value_json.RfReceived.Data}}’
    payload_on: “C3FF48”
    payload_off: “C3FF48off”
    qos: 1
    off_delay: 1

Hope this helps

Javier