Send and receive RF commands using Sonoff (RFLink32) and MQTT

I have successfully manage to flash Sonoff R2 V2.2 with RFLink32 following this guide:

GitHub - schmurtzm/RFLink32-For-Sonoff-RF-Bridge: RFLink32 For Sonoff RF Bridge.

RF signals is picked up by RFLink and sent to Home Assistant using MQTT.

My first task is to control my projector screen from HA. RFLink32 has picked up these signals from my remote control.

UP:

‘20;25;EV1527;ID=0cba1d;SWITCH=04;CMD=ON’

Down:

‘20;26;EV1527;ID=0cba1d;SWITCH=01;CMD=ON;’

Stop:

‘20;27;EV1527;ID=0cba1d;SWITCH=02;CMD=ON;’

I suppose I should use the device class “Cover”. But are wondering how to configure the configuration.yaml with the correct syntax.

I need HA to recognize the device and send up, down and stop commands to RFLink32.

Make a template cover device and set the scripts for the commands to scripts that send the mqtt lines to the broker.

Thanks! I think I have to learn more about templates and scripting before I dig into that :wink:

But for a start… How do I get HA to register the device “EV1527” as an Entity in configuration.yaml?

At the moment I’m using Node-RED and the “MQTT in” node to see what codes that are sent to HA.

Nothing is automatically created.

It is somewhat easy.

I have this template in my configuration.yaml, which creatures a light entity in HA. The same should be possible with a cover entity.

light rf_devices:
  - platform: template
    lights:
      lava_lamp:
        friendly_name: "Lava Lamp"
        turn_on:
          service: script.lava_lamp_turn_on
        turn_off:
          service: script.lava_lamp_turn_off

The script is just this YAML code in a HA script.
Your service call might look different, but that is actually were the hardest part is … To figure out what the service call is.

service: esphome.rfbridge1_send_rf_code
data:
  sync: 10000
  low: 280
  high: 900
  code: 5326164

If you can make a service call from the service tab in the HA developer tools, then you are set to go.

So I can’t know exatly what the service call is just by looking at the data that the original remote sends?
Are you using Tasmota? Sync, low and high was vaules I got when Sonoff was flashed with Tasmota.
With RFLink32 I get '20;25;EV1527;ID=0cba1d;SWITCH=04;CMD=ON’

I can with the Sonoff RF Bridge, but I do not know with RFLink.
Test it and learn. :slight_smile:

Hi Guys,

Just flashed my Sonoff Bridge V2.2 with RFLink32. Just trying to get started adding devices. Can someone point me in the right direction. How can I monitor the MQTT traffice going to the bridge? Do I need a seperate add-on form RFLink32 or is it all yaml?

Thanks for the help

If you want to monitor MQTT traffic, MQTT Explorer is your friend.

1 Like