Page 3 of 12
Re: Python Plugin: Broadlink RM2
Posted: Thursday 30 March 2017 14:36
by shoyboom
hi everyone and thank you for the plugin.
i installed it on my raspberry and i works grate.
have a question.
how can i combine several battens to one switch. ex " power on/off, hdmi1, hdmi2....."?
thank you
yaron
Re: Python Plugin: Broadlink RM2
Posted: Thursday 30 March 2017 15:13
by StanHD
Hi,
After you have created the individual buttons, create a Selector Switch from the Dummy Hardware, then you can use the jason interface to define the sub-switches:-
You can find a comprehensive explanation of the Jason Interface in the Domoticz Wiki.

Re: Python Plugin: Broadlink RM2
Posted: Thursday 30 March 2017 19:50
by zak45
All,
plugin updated to be compatible with version < 3.5.
wiki updated
http://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html
@shoyboom
see wiki
thanks
Re: Python Plugin: Broadlink RM2
Posted: Thursday 30 March 2017 23:26
by markjgabb
hmmm interesting...ive upgraded to 3.7x beta...but i dont have a plugins folder....
ive manually created
ive run setup from admin cmd
interestingly it says setup complete, but it only takes like 2 seconds and domoticz doesnt restart....
possible conflict with server 2016?
Re: Python Plugin: Broadlink RM2
Posted: Friday 31 March 2017 0:37
by kniazio
Does the plugin recognize 433MHz RF codes?
Because he sees no.
Posted: Friday 31 March 2017 10:33
by burton666
I just tried this plugin on my rpi, but I can't get it to work. It looks like I have pyhon 2.7 installed, I tried the instructions and replaced the path python3.4 with python2.7 and downloaded and copied the files to the right location. But It still does not work.
I also wonder about the plugin directory, is it domoticz/plugins? And you are supposed to create the broadlink -folder yourself and put the .py files there?
I also tried upgrading the python version to a newer like it said in the beginning of this thread, but that does not work either. I still only have the python2.7 in the specified location and pip3 does not work.
Re:
Posted: Friday 31 March 2017 11:50
by kniazio
burton666 wrote:I just tried this plugin on my rpi, but I can't get it to work. It looks like I have pyhon 2.7 installed, I tried the instructions and replaced the path python3.4 with python2.7 and downloaded and copied the files to the right location. But It still does not work.
I also wonder about the plugin directory, is it domoticz/plugins? And you are supposed to create the broadlink -folder yourself and put the .py files there?
I also tried upgrading the python version to a newer like it said in the beginning of this thread, but that does not work either. I still only have the python2.7 in the specified location and pip3 does not work.
Try this
sudo curl -L install.domoticz.com | sudo bash
apt-get dist-upgrade
sudo apt-get install python3.4.2
sudo apt-get install python3-dev
sudo apt-get install libpython3.4
sudo apt-get install libglib2.0-dev
sudo apt-get install python3-pip
sudo pip3 install broadlink
sudo pip3 install Crypto
sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/
sudo service domoticz restart
copy plugins plugin.py and plugin_send.py (version for python3.4) to ..../domoticz/plugins/Broadlink/
config broadlink plugin in domoticz and set path for BroadlinkRM2-3-2.ini file to /home/domoticz/plugins/Broadlink/
Re: Python Plugin: Broadlink RM2
Posted: Friday 31 March 2017 12:07
by burton666
Ok, just tried it. the two first commands worked but then when it got to the python-command only this happened:
Code: Select all
pi@raspberrypi ~ $ sudo apt-get dist-upgrade
sudo: unable to resolve host raspberrypi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $ sudo apt-get install python3.4.2
sudo: unable to resolve host raspberrypi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.4.2
E: Couldn't find any package by regex 'python3.4.2'
Re: Python Plugin: Broadlink RM2
Posted: Friday 31 March 2017 20:18
by jlites00
Hi, thanks for this great plugin. Unfortunately, I'm unable to get it to work on RPI3. the issue I'm having is similar to @kniazio
Are we suppose to create a folder then copy the files into or something else. The other thing is, does the plugin supports 433mhz radio?
I tried installing Python 3.5 by running the following script. It does it thing and I get this
Raspberry Pi pi @: ~ $ -version python
Python 2.7.9
ft @ Raspberry Pi: ~ $ python3 -version
Python 3.5.1
ft @ Raspberry Pi: ~ $ -version python
Python 2.7.9
ft @ Raspberry Pi: $ ~
Installing Python 3.5.1
cd ~
wget
https://www.python.org/ftp/python/3.5.1 ... -3.5.1.tgz
tar -zxvf Python-3.5.1.tgz
cd Python-3.5.1
. / Configure && make && sudo make install
Re: Python Plugin: Broadlink RM2
Posted: Friday 31 March 2017 22:10
by zak45
yep,
433 is supported by broadlink module and work for me.
I do not have experience on linux but others already has been able to install it.
wiki has been updated for that.
Re: Python Plugin: Broadlink RM2
Posted: Saturday 01 April 2017 6:52
by kniazio
I want to inform you that the plugin recognizes 433MHz RF codes.
Re: Python Plugin: Broadlink RM2
Posted: Saturday 01 April 2017 17:35
by jlites00
how are you guys getting the plugin to work on RPi 3? I've tried so many times with no luck. I've followed all the steps and even got Python 3.4 & 3.5 installed. I see it has created a Broadlink & Crypto folder but no plugin folder. Am I suppose to create one?
what am I doing wrong in my steps? any help will be very much appreciated.
Re: Python Plugin: Broadlink RM2
Posted: Saturday 01 April 2017 21:21
by zak45
if you do not have it, just create it.
you need also to be on domoticz v 3.7xx or >
Re: Python Plugin: Broadlink RM2
Posted: Saturday 01 April 2017 23:08
by jlites00
Thanks, ZAK45.
I realize I was running 3.5 and I've upgraded to 3.7. In Domoticz folder I see a folder plugins and there are some examples plugins in it. So I created a new folder labeled Broadlink with plugin.py in the folder. So.... /home/pi/domoticz/plugins/Broadlink
I finished off with a sudo reboot, I now see Broadlink RM2 show up in Hardware but there no Param field. I've included a screenshot for your view. My guess is the plugin not launching or it could be something else due to Phyton 3?
Re: Python Plugin: Broadlink RM2
Posted: Sunday 02 April 2017 14:05
by andi216
Thanks for integration Broadlink RM. It works really well (raspberry pi v3).
I tested only the infrared.
I have a question. I connected Broadlink A1 and displays only the temperature.
It is possible to display the rest function (Noise, illumination, humidity and air quality)?
I do not know anything about programming.
Thanks in advance for answers.
Re: Python Plugin: Broadlink RM2
Posted: Sunday 02 April 2017 18:18
by jlites00
I did a fresh install of Domoticz 3.7, Python 3.5 & Broadlink modules on Raspberry Pi V3. It seems to be working now.
Any idea what the error message below is? I get it every time SAFE is hit despite the int file saved in the Broadlink folder.
Error
Filter:
X
2017-04-02 16:41:34.801 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:41:37.156 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:41:38.959 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:42:28.534 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:42:36.948 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:42:37.149 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:42:37.400 Error: (TEST100) ini file not found: /home/pi/domoticz/plugins/Broadlink\BroadlinkRM2-8-1.ini
2017-04-02 16:43:05.704 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:18.353 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:18.380 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:18.380 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:18.380 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:18.380 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:18.380 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:43:24.971 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:24.994 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:24.994 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:24.994 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:24.994 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:24.994 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:43:30.980 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:31.002 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:31.002 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:31.002 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:31.002 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:31.002 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:43:34.833 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:34.859 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:34.859 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:34.859 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:34.859 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:34.859 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:43:37.086 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:37.108 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:37.108 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:37.108 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:37.108 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:37.108 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:43:39.138 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:43:39.159 Error: (TEST101) 'onCommand' failed 'gaierror'.
2017-04-02 16:43:39.159 Error: (TEST101) ----> Line 118 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function onCommand
2017-04-02 16:43:39.159 Error: (TEST101) ----> Line 326 in /home/pi/domoticz/plugins/Broadlink/plugin.py, function learn
2017-04-02 16:43:39.159 Error: (TEST101) ----> Line 455 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2017-04-02 16:43:39.159 Error: (TEST101) ----> Line 255 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2017-04-02 16:44:15.241 Error: (TEST101) Error Connecting to Broadlink device....
2017-04-02 16:46:15.239 Error: (TEST101) Error Connecting to Broadlink device....
Is the LEARN process same as IR & RF 433?
Is there a way to auto-discover the Broadlink hub existing connected devices on Domoticz?
Last but not least, is the plugin compatible with Broadlink TC2 Switches?
Overall great learning curve as I've learned quite a bit. Thanks, ZAK45...
Re: Python Plugin: Broadlink RM2
Posted: Sunday 02 April 2017 19:19
by zak45
@andi216
do not own A1 device, so not able to test, sorry.
@jlites00
this look like
gaierror: [Errno -2] Name or service not known...
Are you sure of the IP address/mac address of your Broadlink RM2 / RM Pro device ??
the learn process is the same for RF/IR
on param "Folder to store ini files" just replace \ by / everywhere
if you read the wiki, there is a way to auto discover Broadlink RM2 device and display IP address & mac in Domoticz log
if you own other Broadlink device, I will suggest also to let only the Broadlink RM2 connected to network during initial settings.
Re: Python Plugin: Broadlink RM2
Posted: Sunday 02 April 2017 19:49
by jlites00
I did double check the IP & MAC, its the same as the logs
Found the problem to "ini" the ID labeling has to be right on the switches or it will get confused.
As for INT
Error
Filter:
X
2017-04-02 17:36:10.986 Error: (TEST 109) ini file not found: everywhere\BroadlinkRM2-14-1.ini
2017-04-02 17:36:12.589 Error: (TEST 109) ini file not found: everywhere\BroadlinkRM2-14-1.ini
2017-04-02 17:36:13.691 Error: (TEST 109) ini file not found: everywhere\BroadlinkRM2-14-1.ini
2017-04-02 17:36:14.493 Error: (TEST 109) ini file not found: everywhere\BroadlinkRM2-14-1.ini
2017-04-02 17:36:14.845 Error: (TEST 109) ini file not found: everywhere\BroadlinkRM2-14-1.ini
2017-04-02 17:39:28.189 Error: (TEST 110) ini file not found: /everywhere\BroadlinkRM2-15-1.ini
2017-04-02 17:39:30.243 Error: (TEST 110) ini file not found: /everywhere\BroadlinkRM2-15-1.ini
2017-04-02 17:39:31.996 Error: (TEST 110) ini file not found: /everywhere\BroadlinkRM2-15-1.ini
2017-04-02 17:40:07.556 Error: (TEST 110) ini file not found: /everywhere\BroadlinkRM2-15-1.ini
... still can't get RF to Learn though but IR, Learns fine.
Re: Python Plugin: Broadlink RM2
Posted: Monday 03 April 2017 6:58
by andi216
@jlites00
Try it! (/)
/home/pi/domoticz/plugins/Broadlink/
Before that delete old ini
Re: Python Plugin: Broadlink RM2
Posted: Monday 03 April 2017 20:32
by jlites00
Just an update. Following @andi216 & @zak45 tip on "Folder to store ini files" directory, they both worked as copied below with no Errors.
/everywhere
or
/home/pi/domoticz/plugins/Broadlink/