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


(davorf) #102

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


(Joakim) #103

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!


(davorf) #104

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


(eschava) #105

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


(Simon) #106

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!


(Joakim) #107

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?


(davorf) #108

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


(Simon) #109

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!


(Simon) #110

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


(IanJ) #111

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.


(Jumpkick) #112

[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'

(Robp2175) #113

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.


(davorf) #114

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


(Robp2175) #115

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.


(Jumpkick) #116

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).


(Ham Wong) #117

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,


(Cato) #118

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


(Jumpkick) #119

This one?


(Ham Wong) #120

HI~~, right, this is works awesome.


(davorf) #121

Hello!

I think you should contact @Kai and discuss that with him, because I’m not sure if it’s allowed, or even legal, to include encryption key and IV in the binding. There is a reason why Broadlink included encryption, and the only way to get hold of the key is hacking/reverse engineering their software. I could easily avoid using the broadlink-python package in my script, but I didn’t want to include those keys. Just my two-cents.

Best regards,
Davor