How to configure HA to send 433MHz RF signals via MQTT through Sonoff's RF-Bridge?

Thank you… but I did not get it to work.

I even don’t really know what to send via MQTT with f.e. mosquitto_pub CLI-command to switch my 433MHz-Plugs via Sonoff RF Bridge… I mean for testing if switching via MQTT actually works without Homeassistant.
I don’t know how to proceed :frowning:

Use Node Red - It’s much more intuitive with such automations.

For testing you can just use the Mqtt topic in HA under developer tools.

Ok, I can switch my plugs via MQTT like this:

# mosquitto_pub -h 172.16.42.40 -u mqtt -P "***" -t rfbridge/cmnd/RfCode -m '#414551' -d

# mosquitto_pub -h 172.16.42.40 -u mqtt -P "***" -t rfbridge/cmnd/RfCode -m '#414554' -d

Next step is translating that correctly to HA !

I modified what francisp provided above and it works somehow, but not reliable.
And the UI-switch goes back to off after a second or so… some fine tuning is required now.

  - platform: mqtt
    name: 'light2'
    state_topic: 'tele/rfbridge/RESULT'
    value_template: >-
      {% if value_json.RfReceived.Data == '414551' %}
        {{'ON'}}
      {% elif value_json.RfReceived.Data == '414554' %}
        {{'OFF'}}
      {% else %}
        {{states('binary_sensor.light2') | upper}}
      {% endif %}
    off_delay: 0
    device_class: light
    qos: 1

  - platform: template
    switches:
      light_2:
        value_template: "{{ is_state('binary_sensor.light2', 'on') }}"
        turn_on:
          - service: mqtt.publish
            data:
              payload: '#414551'
              topic: rfbridge/cmnd/RfCode
        turn_off:
          - service: mqtt.publish
            data:
              payload: '#414554'
              topic: rfbridge/cmnd/RfCode
1 Like

You can also check this topic Easier way to define mqtt rflink switch? , it is not about the rfbridge (but an rflink), but the principle is the same

Now that I think about it, since you have a rf switch with both an off and on signal, you should take the off_delay out… The switch should only go out when it receives the off signal, not after 0 or 2 seconds.

1 Like

Actually off_delay was absent before, I tried to disable the off_delay with “off_delay: 0”, but I’m actually not quite sure if it works like that.

It does not matter if off_delay is there or not, the switch in the Web-UI turns off after 2 or 3 seconds automatically.
How can I disbale this behaviour so that the switch stays in its position ?

Just remove the line with off_delay entirely.

It is easy to debug. Just use mqtt fx, mqtt explorer, mqtt lens or even mosquitto_sub to monitor the received mqtt messages. When you receive ‘414551’, your light2 should switch to ‘ON’ (check under developer tools, states), and stay on as long as no ’ 414554’ is received.

Same for off : your light2 should switch to ‘OFF’ when ‘414554’ is received, and stay off as long as no ‘414551’ is received.

I just learned my relay the dafult rf bridge code of two of the sixteen buttons(one for “on” and one for “off”)
and then created a simple switch
Not sure if the availability code is correct. But the command works fine

- platform: mqtt
    name: "rf_bridge"
    state_topic: "stat/RF_Bridge/RfKey1"
    command_topic: "cmnd/RF_Bridge/RfKey1"
    availability_topic: "tele/RF_Bridge/LWT"
    qos: 1
    payload_on: "Default sent"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false

Francis

quick question: if I have CO Gas sensor which only receives signal in rfraw166 or rfraw177 does it mean the sonoff bridge has to stay all the time in that mode?

I have few devices which work in rfraw 0 but only this new device would work only in rfraw 166. Do I need two sonoff bridges?

I don’t know. None of my rf bridges run portisch firmware. I guess you will have to try it out.

Hey everyone, I have a newer version of the Sonoff RF bridge board, R2 v2.2, which has a different configuration than past versions. While I was able to flash Tasmota using this guide:
https://tasmota.github.io/docs/devices/Sonoff-RF-Bridge-433/

I was not able to figure out which pins to connect to flash Portisch.

Any help that could be provided would be greatly appreciated, and we could use any information gleaned here to update the guide for this device.

Here are images of the new board.

Is that the one in the white box ?

Yes, this new version comes in the white chassis.

Portisch Firmware has been abandoned for a number of years. Honestly you’re probably better off trying to make it work on stock firmware or buying a different device like RM Pro4.

The Sonoff Bridge with stock Tasmota does not pick up the commands from my 433 MHz remote, so it looks like i’ll have to go in a new direction such as the RM Pro4.

@stirlo how would I go about getting the RM Pro4 to learn my (non standard) 433 Mhz commands–do I need to flash it with a specific firmware?

Do you want to the RM Pro 4 to pick up commands from your remote, or just replace it ? The second the RM Pro 4 can do, the first not (except when you put it in learning mode, but it can’t work the whole time in learning mode)

The end result is that I want to be able to control my electronic blinds from Home Assistant. They were installed by a company called 3 Day Blinds (3DB) who has their own proprietary 433 MHz remote system and mobile app. I did some Googling, and other people with these blinds and Home Assistant went down the Sonoff RF Bridge path. However, the information that I found was from last year or earlier, before the Sonoff RF Bridge was refreshed to a new version with a new RF chip that does not support Portisch. I’ve already established that stock Tasmota with a Sonoff RF Bridge does NOT work with this particular 433 Mhz remote–I would need Portisch.

Thus to answer your question, I just need the RM Pro 4 (or some other RF bridge) to be able to replace/replicate the existing 433 MHz remote that I have, so that I can execute commands to the blinds through Home Assistant. In that sense, I don’t actually care if the RM Pro 4 can output the raw commands for me, as long as it can execute the commands back to the device (and I can control in Home Assistant).

Does the RM Pro 4 sound like the right device for what i’m looking to accomplish?

Yes, if that is what you want to do.