Python Plugin : Broadlink RM2 V4

Python and python framework

Moderator: leecollings

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

Darkneo wrote: Thursday 07 March 2019 7:04
Hi and thanks for your reply. Is there any way to upgrade the plug-in easily? Or do I need to remove the previous one and git clone the last?
just download plugin.py from dropbox and replace existing one in your plugin folder.
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Hi,
I'll try it out and keep you posted. Thanks.

For others: Please ensure to chmod +x the .sh file in the Broadlink dir (I also chmod the ones .py in the various directories). For me I went from nothing works to very close to make it work properly :)

Edit: @Zak45, you might also change the wiki page (transfered to httpS) ;)
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

Darkneo wrote: Thursday 07 March 2019 17:28 Edit: @Zak45, you might also change the wiki page (transfered to httpS) ;)
Done, thanks ;-)
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Hi,

I think it is better now. But I am having some issue with the switch created. Exemple: I have the ON/OFF IR button for my hifi (It is the same button, and I guess the same code).

After creating the switch, if the hifi is off, the switch powers it on. But if it's on, it does not powers it off. With the IHC app, both (ON/OFF with the same switch) works properly. I try to change the switch type from Push On button to On/Off but still not working. I will try to copy the Push On button to create a Push Off button and see what it gives.
Push On button log
2019-03-08 07:55:55.759 Status: User: Darkneo initiated a switch command (19/Radio on-off/On) ==> Switch the hifi on
2019-03-08 07:55:55.919 Status: User: Darkneo initiated a switch command (19/Radio on-off/On) ==> Does not switch the hifi off

On/Off Switch
2019-03-08 07:56:32.837 Status: User: Darkneo initiated a switch command (16/Broadlink - Command/Set Level) ==> Switch the hifi on
2019-03-08 07:56:40.205 Status: User: Darkneo initiated a switch command (16/Broadlink - Command/Set Level) ==> Does not switch the hifi off
EDIT: For the Learn/Test/Save button, it is OK now :) (just forgot to mention that)
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

Darkneo wrote: Friday 08 March 2019 10:13 EDIT: For the Learn/Test/Save button, it is OK now :) (just forgot to mention that)
Some steps forward; nice :-)
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

The new system
The Broadlink Plugin does not work
Attachments
winscp.jpg
winscp.jpg (57.18 KiB) Viewed 1888 times
modules.jpg
modules.jpg (46.68 KiB) Viewed 1888 times
brdl.jpg
brdl.jpg (174.07 KiB) Viewed 1888 times
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

Broadlink not running
Attachments
domot.jpg
domot.jpg (82.61 KiB) Viewed 1886 times
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Hi,
kniazio wrote: Friday 08 March 2019 14:25 Broadlink not running
I think you're in the Device manager. After adding the hardware Broadlink, new switches are directly created. As you have no errors on your logs, I think t'oure on good track.

Anyway, your broadlink folder is not correct (or not the one I used). In domoticz/plugins you shall have "BroadlinkRM2", copying the .py files within it, ns copy the broadlin folder (that shall contain ___init___.py file). Rename your broadlink folder to BroadlinkRM2 and copy the broadlink folder (for me, it was in /root/python-broadlink/broadlink) to the BroadlinkRM2 folder (a chmod +X on the __init___.py might be needed... I don't remember... try without the chmod and see what it gives :) )
Last edited by Darkneo on Friday 08 March 2019 14:49, edited 2 times in total.
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

Darkneo wrote: Friday 08 March 2019 14:40 Hi,
kniazio wrote: Friday 08 March 2019 14:25 Broadlink not running
I think you're in the Device manager. After adding the hardware Broadlink, new switches are directly created. As you have no errors on your logs, please check that you have the Broadlink switch created correctly

EDIT: BTW, your broadlink folder is not correct (or not the one I used). In Plugin you shall have "BroadlinkRM2", copying the .py files within it, ns copy the broadlin folder (that shall contain ___init___.py file)
Attachments
brdl.jpg
brdl.jpg (45.36 KiB) Viewed 1879 times
switches.jpg
switches.jpg (62.98 KiB) Viewed 1882 times
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Sorry I edited the previous post while comparing your installation folders to mine.

Editing all together :D :D

No you need to copy the Broadlink folder itslef (find -iname broadlink) with all the content. normally it shall ony content a file __init__.py and eventually a pycache folder)

And I guess you will have to restart your domoticz after doing so... OR at leat to "recreate" the hardware. I would recommand restart Domoticz
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 »

@kniazio
you will be on trouble if you need these ones:
Capture.JPG
Capture.JPG (33.45 KiB) Viewed 1869 times
Broadlink plugin will not work in this case.
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

Darkneo wrote: Friday 08 March 2019 14:50 Sorry I edited the previous post while comparing your installation folders to mine.

Editing all together :D :D

No you need to copy the Broadlink folder itslef (find -iname broadlink) with all the content. normally it shall ony content a file __init__.py and eventually a pycache folder)

And I guess you will have to restart your domoticz after doing so... OR at leat to "recreate" the hardware. I would recommand restart Domoticz
It did not do anything
Attachments
brdl.jpg
brdl.jpg (57.89 KiB) Viewed 1868 times
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

__init__.py shall be in another folder.

~/BroadlinkRM2:
plugin.py
plugin_http.py
plugin_http.sh
plugin_send.py

~/BroadlinkRM2/broadlink:
__init__.py

As Zak said, also remove pycrypto (if you do not need it). I did not remove pycrptodome at the time... and I am able to connect to the Broadlink
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

I do not have
Attachments
crypto.jpg
crypto.jpg (70.11 KiB) Viewed 1860 times
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Typo issue on my side.

pycryptodome

On my side, as I said, I have still pycryptodome. Try to remove pycrypto only at first
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

Darkneo wrote: Friday 08 March 2019 16:14 Typo issue on my side.

pycryptodome

On my side, as I said, I have still pycryptodome. Try to remove pycrypto only at first
hands are falling
Attachments
pycrypto.jpg
pycrypto.jpg (73.87 KiB) Viewed 1858 times
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

pycrypto removed
it still does not work

Can you specify the location of the files with the plugin?
Maybe I have bad files
Send me your files
Darkneo
Posts: 24
Joined: Sunday 10 February 2019 16:22
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Darkneo »

Regarding your module list, we have the same files. But I cant send you a zip file later tonight.

in SSH could you please go to plugin folder:

Code: Select all

cd /home/pi/domoticz/plugins
Then:

Code: Select all

ls -a
Then:

Code: Select all

cd BroadlinkRM2
Then:

Code: Select all

ls -a
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by kniazio »

Waste of time
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by pvklink »

Hi all,

Just bought a broadlink rm pro+ and installed it on my rpi 3b with raspbian stretch.
After that i got three switches: broadlink command, remote and import.
I can add devices by doing
-learning,
-save ,then
-generate and finaly
-import
-add the device

Only things that dont work are
- switch remote. When i click on the button it does nothing, its greyed-out.
The errorlog gives: 2019-03-08 21:00:14.967 Error: (broadlink2) ini file not found: /home/pi/domoticz/BroadlinkRM2-26-254.ini
- switch import/webstart.
The errorlog gives:
2019-03-08 21:03:50.453 Error: (broadlink2) 127
2019-03-08 21:03:50.453 Error: (broadlink2) /home/pi/domoticz/plugins/BroadlinkRM2/plugin_http.sh 0.0.0.0 9000 /home/pi/domoticz
2019-03-08 21:03:50.453 Error: (broadlink2) None
2019-03-08 21:03:50.484 Error: (broadlink2) Not able to start Web server

Is there a way to solves these two 'problems'....
The rest seemd to work ok!

Code: Select all

sudo pip3 install broadlink
sudo pip3 install pyaes

download plugin.py
download plugin_send.py
download plugin_http.py
download plugin_http.sh

mkdir BroadlinkRM2 on the domoticx plugin folder 

and copied the scripts  to domoticz/plugins directory 
chmod +x plugin.py
chmod +x plugin_send.py
chmod +x plugin_http.py
chmod +x plugin_http.sh

Hardware config
--------------------
ip 192.168.20.61
mac 780f77fd8633
debug true
generate import true
ini folder /home/pi/domoticz
port 9000
Remote control RM2/RM mini3

domoticz latest beta
Version: 4.10547
Build Hash: a76a0fdb
Compile Date: 2019-03-08 03:04:06
dzVents Version: 2.4.15
Python Version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]

Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest