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

(Cato) #122

Thanks Davor, you are making a valid point. I’ll be sure to have this reviewed and approved before sharing it.

Best Regards,

(davorf) #123


I think you should do that before you spend hours on binding development. Unless you are going to make it even if it can’t be published to the OH add-ons repository.

Best regards,

(Giovanni Tomaselli) #124

I’m getting crazy.
This is my Tv Power On Hex Stream:


This is the output:

openhab@openhab:~/BlackBeanControl$ python -c TVPower
Traceback (most recent call last):
File “”, line 193, in
File “/usr/local/lib/python2.7/dist-packages/broadlink-0.3-py2.7.egg/broadlink/”, line 455, in send_data
self.send_packet(0x6a, packet)
File “/usr/local/lib/python2.7/dist-packages/broadlink-0.3-py2.7.egg/broadlink/”, line 229, in send_packet
payload = aes.encrypt(bytes(payload))
File “/usr/local/lib/python2.7/dist-packages/Crypto/Cipher/”, line 244, in encrypt
return self._cipher.encrypt(plaintext)
ValueError: Input strings must be a multiple of 16 in length

If I add a “0” to the Hex stream the outup is

openhab@openhab:~/BlackBeanControl$ python -c TVPower
Traceback (most recent call last):
File “”, line 192, in
DecodedCommand = CommandFromSettings.decode(‘hex’)
File “/usr/lib/python2.7/encodings/”, line 42, in hex_decode
output = binascii.a2b_hex(input)
TypeError: Odd-length string

Where is the mistake?

Best regards,

(ageorgios) #125

hello, I have trouble finding the code from Wireshark
I can sniff the traffic from == “iphone mac” but cannot find any such code
can someone help?

(Cato) #126


The easiest way by far is to get code string from this site:

It does however require that you an Android device at your disposal when discovering codes.

Best Regards,

(Cato) #127

I forgot to mention that althrough it says it only works for RM1/2 devices, it also works for RM3/Mini. I couldnt find the link where it is described, but basically you have to manually add the RM3 devices as the auto discovery function will not find it.

Best Regards,

(davorf) #128


Sorry for the late reply, I must’ve missed your post somehow. What have you used to get Power on hex stream (BlackBeanControl or Packet capture software)? If you used BlackBeanControl to learn a command, it could be inconsistency between python-broadlink package and BlackBeanControl script version.

Best regards,

(Giovanni Tomaselli) #129

I used packet capture. No luck

But, I re-tried with BlackBeanControl and it works. Wonderful.

(blackm13) #130

Hi guys,
First of all, thank you for all these useful information that helped me to understand how to integrate BlackBean to OpenHab.
I have a question that you might know how to solve.
I am trying to send a discrete IR signal to my LG TV which I found here:
So for example if I want to power on my TV I should send this code using BlackBeanControl:
0000 006d 0026 0000 0155 00aa 0016 0015 0016 0015 0016 0040 0016 0015 0016 0015 0016 0014 0016 0015 0016 0015 0016 0040 0016 0040 0016 0015 0016 0040 0016 0040 0016 0040 0016 0040 0016 0040 0016 0015 0016 0015 0016 0040 0016 0015 0016 0015 0016 0014 0016 0040 0016 0040 0016 0040 0016 0040 0016 0015 0016 0040 0016 0040 0016 0040 0016 0014 0016 0015 0016 060b 0155 0055 0016 0e58 0155 0055 0016 00aa
The issue is that BlackBeanControl doesnt accept this kind of code.
Is there any way to convert this signal so that BlackBeanControl will accept it?
PS(I can record and send signals sucessfully with BlackBeanControl)

(davorf) #131


Do you have an Android smartphone? If you do, you can use ZappIR application to send those discrete codes, and then learn them the usual way. ZappIR has a huge database of regular and discrete IR codes.

Best regards,

(Julian Brennum) #132

Hi, I’m im new to openhab2 and I don’t understand how I can send these exec bindings on a Windows server.

OpenHab is up & running, installed Python 2.7 and dependecies.

Your script is located at: C:\openHAB2\conf\scripts\BlackBeanControl-master
and I want to send -c Yamaha_power_on (to start the learning process)

What do I write in the command field when I create a new thing?

(Hardy Haase) #133

Thanks for all the work so far! I’m very interested in the upcoming (hopefully) binding!

(Lewis) #134

Hi Cato, any luck with an update on whether you can share your binding / RM Pro script due this issue?

If there is a way we could get this approved or even allowed that we could do to our own devices that would help us implement the broadlink devices into OpenHab.

Im not sure if its relevant, however, the Broadlink RM has been successfully used with HA, perhaps even a way we could have OpenHab talk to say a HA server to control it would be a good work around if possible.


(Psyciknz) #135

I’ve been using the broadlink-mqtt code also. Found it really easy to use.

I’ve managed to supply some new samsung codes for distinct source items (hdmi1, 2, 3, 4, tv etc).

(Paul Thomas) #136

All of you seem to be using the Broadlink unit for IR, are any of you using it to control Broadlink sockets or wall switches?

If so, what code do you use with OpenHAB?

(davorf) #137


I’m sorry, but I don’t have any Broadlink sockets, nor wall switches. How do you send on/off commands (outside OH)? With their application? If that’s the case, you could try and intercept network packets, and then use intercepted hex dump in the script. You can find more about ways of doing this at the beginning of this thread.

Best regards,

(Hardy Haase) #138

I’ve been using the python code for a month now, it works great for many of my ir/rf devices but I have one peculiar action. I have an LED light strip that came with the RF remote, I have tried it with both the Broadlink app and the Blackbean script. Both work, but the script seems to randomly ‘bounce’ the code and the light switches momentarily and then switches back to its initial state (the code is for the power toggle since the remote doesn’t have a separate on/off). This is only the case for this remote (all other blackbean items work normally), and it works without the bounce effect in the broadlink app.
In the items file I just set the light’s ON and OFF to the same, I have also tried it with autoupdate=false to see if there was a difference.
Switch Kitchen_led "Kitchen LED" {exec=">[ON:python /opt/openhab/BlackBeanControl/ -c kitchen_led] >[OFF:python /opt/openhab/BlackBeanControl/ -c kitchen_led]"}

Does anyone have insight as to what I might try differently?

(Arno) #139

Am I right in understanding that when you have two Blackbeans, for each you need to learn and store commands separately, since they will use different encryption? E.g. I want to tell my robotic vacuum to return to its base, and thus I fire the IR command on multiple blackbeans (I don’t know where the vacuum is). In that case, will I need to send different commands to each blackbean?

(davorf) #140


Yes, you are right. Broadlink uses something unit-specific to encrypt commands, so, there isn’t a way (at least to my knowledge) to share learned commands amongst Broadlink devices.

Best regards,

(Psyciknz) #141

No I’m not sure this is right. I have two RM3s. I updated the broadlink-mqtt script to accept a mac address in the topic and it will fire the command at the specified device - but the command it sends is read from a file, and works on either device. So I can record a command on one, and fire the command out at the other one (if say learning commands for my stereo which is in another room).