Page 7 of 13
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Saturday 26 November 2016 22:38
by l0gic
Hi Guys,
I think I may have an issue with the installation of the Broadlink code.
When running the learn.py I hit the following issue
Code: Select all
Traceback (most recent call last):
File "./learn.py", line 19, in <module>
device.enter_learning()
AttributeError: device instance has no attribute 'enter_learning'
I get a similar issue with the playcode.py
Code: Select all
Traceback (most recent call last):
File "./playcode.py", line 30, in <module>
device.send_data(myhex.decode('hex'))
AttributeError: device instance has no attribute 'send_data'
As I'm having issues with both scripts I'm assuming the issue is with the installation of the broadlink code.
I installed the code using the setup.py install and it seemed to complete without issue.
Any ideas anyone?
Cheers
Kevin
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 27 November 2016 10:32
by tezzlicious
l0gic wrote:Hi Guys,
I think I may have an issue with the installation of the Broadlink code.
When running the learn.py I hit the following issue
Code: Select all
Traceback (most recent call last):
File "./learn.py", line 19, in <module>
device.enter_learning()
AttributeError: device instance has no attribute 'enter_learning'
I get a similar issue with the playcode.py
Code: Select all
Traceback (most recent call last):
File "./playcode.py", line 30, in <module>
device.send_data(myhex.decode('hex'))
AttributeError: device instance has no attribute 'send_data'
As I'm having issues with both scripts I'm assuming the issue is with the installation of the broadlink code.
I installed the code using the setup.py install and it seemed to complete without issue.
Any ideas anyone?
Cheers
Kevin
replace
device = broadlink.device(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
with
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 27 November 2016 20:20
by l0gic
tezzlicious wrote:
replace
device = broadlink.device(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
with
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
Nice one, working well now!
Many thanks
Kevin
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Monday 28 November 2016 19:50
by tuspam
‡
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Monday 28 November 2016 21:11
by tuspam
tezzlicious wrote:
replace
device = broadlink.device(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
with
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
Code: Select all
root@raspberrypi:/home/pi/domoticz/scripts/python# python -V
Python 2.7.3
root@raspberrypi:/home/pi/domoticz/scripts/python# python learn.py
Traceback (most recent call last):
File "learn.py", line 7, in <module>
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
ValueError: non-hexadecimal number found in fromhex() arg at position 0
root@raspberrypi:/home/pi/domoticz/scripts/python#
Any instruction noobs frendly how to install and use for python-broadlink?
Thanks a lot.
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Monday 28 November 2016 21:51
by l0gic
Hi,
Grab the code from github and drop it in a directory on the Pi, I put it in the domoticz area.
There is a file called setup.py, run it as follows "python setup.py install" (no "").
You may find it fails as some dependencies are not available, it did for me.
If so a quick google will set you right, install the required dependencies.
Once the setup.py file runs without error you have installed the code.
HTH
Kevin
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Monday 28 November 2016 21:56
by tuspam
l0gic wrote:Hi,
Grab the code from github and drop it in a directory on the Pi, I put it in the domoticz area.
There is a file called setup.py, run it as follows "python setup.py install" (no "").
You may find it fails as some dependencies are not available, it did for me.
If so a quick google will set you right, install the required dependencies.
Once the setup.py file runs without error you have installed the code.
HTH
Kevin
I did it before
Code: Select all
root@raspberrypi:/home/pi/domoticz/scripts# python setup.py install
running install
running bdist_egg
running egg_info
creating broadlink.egg-info
writing broadlink.egg-info/PKG-INFO
writing top-level names to broadlink.egg-info/top_level.txt
writing dependency_links to broadlink.egg-info/dependency_links.txt
writing broadlink.egg-info/PKG-INFO
writing top-level names to broadlink.egg-info/top_level.txt
writing dependency_links to broadlink.egg-info/dependency_links.txt
writing manifest file 'broadlink.egg-info/SOURCES.txt'
reading manifest file 'broadlink.egg-info/SOURCES.txt'
writing manifest file 'broadlink.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
creating build
creating build/lib.linux-armv7l-2.7
creating build/lib.linux-armv7l-2.7/broadlink
copying broadlink/__init__.py -> build/lib.linux-armv7l-2.7/broadlink
creating build/bdist.linux-armv7l
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/broadlink
copying build/lib.linux-armv7l-2.7/broadlink/__init__.py -> build/bdist.linux-armv7l/egg/broadlink
byte-compiling build/bdist.linux-armv7l/egg/broadlink/__init__.py to __init__.pyc
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying broadlink.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying broadlink.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying broadlink.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying broadlink.egg-info/not-zip-safe -> build/bdist.linux-armv7l/egg/EGG-INFO
copying broadlink.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
creating dist
creating 'dist/broadlink-0.1-py2.7.egg' and adding 'build/bdist.linux-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/egg' (and everything under it)
Processing broadlink-0.1-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/broadlink-0.1-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/broadlink-0.1-py2.7.egg
Extracting broadlink-0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
broadlink 0.1 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.7/dist-packages/broadlink-0.1-py2.7.egg
Processing dependencies for broadlink==0.1
Finished processing dependencies for broadlink==0.1
root@raspberrypi:/home/pi/domoticz/scripts#
Code: Select all
root@raspberrypi:/home/pi/domoticz/scripts/python# python learn.py
Traceback (most recent call last):
File "learn.py", line 7, in <module>
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
ValueError: non-hexadecimal number found in fromhex() arg at position 0
root@raspberrypi:/home/pi/domoticz/scripts/python#
Dependency file is empty
/usr/local/lib/python2.7/dist-packages/broadlink-0.1-py2.7.egg/EGG-INFO/dependency_links.txt
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 11:24
by l0gic
Hi,
your broadlink looks like it has installed fine.
I'm guessing your issue is
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
You need to replace <your RM3 IP address> with the IP address of the broadlink unit and the same with the mac for <your RM3 mac>.
For the mac, remove the : e.g. aa:bb:cc:dd:ee:ff becomes aabbccddeeff
HTH Kevin
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 15:33
by tuspam
l0gic wrote:Hi,
your broadlink looks like it has installed fine.
I'm guessing your issue is
device = broadlink.rm(host=("<your RM3 IP address>",80), mac=bytearray.fromhex("<your RM3 mac>"))
You need to replace <your RM3 IP address> with the IP address of the broadlink unit and the same with the mac for <your RM3 mac>.
For the mac, remove the : e.g. aa:bb:cc:dd:ee:ff becomes aabbccddeeff
HTH Kevin
Thx Kevin
Too many choices - any details how exactly?
device = broadlink.rm(host=("<192.168.1.110>",80), mac=bytearray.fromhex("<aabbccddeeff>"))
device = broadlink.rm(host=("192.168.1.110",80), mac=bytearray.fromhex("aabbccddeeff"))
device = broadlink.rm(host=(192.168.1.110,80), mac=bytearray.fromhex(aabbccddeeff))
device = broadlink.rm(host=(192.168.001.110,80), mac=bytearray.fromhex("<aabbccddeeff>"))
etc.
Code: Select all
root@raspberrypi:/home/pi/domoticz/scripts/python# python learn.py
File "learn.py", line 7
device = broadlink.rm(host=(192.168.1.110,80), mac=bytearray.fromhex(B4430DEEE880))
^
SyntaxError: invalid syntax
root@raspberrypi:/home/pi/domoticz/scripts/python#
Code: Select all
root@raspberrypi:/home/pi/domoticz/scripts/python# python learn.py
Traceback (most recent call last):
File "learn.py", line 7, in <module>
device = broadlink.rm(host=(192168001110,80), mac=bytearray.fromhex(b4430deee880))
NameError: name 'b4430deee880' is not defined
root@raspberrypi:/home/pi/domoticz/scripts/python#
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 16:10
by l0gic
Hi,
device = broadlink.rm(host=("192.168.1.110",80), mac=bytearray.fromhex("B4430DEEE880"))
should do it for you, I've not got access to my Pi ATM so I can't check.
ATB
Kevin
Edit;
just checked and assuming your IP and MAC are correct then the syntax is good to go.
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 16:47
by tuspam
l0gic wrote:Hi,
device = broadlink.rm(host=("192.168.1.110",80), mac=bytearray.fromhex("B4430DEEE880"))
should do it for you, I've not got access to my Pi ATM so I can't check.
....
Bingo - thanks a lot
Edit:
Everything works like a charm with RM2 and RM mini (without android device).
I got about 2 sec delay between click dummy switch on domoticz to RM action. Now i can control Broadlink via HA bridge using google home and amazon dot.
Thanks again.
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 20:57
by noddy119
Everything works like a charm with RM2 and RM mini (without android device).
I got about 2 sec delay between click dummy switch on domoticz to RM action. Now i can control Broadlink via HA bridge using google home and amazon do
Did you comment out (insert an # at the beginning of the line) the 'time.sleep' lines in playcode.py ?
Without these lines (for test purposes) the script runs quicker....

Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Tuesday 29 November 2016 21:21
by tuspam
noddy119 wrote:
Did you comment out (insert an # at the beginning of the line) the 'time.sleep' lines in playcode.py ?
Without these lines (for test purposes) the script runs quicker....

About 1 sec delay - awesome
Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Saturday 03 December 2016 19:31
by korniza
I bought broadlink black bean.
Searching on web I found this
https://github.com/davorf/BlackBeanControl
Does anyone is using any API for this device?
Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 04 December 2016 10:58
by Justintime
tuspam wrote:l0gic wrote:Hi,
device = broadlink.rm(host=("192.168.1.110",80), mac=bytearray.fromhex("B4430DEEE880"))
should do it for you, I've not got access to my Pi ATM so I can't check.
....
Bingo - thanks a lot
Edit:
Everything works like a charm with RM2 and RM mini (without android device).
I got about 2 sec delay between click dummy switch on domoticz to RM action. Now i can control Broadlink via HA bridge using google home and amazon dot.
Thanks again.
Just to be clear? The black bean works without interference of an Android device? Or only in combination with the RM2
So who is going to write a wiki? Because the information is not clear how to handle all this.
Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 04 December 2016 18:50
by tuspam
Justintime wrote:tuspam wrote:l0gic wrote:Hi,
device = broadlink.rm(host=("192.168.1.110",80), mac=bytearray.fromhex("B4430DEEE880"))
should do it for you, I've not got access to my Pi ATM so I can't check.
....
Bingo - thanks a lot
Edit:
Everything works like a charm with RM2 and RM mini (without android device).
I got about 2 sec delay between click dummy switch on domoticz to RM action. Now i can control Broadlink via HA bridge using google home and amazon dot.
Thanks again.
Just to be clear? The black bean works without interference of an Android device? Or only in combination with the RM2
So who is going to write a wiki? Because the information is not clear how to handle all this.
Yes RM2 and RM mini (black bean) working without android device. I got 2 of them in different rooms.
Ps
In raspberry pi i have installed domoticz, ha-bridge, and python-broadlink - i can control all my devices via voice (Google Home in one room and Alexa in another)
Re: RE: Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 04 December 2016 19:56
by Justintime
tuspam wrote:Justintime wrote:tuspam wrote:
Bingo - thanks a lot
Edit:
Everything works like a charm with RM2 and RM mini (without android device).
I got about 2 sec delay between click dummy switch on domoticz to RM action. Now i can control Broadlink via HA bridge using google home and amazon dot.
Thanks again.
Just to be clear? The black bean works without interference of an Android device? Or only in combination with the RM2
So who is going to write a wiki? Because the information is not clear how to handle all this.
Yes RM2 and RM mini (black bean) working without android device. I got 2 of them in different rooms.
Ps
In raspberry pi i have installed domoticz, ha-bridge, and python-broadlink - i can control all my devices via voice (Google Home in one room and Alexa in another)
Thanks... Cool that it works with Alexa etc.
But i am still looking for the Holy grail on IR support in Domoticz.
With one device independent from an Android device.
Re: RE: Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 04 December 2016 21:27
by tuspam
Justintime wrote:......
Thanks... Cool that it works with Alexa etc.
But i am still looking for the Holy grail on IR support in Domoticz.
With one device independent from an Android device.
So, You find one.
Re: RE: Re: RE: Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Sunday 04 December 2016 22:03
by Justintime
tuspam wrote:Justintime wrote:......
Thanks... Cool that it works with Alexa etc.
But i am still looking for the Holy grail on IR support in Domoticz.
With one device independent from an Android device.
So, You find one.
So i just need a rm2 than?
Re: RE: Re: RE: Re: RE: Re: Using BROADLINK RM2 on DOMOTICZ
Posted: Monday 05 December 2016 11:19
by tuspam
Justintime wrote:tuspam wrote:Justintime wrote:......
Thanks... Cool that it works with Alexa etc.
But i am still looking for the Holy grail on IR support in Domoticz.
With one device independent from an Android device.
So, You find one.
So i just need a rm2 than?
YES rm2 or black bean.