Broadlink Black Bean (RM 3 Mini) IR Controller - Integration in OpenHAB

After I posted this I actually tried installing tcpdump to my Android phone and using Terminal to run it like this: tcpdump -vv -s 0 -w /sdcard/filename.pcap

I then opened the broadlink app on the same phone and learned codes. After that I opened the pcap in Wireshark.
I found a payload that looked like the codes posted here in QUIC, beginning with 5a… but this didn’t work (tried sending it with Packet Sender and nothing happened).

Where did I do wrong?
And what package is my IR code, and how do I extract it?

Now I actually managed to get two codes through Wireshark:
5aa5aa555aa5aa5500000000000000000000000000000000000000000000000013e7000037276a00618322a2f00d43b401000000bfc50000d3378d08bc688ec459e53492bf048e1a63cfdc10146e500047410f6c824826da9da704439fcebcaa6b949434cba30e20b02f7b2063f9c524fdbbeb19ebe0e552
and
5aa5aa555aa5aa550000000000000000000000000000000000000000000000000ceb000037276a00918122a2f00d43b401000000efc600006c163e70a1e04b6a065b73f81bcb0c5f04fc1c5f191f55c661a7d2a98f494095bd462e80cc9d75165689013d5127ff2d53d083a83b9f0b1de71c033f6c9e8dbfcc908b248c29a0826227a76768748c66

I tried them in Packet Sender, and they worked. But when trying again they don’t work. If I wait for a while and try again, they work. They are not discrete code, it is the same for on and off.
Why is there a wait time before working again?

davorf, I’m sorry about the confused replies I sent before. I finally managed to find out the IR-codes with Wireshark. And I have now read up about the problem with sending the same IR-code multiple times. And that you had a solution for this with dummy codes.

I use a Homebridge plugin called homebridge-rm-mini3, which sends IR-codes to the Broadlink RM3 Mini. This works very well now, but I am not able to send the same code multiple times. The developer doesn’t seem to have a solution for the dummy code.
I have tried to get help from him without any success.

Can you point me in the right direction. I should be able to add a line of code to this:

Which sends a dummy code?

Hello!

Sorry for the late reply on your previous posts. So, you’re not using BlackBeanControl.py? I was wondering why would you sniff UDP packets, when you can learn commands directly from the script. Anyway, BlackBeanControl.py doesn’t use dummy command anymore, since I’ve moved to using python-broadlink package instead of simple UDP payload, and before that, I’ve found a part of the UDP payload that should be changed on every consecutive command sent. You can find changes on the github (you can go through commits to find older version of the script that was using dummy command, or version of the script with random parts of an UDP payload - it’s in the commit made on October 30). Basically, there are two parts of the hex code, both 2 bytes long, that should be changed every time you send a command. It was pretty easy to make that change in python, but, since I’m not very good in Java, I’m not sure about those changes in your code. Hope this helps. If you have any additional questions, feel free to ask.

Best regards,
Davor

Yes, that’s why I didn’t use it. I only want to be able to use my RM3 with Homebridge. I guess your application has no Homebridge support?

I will try to speak with the developer, as I have no idea on how to do this myself.
Thank you for the information!

Hello!

This script is not OpenHAB specific. It’s just a script you can call from the command line. In the OpenHAB, it’s used via Exec binding, so, if Homebridge supports calling an external applications, you could use it that way.

Best regards,
Davor

I’ve published script announced before at https://github.com/eschava/broadlink-mqtt

After start it connects to first found Broadlink device and MQTT broker and listens for commands from openHAB (or any other MQTT client)

E.g. openhab switch item

Switch Broadlink_Samsung_Power {mqtt=">[mqtt-broker:broadlink/tv/samsung/power:command:*:auto]"}

when pressed first time will record IR signal to file and every next press will replay it

Great work guys!

I use Domoticz to control my house and I use an SQ Blaster for IR. They are not made anymore and looking to expand IR into more rooms and this looks like a great cheap alternative way of doing it. I send my IR commands to me SQ Blaster via .sh scripts and works great.

I am assuming once this is setup I only need my Raspberry Pi to send IR commands to the RM3 the same way I do now to my SQ Blaster however as .py scripts instead of .sh… Is that about right?

Cheers guys!

Hi, I have managed to extract some IR codes from my Broadlink RM3 Mini.
I am able to use them, they will turn on my light and my TV. But I’m having trouble with sending the same code after eachother.
These are the codes I have sniffed up:
5aa5aa555aa5aa5500000000000000000000000000000000000000000000000013e7000037276a00618322a2f00d43b401000000bfc50000d3378d08bc688ec459e53492bf048e1a63cfdc10146e500047410f6c824826da9da704439fcebcaa6b949434cba30e20b02f7b2063f9c524fdbbeb19ebe0e552
And:
5aa5aa555aa5aa550000000000000000000000000000000000000000000000000ceb000037276a00918122a2f00d43b401000000efc600006c163e70a1e04b6a065b73f81bcb0c5f04fc1c5f191f55c661a7d2a98f494095bd462e80cc9d75165689013d5127ff2d53d083a83b9f0b1de71c033f6c9e8dbfcc908b248c29a0826227a76768748c66

I testing them with Packet Sender, and if I send the same code twice it wont work, and if I use them after eachother they will work.
I have tried to send a dummy-code:
This is the dummy-code:
000000000000000009000000e00729070b00170a00000000c0a80a0555c100008ec20000000006000000000000000000

But it still doesn’t work?

Hello!

Sorry for the late reply. Sending a same payload two or more times in a row is the problem I was talking about. That’s why I used random 4 bytes inside a payload every time I was generating payload. Before I found that part (two parts of payload, each two bytes long), I was using dummy command, but dummy command has to be a proper IR command, not just random numbers and letters. It has to begin with 5aa5 the same way real command does. The easiest way to do this is to sniff UDP packet of some IR command you are not going to use (i.e. command from an old IR remote), and use that payload as dummy command.

Best regards,
Davor

Hi all,

Thanks for all your hard work above… Using it I have managed to get this working with Domoticz (Create a .py script and call that from a dummy switch). Thats £10 for a pretty good IR blaster that covers most of the room. Happy Days!

Thanks again!

If you install Domoticz, create a dummy switch and call the .py script from that. Then install eDomoticz for Homebridge then you can use it with Homekit :smiley:

Cheers

Guys, some great stuff here, I already own a Harmony Hub but wanted something that would work the telly in the bedroom without spending $90 so I looked at the Black Bean. I have openHAB2 and looking at this thread I think I can install a Black Bean and get a similar set up working for a quarter of the cost. - I just ordered my RM 3.

UPDATE: Following this thread I was able to implement my RM 3 and can now tell Alexa to turn the upstairs Telly on and off. - It was very painless. - Thanks again for all your hard work.

[quote=“davorf, post:104, topic:11453”]This script is not OpenHAB specific.[/quote] @joq3 ^- what he said… I use BlackBeanControl.py with Home Assistant by invoking it as a shell command… IR is pretty much fire and pray anyway, I wouldn’t go over complicating things, if Homebridge can support shell commands just use that.

This is what it looks like in home assistant (you have to edit the config and run the training command once first):

switch:
  platform: command_line
  switches:
    # Emulate TV as a switch
    tv:
        friendly_name: 'TV'
        command_on: 'python2 ~/source/BlackBeanControl/BlackBeanControl.py -c "LG37LC2D PowerOn"'
        command_off: 'python2 ~/source/BlackBeanControl/BlackBeanControl.py -c "LG37LC2D PowerOff"'
        command_state: 'sleep 3 && ping -c 1 -W 1 esptv >/dev/null'

Hi, I am trying to see if I can find some discrete commands for on/off, instead of toggle, for my Sony TV. I cam upon this site. http://files.remotecentral.com/library/3-1/sony/television/power_control/index.html. Is there a way I can convert these hex codes to something BlackBeanControl.py can use? I appreciate any assistance with this and thank you for the great code.

Hello!

Since I’m not author of the broadlink-python package, I can’t tell you how or if it is possible to use IR code to construct broadlink UDP payload. The other way to use discrete codes with RM3 is to learn them directly with BlackBeanControl. I’ve used ZappIR Android application which contains a lot of discrete codes (at least for my Samsung TV) and has a huge code database. If it has codes you need, you use android phone to send a discrete command, and learn it using BlackBeanControl the usual way.

Best regards,
Davor

I would do that but the official remote does not have and off on button, only a toggle. Unfortunately, I do not have an android phone with an IR blaster. I appreciate the thought though, that sounds like a great option.

Unfortunately you’re out of luck, currently there’s no known way to manually encode the codes for the Blackbean and since the codes are encrypted differently each time the BB is initialized, no one can capture the code for you in BB format and share it (otherwise I could do it with my old Logitech Revue box and paste it here).

1 Like

HI, I am using RM Pro now, I currently use Broadlink-MQTT as it can easily record code and transmit code under MQTT command, file will storage by itself.

I found the the RM Pro should work in two mode when setup by two apps which decide which mode to work,
there is two app which all publish by broadlink in iOS appstore (I only found e-control in Google Play store)
one name as e-control and one name as broadlink, when app push wifi config to RM Pro, which works differently, MQTT will found out device which setup by broadlink but not e-control, I don’t know will RM 3 Mini support by broadlink, but if you use ios device, you may give a try,

Hi,
I’m working on a broadlink binding. I got discovery and adding various devices (RMx, A1) as things working. It will probably take me a few weeks to get sending and receiving data working. After I hope to publish it to the community. Please let me know if any of you have any requests or ideas…

Cato

1 Like