Python Plugin: Broadlink RM2 V2

Python and python framework

Moderator: leecollings

zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Python Plugin: Broadlink RM2 V2

Post by zak45 »

Hi All,

This is the new release of the Broadlink RM2 plugin. Open new thread just to try to keep things organized.

Import feature added.

To update :

copy plugin.py, plugin_http.py

--For Windows:
copy plugin_http.cmd
--For Other OS:
copy plugin_http.sh

see wiki : http://www.domoticz.com/wiki/Plugins/BroadlinkRM2.html
initial : https://www.domoticz.com/forum/viewtopi ... 65&t=16859
plugin system:http://www.domoticz.com/wiki/Using_Python_plugins
andi216
Posts: 46
Joined: Tuesday 14 March 2017 13:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by andi216 »

You are amazing. Thank you very much for update.
It works very well.
(raspberry pi)
User avatar
sisaenkov
Posts: 50
Joined: Friday 27 May 2016 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8
Location: Moscow, Russia
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by sisaenkov »

Hello.

Do you think about repeat option for command as in Broadlink RM Plugin?
HTTP request in that plugin looks like:

Code: Select all

http://172.16.1.123:7474/send?deviceMac=xxxxxxxxxxxx&codeId=l1467826269529&repeat=10
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

if you need for some reason to repeat the command, I think that all is already there:
Capture.JPG
Capture.JPG (67.97 KiB) Viewed 6859 times
in this case this will repeat the code 3 times.

And even more , on LUA script, you can use :

commandArray['IR/RF RM2 Salon TV On'] = 'On REPEAT 2 INTERVAL 1 SECOND'
User avatar
sisaenkov
Posts: 50
Joined: Friday 27 May 2016 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8
Location: Moscow, Russia
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by sisaenkov »

In some cases this way doesn't allow to repeat 5-10-20 times. For example, when you volume up/down your TV or stereo.
Also it's impossible when On and Off actions are different.
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by maninblack30 »

Hello! I have updated the 3 files (plugin.py, plugin_http.py and plugin_http.sh) however when I try to execute a command it shows the following in my Domoticz log:

2017-04-23 20:08:22.580 (Remote Controller) onCommand called for Unit 11: Parameter 'On', Level: 0 , Connected : True
2017-04-23 20:08:22.580 (Remote Controller) Generate on Command for learned code stored on unit :11
2017-04-23 20:08:22.580 Error: (Remote Controller) ini file not found: /home/pi/domoticz/plugins/broadlink/commands/BroadlinkRM2-15-11.ini

the files are definately in the correct location!
Any ideas?

Ta,

Fraser
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

Hi,
maybe this :
/home/pi/domoticz/plugins/broadlink

The plugin now follow the best practice for implementation, this mean folder name = plugin name
try to rename /home/pi/domoticz/plugins/broadlink by /home/pi/domoticz/plugins/broadlinkRM2
in the same case, a new entry into DEFAULT section of the ini file need to be there : customname.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

@sisaenkov
of course, this is only example.
Now with script / command line you can repeat code as many time you want
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by maninblack30 »

Perhaps easier for me to learn all my commands again?

I did move all the ini files to /home/pi/domoticz/plugins/broadlinkRM2/
and changed the path in the hardware section, but it still gives the same error:

2017-04-23 20:29:03.889 Error: (Remote Controller) ini file not found: /home/pi/domoticz/plugins/broadlinkRM2/BroadlinkRM2-15-11.ini
User avatar
sisaenkov
Posts: 50
Joined: Friday 27 May 2016 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8
Location: Moscow, Russia
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by sisaenkov »

sisaenkov wrote:In some cases this way doesn't allow to repeat 5-10-20 times. For example, when you volume up/down your TV or stereo.
Also it's impossible when On and Off actions are different.
I have found a workaround for this. Learning mode is active until the IR/RF-command is still sending. So I create ini-files with different time of IR/RF-command learning.
But broadlink can send IR command for only 1 second.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

@maninblack30
To try to help, please post full log, from update the plugin (HW page) thru push button.
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by burton666 »

I tried to install earlier on a rpi3 but never got any success. Now I have installed domoticz on a separate linux computer but same result.

I have tried all directions I have found both in the forum and in the wiki. I have installed python 3.4 and python 3.5, tried installing using both pip and pip3.

When I get to this step: "sudo pip3 install broadlink"

Code: Select all

burton666@debian:/usr/local/lib$ sudo pip3 install broadlink
Collecting broadlink
  Using cached broadlink-0.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-z2ws5ee5/broadlink/setup.py", line 12
        except ImportError, e:
                          ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-z2ws5ee5/broadlink
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
burton666@debian:/usr/local/lib$
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

@burton666
looks like new broadlink version has been pushed :
broadlink-0.4.tar.gz

and there is a problem on it.
the version 0.3 that work can be found on the drop box
shoyboom
Posts: 12
Joined: Saturday 25 March 2017 16:42
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by shoyboom »

Hi, i installed it and can learn new cover but I cannot manage to smart web server.
I get this message on log.
Am i doing something wrong? Image

Sent from my ONEPLUS A3000 using Tapatalk
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by maninblack30 »

zak45 wrote:@maninblack30
To try to help, please post full log, from update the plugin (HW page) thru push button.
Hello Zak45, it turns out the path I had on the old install ended in a \ so all the ink files were named "\BroadlinkRMx-x.ini" so once I renamed them all, and added the customname line, it all worked well!

Thanks,
Fraser :lol:
User avatar
michaldobrotka
Posts: 50
Joined: Sunday 01 November 2015 17:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by michaldobrotka »

Hi, can you post link on 0.3 version pls. Can't find it. Thanks
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

michaldobrotka wrote:Hi, can you post link on 0.3 version pls. Can't find it. Thanks
see wiki, file name :
python-broadlink-master.zip
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by burton666 »

Ok, but how do I install it once I have copied the dropbox-file from the wiki?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by zak45 »

burton666 wrote:Ok, but how do I install it once I have copied the dropbox-file from the wiki?
download
unzip
got to folder
pip install .
User avatar
michaldobrotka
Posts: 50
Joined: Sunday 01 November 2015 17:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python Plugin: Broadlink RM2 V2

Post by michaldobrotka »

zak45
Hi zak45,
I downloaded, unzipped file from Dropbox. I rewrite files in plugins/BroadlinkRM2 but with

Code: Select all

sudo pip3 install broadlink
Im still getting error with 0.4 version of tar.gz file. Can you please explain steps how to do it for Dummies?
Thanks and sorry for bothering
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest