Python Plugin: Broadlink RM2 V3

Python and python framework
Bundy75
Posts: 7
Joined: Friday 08 June 2018 7:26
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by Bundy75 » Monday 11 June 2018 17:35

Thanks for your suggestion - I've removed pycrypto and now it's slightly better but still no perfect ;-)

Code: Select all

2018-06-11 17:27:24.126 (RM3) Device ID: '48'
2018-06-11 17:27:24.126 (RM3) Device Name: 'RM3 - Command'
2018-06-11 17:27:24.126 (RM3) Device nValue: 0
2018-06-11 17:27:24.126 (RM3) Device sValue: ''
2018-06-11 17:27:24.126 (RM3) Device LastLevel: 0
2018-06-11 17:27:24.126 (RM3) Device: 254 - ID: 49, Name: 'RM3 - Remote', nValue: 0, sValue: ''
2018-06-11 17:27:24.126 (RM3) Device ID: '49'
2018-06-11 17:27:24.126 (RM3) Device Name: 'RM3 - Remote'
2018-06-11 17:27:24.126 (RM3) Device nValue: 0
2018-06-11 17:27:24.126 (RM3) Device sValue: ''
2018-06-11 17:27:24.126 (RM3) Device LastLevel: 0
2018-06-11 17:27:24.126 (RM3) Device: 255 - ID: 50, Name: 'RM3 - Import', nValue: 0, sValue: ''
2018-06-11 17:27:24.126 (RM3) Device ID: '50'
2018-06-11 17:27:24.126 (RM3) Device Name: 'RM3 - Import'
2018-06-11 17:27:24.126 (RM3) Device nValue: 0
2018-06-11 17:27:24.126 (RM3) Device sValue: ''
2018-06-11 17:27:24.126 (RM3) Device LastLevel: 0
2018-06-11 17:27:24.126 (RM3 - Import) Updating device from 0:'' to have values 0:'Off'.
2018-06-11 17:27:24.131 (RM3) Update 0:'Off' (RM3 - Import)
2018-06-11 17:27:24.131 (RM3) Connecting to: 192.168.0.216:34EA34BB1E4B
2018-06-11 17:27:24.147 Error: (RM3) Error Connecting to Broadlink device....
2018-06-11 17:27:24.147 (RM3 - Command) Updating device from 0:'' to have values 0:'Off'.
2018-06-11 17:27:24.152 (RM3) Update 0:'Off' (RM3 - Command)
2018-06-11 17:27:24.152 (RM3) Device Number begin to : 1
2018-06-11 17:27:24.155 (RM3) No ini file :C:/BroadlinkRM2/remote/plugin_remote_17.ini
2018-06-11 17:27:24.155 (RM3) Custom Commands for Remote not managed
2018-06-11 17:27:24.155 (RM3) Heartbeat interval set to: 30.
2018-06-11 17:27:24.155 (RM3) Heartbeat interval set to: 30.
Plugin produces more output to the log but it still fails to connect to Broadlink.
When I try to click "Learn" I receive the following error (broadlink 0.5 installed)

Code: Select all

2018-06-11 17:32:21.036 User: Admin initiated a switch command (48/RM3 - Command/Set Level)
2018-06-11 17:32:21.079 (RM3) Calling message handler 'onCommand'.
2018-06-11 17:32:21.079 (RM3) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : False
2018-06-11 17:32:21.092 Error: (RM3) Error Connecting to Broadlink device....
2018-06-11 17:32:21.092 (RM3) All plugin system is on pause for 5s...
2018-06-11 17:32:21.092 (RM3) When Broadlink led is lit press the button on your remote within 5 seconds
2018-06-11 17:32:21.098 Error: (RM3) 'onCommand' failed 'TypeError':'sequence item 0: expected str instance, bytes found'.
2018-06-11 17:32:21.098 Error: (RM3) ----> Line 158 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function onCommand
2018-06-11 17:32:21.098 Error: (RM3) ----> Line 417 in /home/pi/domoticz/plugins/BroadlinkRM2/plugin.py, function learn
2018-06-11 17:32:21.098 Error: (RM3) ----> Line 487 in /usr/lib/python3.4/broadlink/__init__.py, function enter_learning
2018-06-11 17:32:21.098 Error: (RM3) ----> Line 258 in /usr/lib/python3.4/broadlink/__init__.py, function send_packet
2018-06-11 17:32:21.098 Error: (RM3) ----> Line 162 in /usr/lib/python3.4/broadlink/__init__.py, function encrypt_pyaes

Bundy75
Posts: 7
Joined: Friday 08 June 2018 7:26
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by Bundy75 » Monday 11 June 2018 18:20

I think that I've managed to solve it!!!
Uninstalled 'pyaes' and installed pycrypto instead and it did the trick :-) Now it works like a charm. Thanks Zak for your huge effort and help!

reza
Posts: 154
Joined: Tuesday 13 September 2016 9:00
Target OS: Raspberry Pi
Domoticz version: 3.5877
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by reza » Friday 15 June 2018 11:15

dear zak, please help me about this topic:
http://www.domoticz.com/forum/viewtopic.php?f=4&t=23843

kalinkamaen
Posts: 92
Joined: Sunday 04 January 2015 16:57
Target OS: Windows
Domoticz version: 4.900
Location: Norway
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by kalinkamaen » Saturday 13 October 2018 21:18

Windows 10 64bit
Domoticz 4.9700 Turned on Beta mode in Settings
Python 3.6 installed

Error I get is "File not found - plugin.py" Where do I find this file, and do I copy to scripts/Python?
Spoiler: show
"Broadlink RM2 python plugin install for Win"
" this need to be run with admin right "
" if pycrypto or pycryptodome are installed you need to remove them "
" this installation file is only for new install "
""
""
"Search python version"
Python 3.6.7rc1
" main module used by the plugin"
"Python version : " 36
Requirement already satisfied: pyaes in c:\users\server\appdata\local\programs\python\python36-32\lib\site-packages (1.6.0)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Processing c:\users\server\appdata\local\temp\ixp000.tmp\python-broadlink-0.8\python-broadlink-0.8
Requirement already satisfied: pyaes==1.6.0 in c:\users\server\appdata\local\programs\python\python36-32\lib\site-packages (from broadlink==0.8) (1.6.0)
Requirement already satisfied: PyCRC in c:\users\server\appdata\local\programs\python\python36-32\lib\site-packages (from broadlink==0.8) (1.21)
Installing collected packages: broadlink
Found existing installation: broadlink 0.8
Uninstalling broadlink-0.8:
Successfully uninstalled broadlink-0.8
Running setup.py install for broadlink ... done
Successfully installed broadlink-0.8
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
File not found - plugin.py
0 File(s) copied
""
"ERROR: copy plugin error"
Press any key to continue . . .
Windows 7, Domoticz 4.9700

zak45
Posts: 565
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 » Sunday 28 October 2018 19:46

plugin.py is included into setup.exe. just do setup.exe /? and you will find additionall command to extract data.

Post Reply

Who is online

Users browsing this forum: TheeDude and 1 guest