Learning IR codes from broadlink switch

I added my Broadcom RM Pro Plus to my HA via:

switch:
  - platform: broadlink
    host: rm.pro.ip.address
    mac: 'my:mac:addr'
    timeout: 60

Then went to Developer Tools, Services.
Selected Service: broadlink.learn
Entered { "host": "rm.pro.ip.address" } in Service Data
Clicked Call Service

Then I see “[homeassistant.components.broadlink] Press the key you want Home Assistant to learn”
in the logs.
Then I press a button from the IHC Android app
But the Pi is not learning the signal.
I get “[homeassistant.components.broadlink] No signal was received”

From the Pi I can ping rm.pro.ip.address and the button click from the IHC app works fine.
I did notice that when the Pi is trying to learn the signal, the signal is not reaching the actual device.
Clicking the button in the IHC app only works after I see the “No signal was received” error message.

Any ideas.

Perhaps I’m a bit confused… you’re trying to learn a code from an app? I’m not sure that’s how it works.

Here’s my use case and how I got it working… I’m using Mini3 to control a mini-split A/C in my living room. So… I added the Mini3 to config.yaml, and then I ran the learn service, and then I aimed my A/C remote at the Mini3 and pressed the on button on the a/c remote. The Mini3 captured the “on” code from my remote. Now I have a switch in HA to turn on my mini-split.

2 Likes

I don’t have one but remember watching this. It had a lot of info on the pitfalls:

2 Likes

When you call the service, does the broadlink light turn red? One thing I noticed when I was copying the code was that before I called the service I had to enter the official app and put it to copy.

Hello amiller, Welcome to the Forum. You do not send any IR signal from your smartphone with the IHC app. You control the RM Pro via the WiFi with the IHC app and then the RM Pro transmits the previously read in IR signals, so you can not teach in with the IHC App Home Assistant. You have to use IR remotes to learn HA. The learning of IR signals is very tedious, look in a search engine for the “Broadlink manager”
Good luck…

Thanks everyone, then I obviously misunderstood the process of learning the IR codes from HA.
Using the IHC app (that was connected to the RM Pro) I was able to “learn & save” codes for 3 devices. I can properly control all 3 devices from the app.

But as @VolkerKa pointed out, the app is just telling the RM pro to send the (previously saved) codes.

So now my questions are:

  1. How is the Pi/HA supposed to receive the IR code when I point the remote at the Pi and click a button? Doesn’t the Pi have to have a 433MHz receiver?
  2. What data is the app sending to the RM Pro? Can’t I make the Pi send the same data? It would seem I just need the dang codes that IHC saved (somewhere).

I don’t have a windows machine available to try BroadLink Manager.exe

So… in your config you only have part of it. You also need to define the “switches” in HA.

In the following link, in the “Switch” section there’s a write up on how to capture the codes into HA. Then you take that data and use it to setup the individual switches in HA.

Broadlink

This thread may be of help
https://community.home-assistant.io/t/broadlink-manager-nicer-way-to-learn-and-send-ir-rf-commands/58770

Hi,

you don’t need a Windows machine to learn the codes. However you are mixing up the things.

The RM Pro is the device which learns the codes and then communicates with the devices you want to control.

When you teach a code to the RM Pro, the RM Pro captures and memorizes the code and communicates with your mobile phone application.

Whenever you use your application on the phone to turn on something, the application sends a request through your home WiFi to the Broadlink RM Pro, to send out the appropriate signal to turn on the desired device.

Consequently if you want to use Home Assistant to do that, then Home Assistant will act as your ‘mobile phone application’. You won’t need your phone anymore to send out an IR or RF command. The Pi runs Home Assistant but it doesn’t learn anything. Whenever you tell the RM Pro to learn a command, you have to point your remote towards to the RM Pro. If the learn is successful, then Home Assistant will show you the base64 encoded representation of the hexadecimal code. You have to create switches in Home Assistant configuration sending out this code. Or you may test the captured code by calling the broadlink.send service similarly when you use the broadlink.learn service. The description of this is available at the link mentioned by @MandM78 here.

It is also not clear what you want to do exactly? Broadlink RM Pro is capable to learn and send out IR (infra red) and RF (radio frequency 433MHz) signals. You are talking about both in the same context. To learn IR signal is very easy. Point your remote to the RM Pro. Learning RF 433MHz signal can be very tricky based on the hardware version you have. Check out the video linked by @tom_l here, that’s a very good start.

However I can tell you from experience, that you don’t need the Windows machine or Android phone, nor the Broadlink Manager App nor the Broadlink RM Plugin Lite app. Home Assistant and an iPhone (or Android phone) with the default Broadlink e-Control application is perfectly enough. I found a trick in this forum somewhere (I couldn’t recall the link unfortunately) where someone has explained that you should first teach your RF command to your phone’s e-Control application and then check if it works. Now you have to be precise and fast. You need to start another learn process in the e-Control app for the same button but whenever during the learning phase the application asks you to press the button on the remote the second time, don’t do it. Call the Home Assistant broadlink.learn service for the proper host and only after this you press the remote’s button. You have to be quick. It has to happen within a few seconds. With this method I managed to learn RF codes with all kinds of hardware version of the RM Pro through Home Assistant and with a mobile phone only.

Right. I understand the RMpro is the device that is learning the code (when I click the remote).
That all worked (learning the codes and sending the codes to blinds, curtains, projector) when I used the IHC app.

I’m just trying to ascertain what the “ir codes” are so that I can then configure them all under
“switch:” “- platform: broadlink” “switches:” so that HA can send the code to the RMPro.

Since I couldn’t acertain the codes. I tried factory resetting the RMPro and tried setting it up again this time with e-control but I’m not having any luck yet.

I still don’t understand how the Pi is going to be able to show me the base64 encoded representation of the hexadecimal code using broadlink.learn. What HW on the Pi is able to see the 433MHz signal emitted from the remote?

It doesn’t. It uses the broadlink to learn the codes and it then displays them on the screen for you to write down and use in your switch config. Or you use some other method of learning the codes but it’s always being learned by the broadlink and then used in HA afterward.

So when the broadlink learns the “code” (after pressing the button on my remote), what is the meaning of the “value” that the Pi shows me? I understand this value is what I will need to use later in my config.

Is the “value” a base64 encoded version of the “code”?

If I can sniff the codes using an 433 MHz receiver (a la https://www.piddlerintheroot.com/rf-433-mhz/ )
could I just send the same code directly to my blind from the Pi using a 433 MHz transmitter? Then I wouldn’t need the Broadcom at all right?

There are definitely other ways to send/receive rf messages. Broadlink is just one of them. You could use the Sonoff RF Bridge too. I think there is another RF component that uses the GPIO on the RPI, too.

I’m not sure if that value is the code you use directly in the config or if it needs to be passed thru a converter first. The docs don’t seem to indicate that there is anything else that needs to be done so I assume they should be good to use as is. But I don’t have any experience with that method.

https://www.home-assistant.io/components/broadlink/#how-to-obtain-irrf-packets

Hello to teach an IR signal with HA I go, as described here before …
Developer Tools …“service”…“broadlink.learn”…
(Adjust the IP address of Broadlink RM Pro … make sure that this is a static IP !!) and press “Call Service”
An orange light on the RM Pro goes on
Press the desired button on the remote control

Now appears in the overview …

Now go back to the “developer tools” and call up the “states”, here should now appear as a similar entry …


Copy the IR code and go to “Developer Tools” and select “Services”. Choose “broadlink.send” and insert the IR code here …

Click on “Call service”, now the signal would have to be sent …
Whether this also works with a 433 MHz signal, I can not say, here are often “rolling codes” !!!
An example of my “configuration.yaml” to turn on a satellite receiver looks like this …

switch: 
  - platform: broadlink
    host: 192.168.178.71
    mac: '34:EA:34:43:2E:17' 
    type: rm2_pro_plus
    switches:
      sat:
        friendly_name: "Sat Receiver"
        command_on: 'JgBgAB4dHR06OjsdHR0eHB4dHjkeHTodHgALnB0dHR07OjscHh0eHB0dHzkdHTscHgALnB8cHhw7OTsdHhwfHB4cHjkfHDscHgALnB4cHxs8OTwcHhweHB4cHzkeHDwcHgANBQAAAAAAAAAA'
        command_off: 'JgBgAB4dHR06OjsdHR0eHB4dHjkeHTodHgALnB0dHR07OjscHh0eHB0dHzkdHTscHgALnB8cHhw7OTsdHhwfHB4cHjkfHDscHgALnB4cHxs8OTwcHhweHB4cHzkeHDwcHgANBQAAAAAAAAAA'

I only use the IR codes with “SmartIR” or “NodeRED”.
Maybe I could help …
I wish you success!!!

FYI, this script https://github.com/rdidyk/broadlink-logger can write down learned commands into CSV files

[Python]

1 Like

Thx @tom_l, the Learning IR codes from broadlink switch comment (video) soled my problem! :slight_smile:

1 Like

Hello there.

I am trying to set up my Broadlink Rm Mini 3 in HA/NR to trigger commands from Node Red. After failing to capture the IR commands directly in NR I now tried this approach.

I added

switch:
  - platform: broadlink
    host: 192.168.2.181
    mac: '24:DF:A7:42:DD:3F'
    type: rm_mini
    timeout: 30

to my configurations.yaml and made the IP static in my router. (When adding a # before “switch” like it is shown in the video the services do not get added to Hassio)

Now I see the broadlink.learn service (thats already something i guess!) however nowadays the host has to be specified in .YAML apparently, so i enter

host: 192.168.2.181

and click on “call service”. Nothing happens - there is no pop-up in the lower left corner telling me the service was called, no light on the RM Mini and nothing on the overview page or in the states. Interestingly, if I enter any other IP, then there is a pop-up telling me that the service was NOT called!

This whole thing is driving me insane since days - do you have any idea what i am doing wrong?

(German works too for me if thats easier. I will translate the solution - if found - to english for others who come by this thread)

Hello, maybe I can help you. First I would change the entry in “configuration.yaml” like this …

switch:
  - platform: broadlink
    host: 192.168.2.181
    mac: 24:DF:A7:42:DD:3F
    type: rm_mini

then check whether the config is OK, if so restart HA. When HA is restarted go to Developer Tools -> Service and enter this here …

press “Call service”
now the orange LED on the Broadlink should light up. If so, press a button on your remote control, the orange LED goes out. Now a small orange dot with a number should appear on the screen on the notification bell at the bottom left. When opening, the learned code should appear here …

Oh, there is an orange LED on my Broadlink, I don’t know whether your device has an orange LED

Hope I could help, good luck and have fun with Home Assistant

Thanks for the detailed instructions. Alas - nothing happens. No LED, no orange notification-dot, no entry in the stats.

So here is something new: I updated my OS, HA core and all integrations. Now when i press “call service” still nothing happens and no led lights up, however after 30sec there appears a notification saying " Broadlink switch: No signal was received".

Obviously i tried firing the remote at the broadlink withing these 30sec, however it still tells me that no signal was recieved.

Also for test purposes i looked up a random code online and tried sending it to the RM mini using broadlink.send with the following Service Data:

host: 192.168.2.181
packet: JgDuAAw6ChgKGQoYChkKGAo7CzoLGAo7CxgJGQoYCzsKGAoABfsLOwsXChkKGAoZCjsLFwoZCjsLFwo8CjsLOgsXCjsLAAW1CzsKGAoZChgKGQoYCjsKOwsYCjsLFwoZChgKOwsYCgAGGAs6CxcLGAoYChkKOwsYChgKOwsYCjsLOgs6CxgKOwsABdELOgsYCxcKGQoYChkKOws6CxcLOwoYChkKGAo7CxgKAAYYCzoLFwsYChgKGQo7CxcLGAo7CxcLOws6CzoLFws6CwAF0gs6CxgKGAsYChgKGQo7CzoLGAk8ChgKGQoYCjsLGAoADQUAAAAAAAAAAAAA

However again, nothing happens and the LED does not light up. When using the broadlink app to control my devices (wich works perfectly) the LED flashes orange when firing the command.