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


(Andres) #142

Hello. I’m trying to use this python script… If I run the command from console, it works awesome and my tv turns on and off.
My problem is when I try to use it with Exec Binding. I actually have Openhab2, and the exec binding instructions are not clear.

My items file looks like this:

Switch TVLiving “TVLiving” [ “Switchable” ] {exec=">[ON:sudo python /usr/share/openhab2/exec/BlackBeanControl/BlackBeanControl.py -c TVLivingON] >[OFF:sudo python /usr/share/openhab2/exec/BlackBeanControl/BlackBeanControl.py -c TVLivingON]"}

If I run this command from console: sudo python /usr/share/openhab2/exec/BlackBeanControl/BlackBeanControl.py -c TVLivingON

it works great… BUT when I try to run that command with Exec Binding, it does not work.
Can I get some help??
Thank you in advance.


(Neil) #143

why not just use Cato’s binding? It works fine.

Details here:-


(Andres) #144

I’ve been trying to use it but was impossible to find the “common Authentication Key and IV parameter”… Been googling for 3 hours and not any luck. :confused:


(Ray) #145

Give in “broadlink iv key” and it wil be on a github page, hit 3 or so, it is also called “initial vector” and “initial key”


(Lionello Marrelli) #146

I actually did so. Moreover, it happened to me that when I had to reset a rm3 because I changed the wifi ssid, all the previously stored commands were no longer working and I had to use the learn procedur again (basically canceling the content of the .ini file and sending commands through openhab again).
Edit: Davorf already pointed out this issue when he described the broadlink package


(Heinz Peter Hippenstiel) #147

FYI https://github.com/radinsky/broadlink-http-rest
based on https://github.com/davorf/BlackBeanControl

And Broadlink uses QUIC https://en.wikipedia.org/wiki/QUIC


(Nakh Home) #148

Impressive. Do it work also on rf or only infra red?


(Marcel Oliveira) #149

Cato,

It’s working pretty good for R3mini, but it does not work with R3 Pro, do you know how to capture RM3 pro? I can’t find a way to do that…


(Panos) #150

Hello all,
although when running the command

python /home/openhabian/addons/BlackBeanControl/BlackBeanControl.py -c SamsungTVPower

from command line works, trying this from a rule

executeCommandLine("/usr/bin/python /home/openhabian/addons/BlackBeanControl/BlackBeanControl.py -c SamsungTVPower", 5000)

returns this to the log

File “/home/openhabian/addons/BlackBeanControl/BlackBeanControl.py”, line 5, in <module>
import configparser
ImportError: No module named configparser

User openhabian is added to visudo like so

root    ALL=(ALL:ALL) ALL
openhabian ALL=(ALL) NOPASSWD: ALL

What am I doing wrong ?

Regards


(davorf) #151

Hello!

Do you have Python 2.X and Python 3.X installed in parallel? Maybe calling python and /usr/bin/python calls different instances (one you’ve installed configparser to, and the other you haven’t. I’m not using Python on Linux, so, this is just a guess.

Best regards,
Davor


(Panos) #152

Hello @davorf,
I do have both but

[13:30:12] openhabian@openHABianPi:~$ ls /usr/bin/python*
/usr/bin/python   /usr/bin/python2.7         /usr/bin/python2-config  /usr/bin/python3.5   /usr/bin/python3m
/usr/bin/python2  /usr/bin/python2.7-config  /usr/bin/python3         /usr/bin/python3.5m  /usr/bin/python-config
[13:30:30] openhabian@openHABianPi:~$ which python
/usr/bin/python
[13:30:51] openhabian@openHABianPi:~$ python --version
Python 2.7.13

and also running python --version also replied

13:34:21.918 [INFO ] [ipse.smarthome.model.script.execTest] - Python 2.7.13

What can be wrong in this case ?

Regards


(davorf) #153

Hello!

As I’ve said, I don’t have Linux to test this on, but you can try and install/upgrade configparser in all the versions you have. By looking at the lines in your post above, I don’t know if there are 2.7 and 3.5 only, or there are python2 and python as separate installs too. So, to be sure you did this in 2.7 and 3.5 at least, start each version (so, you can see which one is it when Python shell is started), and use following commands to install/update configparser:

import pip._internal as pip
pip.main(['install'] + ['configparser'] + ['--upgrade'])

Best regards,
Davor