Getting started with Broadlink RM4 Pro

I’m looking to expand my HA repertoire beyond controlling lights. I’ve recently installed a Broadlink RM4 Pro and it’s making a reasonable job of controlling my 20yo Teco air conditioner and 15yo Panasonic Viera.

The RM4 has been discovered by HA and the integration configured. However all I see is a device and an entity for the remote itself. There’s nothing showing for the aircon or TV that the remote already “knows about”. Which is somewhat less than entirely useful.

I’ve done some searching on the Broadlink integration and, surprisingly, found nothing that relates to this situation. However there is plenty of information on learning IR codes.

My suspicion is that there is no connection between the devices known to the remote, and the HA integration, and that I have to learn the IR codes in HA.

Is this the case, or have I missed a simple step?

1 Like

Have a look at the SmartIR integration. A lot of the hard work is done for you.

Thanks for the tip Michael. But unfortunately there isn’t a code file for either of the devices I have (Teco aircon and Panasonic TV).

So I will have to go the route of learning the codes. The next hurdle is Broadlink Manager. I’ve tried the Windows .EXE that I found, but it can’t find the RM4 Pro. Not surprising given that it’s version 1.0.0.1 from 2019. It seems that there are later versions, there’s a very detailed github page with version history and other information.

But what it doesn’t clearly explain is where to get it and how to install it.

Can someone ELI5 please?

I use node red for broadlink control. Take a look at this writeup.

OK so most of the info on using the HA Learn Command feature indicates (to me) that it’s an iterative process of defining a command to learn then pressing the remote button, saving the code and repeating.

I found this vid that shows how to batch learn. Basically define every button you want to learn on a specific remote, then step through pressing each one in turn, prompted by HA. That seems much nicer than the impression I had.

And to guess an answer to my own question about Broadlink Manager, I guess I would have had to install Docker first then pull the image? Or something, I know jack shit about Docker.

But I see numerous comments along the lines of: it took so long to get Docker and BL Manager set up and working that it would have been quicker and easier to just learn the codes in HA.

That’ll do me.

If you use the remote.learn_command service call in Development Tools it will store the codes in a file called something like:

/config/.storage/broadlink_remote_xxxxxxxxx_codes

These are then used by the remote.send_command call. No need for other software. Each RM4 will have its own file, but I’ve had success copying codes from one file to another if needed.

2 Likes

Realistically, remote.learn_command didn’t turn out to be so bad after all. Especially when batching up the 40 commands for the TV remote and just responding to each new notification by pressing the corresponding button. I was expecting it to be way more painful.

For anyone else finding this thread and following the video I linked in post #4, there’s one little wrinkle that’s in the video but not highlighted in the commentary. When you set up a list of commands to learn in a batch, each command must be prefixed with a hyphen and a space.

4 Likes

This was a super useful post, and the video worked really well for learning my RF commands.

Looking at the integration, I’d like to create some entities to control the device. Based on the remote, I’d need 4 entities. The remote doesn’t have discrete codes for the light, fan or direction (just a toggle), and the speed is buttons 1 - 6. So looking at the integration docs, I think I need to create something like this yaml? I’m not sure how to do a dimmer with 6 discrete steps, or if a switch can be forward/backward or if that might need to be a different entity type like select. There is also a fan entity, but it’s not clear to me how the YAML could be created.

switch: fan on/off
switch: light on/off
dimmer: fan speed
Switch: fan direction.

I haven’t created yaml before, so any feedback on my approach would be appreciated before I mess something up.

1 Like

Have you find a solution to your inquiry? I need something similar, I just need to create an entity like a light bulb, to control a aquarium light, I’ve already have the On and Off buttons learned and I even have them as button in the dash board, but what I really need is a such that can be turned on and off from the same card, and then expose it to HomeKit as a light, because right now with the button, its toggles on, but after some time they toggle back off and I have the as separate devices the on and the off. hope someone could help.

Just use an input Boolean to trigger 2 automations/scripts. If the input Boolean is on - trigger your RF code for ON, if it’s off … well you get the idea.

I made this, and its working quite well, because I made the light go on and off, but I’m missing something, cause when y click on the button once I added the card to the dashboard, the button won’t stay on but the light turns on and off every time I click on in.

alias: Helper Medusario
sequence:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.medusario_switch
            state: "on"
        sequence:
          - action: script.medusario_off_helper
            data: {}
      - conditions:
          - condition: state
            entity_id: input_boolean.medusario_switch
            state: "off"
        sequence:
          - action: script.medusario_on_helper
            data: {}
description: Enciende y Apaga la Luz del Medusario
icon: mdi:jellyfish-outline

In found a better and easier way to do it, I’ve got to get the switch working fine with home assistant and HomeKit exposing it thru the HomeKit bridge, just need to add the script to your configuration.yaml file and the and the entity to a card in the dashboard, once you learned the commands from the remote into home assistant, you will find the code commands in the storage file in the file editor, just need to spot the file “Broadlink…codes”:

switch:
  - platform: broadlink
    mac: MAC Address
    switches:
      - name: Switch Name
        command_on: scCwBJyeBgAPMw
        command_off: scCqAWqeBgAAAQp/Dz

1 Like