Use Tasmota RF Bridge and rm433 remote to controll lights (hue ikea lights)

Hello,

i have configured my Sonof rf bridge to tasmota and it shows in Hassio, it also see’s in the log when i press a button on the rm433 remote.

The problem is i have totally no idea on how to create a command or … to use the buttons on the remote to turn off the lights and turn them on (i have a philips hue hub with ikea smart light bulbs)

Can you guys please help me on how to make a command to controll several lights with the push of a button.

thanks in advance!

Jay

1 Like

Hello Jay, welcome to the forum. I do not have an RF Bridge but I suspect you can solve your problem with one or more automations. The signal of the remote control is the “trigger” and the switching of the lamps is the “action”. The automations can be created relatively easily in HA, see here …


NodeRED is also very good, for beginners it is also very clear …

It is not very difficult, but it needs some configuration. First of all, I suggest you read this topic :

so you know how to create sensors when a button on your remote is pressed.

Then you can create simple automations like this :

- id: '1565365902539'
  alias: Ikea switch2
  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: sensor/ikea_switch2_sensor
  condition: []
  action:
  - data:
      entity_id: switch.ikeaoutlet2_switch
    service: switch.toggle

This is an example for a switch, but the idea is the same for a light.

Hai Guys,

Thank you for your responses.

i tryed the things you suggested but i cant get it to work (i already had to install hassio once more)

i want the line below to activate the light :slight_smile:

MQT: tele/sonoff/RESULT = {“Time”:“2019-11-30T21:09:33”,“RfReceived”:{“Sync”:7480,“Low”:260,“High”:740,“Data”:“92D3B8”,“RfKey”:“None”}}

and this one to turn it off :

MQT: tele/sonoff/RESULT = {“Time”:“2019-11-30T21:12:16”,“RfReceived”:{“Sync”:5230,“Low”:260,“High”:730,“Data”:“92D3BC”,“RfKey”:“None”}}

i hope you guys know a way to get it to work.

kind regards

Jay

From the topic I linked before :

Here are the basic steps:

  1. Add python_script: to your configuration.yaml file.
  2. Create the following sub-directory: config/python_scripts
  3. Restart Home Assistant.

Create a new file in config/python_scripts called rfbridge_demux.py with the following contents:

d = { '92D3B8':['sensor1','ON','true'],
      '92D3BC':['sensor1','OFF','true']
    }

p = data.get('payload')

if p is not None:
  if p in d.keys():
    service_data = {'topic':'home/{}'.format(d[p][0]), 'payload':'{}'.format(d[p][1]), 'qos':0, 'retain':'{}'.format(d[p][2])}
  else:
    service_data = {'topic':'home/unknown', 'payload':'{}'.format(p), 'qos':0, 'retain':'false'}
    logger.warning('<rfbridge_demux> Received unknown RF command: {}'.format(p))
  hass.services.call('mqtt', 'publish', service_data, False)

Here’s the required automation. Don’t forget to change topic: to the topic you configured for your RF Bridge.

- alias: 'rfbridge_demultiplexer'
  trigger:
  - platform: mqtt
    topic: tele/sonoff/RESULT
  action:
  - service: python_script.rfbridge_demux
    data_template:
      payload: '{{trigger.payload_json.RfReceived.Data}}'

And here is the automation to turn your lights on and off :

- id: '1562219853852'
  alias: ikea_light_on
  trigger:
  - payload: 'ON'
    platform: mqtt
    topic: home/sensor1
  condition: []
  action:
  - data:
      entity_id: light.lichtbuitenvoordeur
    service: light.turn_on

- id: '1562219853853'
  alias: ikea_light_off
  trigger:
  - payload: 'OFF'
    platform: mqtt
    topic: home/sensor1
  condition: []
  action:
  - data:
      entity_id: light.lichtbuitenvoordeur
    service: light.turn_off

Restart HA

Everything is precooked but the name of your light

Hai Francis,

where whould i have configured the topic for the rf bridge?

i tryed those things and changed the entity id to my light bulb but i still cant get it to work, i dont get any errors now so thats ok, but something is not going like it should.

You are also dutch arendt you? maybe we can discus in dutch to?

kind regards

Jay

Do you see anything in your logs ? If you go to developer tools -> mqtt , and publish the command home/sensor1 with payload ‘ON’, does the light come on ?

If you need help for Home assistant in dutch, go to

https://gathering.tweakers.net/forum/list_messages/1951672

I have problems with Sonoff RM433.
Just binded with my ESPHomed Sonoff bridge 433… Almost.
But code for a remote button just change in a while. It is never the same in a long time, so automation can’t work.
Any idea?

My Sonoff RM433 works fine on an Sonoff RF bridge flashed with openmqttgateway. I think it is the way you catched the RF signal in ESPHome that is the problem.

I setup a Node-Red flow for my RF bridge. It captures all 433 signals via MQTT to be translated into commands. This allows me to use all of the very inexpensive 433 mhz stuff from ali-express and bang good. …even motion sensors and other forms of input as long as it sends out a 433 mhz signal when activated. I have over 30 devices/actions coming through this one flow. So far all of the devices that I am using have a unique identifier.

1 Like

Hi All,
I have flashed my Sonoff RF Bridge with Tasmota (latest version) and Portisch, and it works perfect and the bridge correctly picks up the 433MHz data from various devices from different manufactures that I have.
However, it seems totally blind to the Sonoff RM433 remote control. When I click a button on the remote, there’s absolutely no response at all from the Bridge. I know the remote works, cause I’m using it to control a Sonoff D1. But even though the remote has been paired with the D1, shouldn’t its 433MHZ communication still be visible for the Bridge to pick up?

Would you care to share your code?

You can see the flow above, I will post the code from the 2nd function node which checks for which 433 device was activated and issues a set of commands accordingly. This structure allows me to execute one or more actions for each msg received.

var msglist = [];
switch (msg.payload)

{
    case '595D12' : //Bench 3 pack 1 btn 1
        var commandstorun = {
        0:{topic:"cmnd/sonoff03/Power",payload:"toggle", desc:"Bench Lights"},
        };
    break;
    case '595D18' : //Bench 3 pack 1 btn 2
        var commandstorun = {
        0:{topic:"cmnd/sonoff02/Power",payload:"toggle", desc:"Desk Fan"},
        };
    break;
    case '595D14' : //Bench 3 pack 1 btn 3
        var commandstorun = {
        0:{topic:"cmnd/sonoff01/Power",payload:"toggle", desc:"Basement Fan"},
        };
    break;
    case 'D0C062' : //Bench 3 pack 2 btn 1
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"off", desc:"Basement Kiosk Off"},
        };
    break;
    case 'D0C068' : //Bench 3 pack 2 btn 2
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"hassiomonitor", desc:"Basement Kiosk Hassio"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
        };
    break;
    case 'D0C064' : //Bench 3 pack 2 btn 3
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueiris", desc:"Basement Kiosk Blue Iris"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
        };
    break;
    case 'B2D448' :  //Bench Kiosk Blueiris All - From Desk RF remote btn 1
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueiris", desc:"Basement Kiosk Blueiris All"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D44C' :  //Bench Kiosk BlueIris Courtyard - From Desk RF remote btn 2
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueiriscourtyard", desc:"Basement Kiosk Blue Iris Courtyard"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D444' :  //Bench Kiosk Blueiris Livingspace - From Desk RF remote btn 3
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueirislivingspace", desc:"Basement Kiosk Blueiris Livingspace"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D449' :  //Bench Kiosk BlueIris Inside - From Desk RF remote btn 4
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueirisinside", desc:"Basement Kiosk Blue Iris Inside"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D442' :  //Bench Kiosk BlueIris Outside- From Desk RF remote btn 5
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueirisoutside", desc:"Basement Kiosk Blue Iris Outside"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D445' :  //Bench Kiosk BlueIris Garage - From Desk RF remote btn 6
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueirisgarage", desc:"Basement Kiosk Blue Iris Garage"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D441' :  //Bench Kiosk BlueIris Parking - From Desk RF remote btn 7 
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"blueirisparking", desc:"Basement Kiosk BlueIris Parking"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case 'B2D443' :  //Bench Kiosk Off - From Desk RF remote btn 8
        var commandstorun = {
        0:{topic:"/kiosk/bench/commands",payload:"hassiomonitor", desc:"Basement Kiosk Hassiomonitor"},
        1:{topic:"/piezo/basement",payload:"beeponce"},
    };
    break;
    case '666558' :  //Bedroom Kiosk Blueiris All - From Bedroom RF remote btn 1
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueiris", desc:"Bedroom Kiosk Blueiris All"}
    };
    break;
    case '66655C' :  //Bedroom Kiosk Blueiris Livingspace - From Bedroom RF remote btn 2
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueirislivingspace", desc:"Bedroom Kiosk Blueiris Livingspace"}
    };
    break;
    case '666554' :  //Bedroom Kiosk Blueiris Courtyard - From Bedroom RF remote btn 3
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueiriscourtyard", desc:"Bedroom Kiosk Blueiris Courtyard"},
    };
    break;
    case '666559' :  //Bedroom Kiosk Blueiris Parkingl - From Bedroom RF remote btn 4
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueirisparking", desc:"Bedroom Kiosk Blueiris Parking"}
    };
    break;
    case '666552' :  //Bedroom Kiosk Garage - From Bedroom RF remote btn 5
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueirisgarage", desc:"Bedroom Kiosk Garage"},
    };
    break;
    case '666555' :  //Bedroom Kiosk Blueiris Inside - From Bedroom RF remote btn 6
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueirisinside", desc:"Bedroom Kiosk Blueiris Inside"}
    };
    break;
    case '666551' :  //Bedroom Kiosk Outside - From Bedroom RF remote btn 7
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"blueirisoutside", desc:"Bedroom Kiosk Outside"},
    };
    break;
    case '666553' :  //Bedroom Kiosk Off - From Bedroom RF remote btn 8
        var commandstorun = {
        0:{topic:"/kiosk/bedroom/commands",payload:"off", desc:"Bedroom Kiosk Off"},
    };
    break;
    default:
        var commandstorun = {
        0:{topic:"/unknown/rfsignal",payload:"Unknown Device", desc:"Unknown RF Device"},
        };
    break;    
}

for (var i in commandstorun) {
    msglist.push(commandstorun[i]);
}

return [msglist];