How to send RF codes via Sonoff RF 433MHz Bridge/Tasmota?

I have a Sonoff RF Bridge flashed with Tasmota which I am using with alarm sensors. I would also like to use the Bridge to control RF devices (e.g. 433Mhz power sockets), but have been unable to find anything that describes how this can be done (at least not with Tasmota).
Could anyone explain how/if I can send RF commands in HA via the RF Bridge?

https://tasmota.github.io/docs/Commands/#rf-transciever

  action:
  - data:
      payload: 'your_code'
      topic: RF_bridge/cmnd/Rfsend
    service: mqtt.publish

Depending on your mqtt configuration, it might be cmnd/RF_bridge/RfSend

Replace RF_bridge with the name of your bridge.

I have my automation set up as below. I derived the action payload (7B828F) by pressing the remote control for the socket and observing the MQTT message it generated on the Tasmota console.
When I run the actions on this automation (i.e. bypassing the trigger) the socket is not being turned on (and I don’t see anything on the Tasmota console). There was also nothing written to the HA log.

alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: Template:Value json.RfReceived.Data
    payload: 773B72
condition: []
action:
  - data:
      payload: 7B828F
      topic: rf-bridge/cmnd/Rfsend
    service: mqtt.publish
mode: single

???

It is either

payload: '773B72'

or

payload: '#773B72'

Use quotes

And I made a mistake, it is RFsend, not Rfsend (bad autocorrect)

I’ve tried these two variants, and neither seem to send an MQTT message. Neither is the trigger recognised from my 433MHz remote (although I do see a message on the Tasmota console when I press the remote).

alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: Template:Value json.RfReceived.Data
    payload: '773B72'
condition: []
action:
  - data:
      payload: '7B828F'
      topic: rf-bridge/cmnd/RFsend
    service: mqtt.publish
mode: single
alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: Template:Value json.RfReceived.Data
    payload: '#773B72'
condition: []
action:
  - data:
      payload: '#7B828F'
      topic: rf-bridge/cmnd/RFsend
    service: mqtt.publish
mode: single

if you receive on tele/rf-bridge/RESULT, you need

alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: Template:Value json.RfReceived.Data
    payload: '773B72'
condition: []
action:
  - data:
      payload: '7B828F'
      topic: cmnd/rf-bridge/RFsend
    service: mqtt.publish
mode: single

alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: Template:Value json.RfReceived.Data
    payload: '#773B72'
condition: []
action:
  - data:
      payload: '#7B828F'
      topic: cmnd/rf-bridge/RFsend
    service: mqtt.publish
mode: single

I doubt that value_template does anything useful.

Perhaps what you want is this:

value_template: "{{ value_json.RfReceived.Data }}"

The config below now recognises the trigger, but generates this on the Tasmota console when executed:

11:13:26 MQT: stat/rf-bridge/RESULT = {"Command":"Unknown"}
alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: "{{ value_json.RfReceived.Data }}"
    payload: '773B72'
condition: []
action:
  - data:
      payload: '7B828F'
      topic: cmnd/rf-bridge/RFsend
    service: mqtt.publish
mode: single

Seems RFsend if for a generic rftransmitter and the rfbridge works a little different

alias: Turn On Socket1
description: ''
trigger:
  - platform: mqtt
    topic: tele/rf-bridge/RESULT
    value_template: "{{ value_json.RfReceived.Data }}"
    payload: '773B72'
condition: []
action:
  - data:
      payload: '#7B828F'
      topic: cmnd/rf-bridge/RfCode
    service: mqtt.publish
mode: single
1 Like

That’s it - many thanks!