Page 2 of 12

Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 22:10
by StanHD
Hi, I am trying to install the plugin:

Platform: Windows 7
Domoticz: V3.6694

Install fails with these last lines in the cmd window:-
-------------------------------------------------------------------------

Skipping implicit fixer: buffer

Skipping implicit fixer: idioms

Skipping implicit fixer: set_literal

Skipping implicit fixer: ws_comma

running build_ext

building 'Crypto.Random.OSRNG.winrandom' extension

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).


----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\Stan\\AppData\\Local\\Temp\\pip-build-191ilrgk\\pycrypto\\setup.py';exe
c(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n')
, __file__, 'exec'))" install --record C:\Users\Stan\AppData\Local\Temp\pip-_t_l
4d3g-record\install-record.txt --single-version-externally-managed --compile" fa
iled with error code 1 in C:\Users\Stan\AppData\Local\Temp\pip-build-191ilrgk\py
crypto
""
"ERROR: broadlink installation error"
Press any key to continue . . .

-------------------------------------------------------------

I have installed Microsoft Visual C++ 10, but the same error occurs.
Any ideas?

Thanks.

Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 22:29
by zak45
Do you have run it as "Administrator" ??

Re: RE: Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 22:36
by StanHD
zak45 wrote:Do you have run it as "Administrator" ??
Yes, I have tried both normal and as administrator.

Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 22:50
by zak45
StanHD wrote:Hi, I am trying to install the plugin:

Platform: Windows 7
Domoticz: V3.6694

Install fails with these last lines in the cmd window:-
-------------------------------------------------------------------------

Skipping implicit fixer: buffer

Skipping implicit fixer: idioms

Skipping implicit fixer: set_literal

Skipping implicit fixer: ws_comma

running build_ext

building 'Crypto.Random.OSRNG.winrandom' extension

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).


----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\Stan\\AppData\\Local\\Temp\\pip-build-191ilrgk\\pycrypto\\setup.py';exe
c(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n')
, __file__, 'exec'))" install --record C:\Users\Stan\AppData\Local\Temp\pip-_t_l
4d3g-record\install-record.txt --single-version-externally-managed --compile" fa
iled with error code 1 in C:\Users\Stan\AppData\Local\Temp\pip-build-191ilrgk\py
crypto
""
"ERROR: broadlink installation error"
Press any key to continue . . .

-------------------------------------------------------------

I have installed Microsoft Visual C++ 10, but the same error occurs.
Any ideas?

Thanks.

looks like you're using python 3.4.. all tests has been done on 3.5.
the pycrypto-2.6.1-cp35-none-win32.whl show me that crypto available only for 3.5 in windows.
if you want to use this plugin, plan to go to 3.5.3, the one I have tested.

Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 22:54
by zak45
deennoo wrote:I'm facing an issue when trying to record an IR code

Code: Select all


2017-03-28 20:45:47.331 User: Admin initiated a switch command (3379/Broadlink - Command/Set Level)

2017-03-28 20:45:47.364 (Broadlink) Calling message handler 'onCommand'.

2017-03-28 20:45:47.364 (Broadlink) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : True

2017-03-28 20:45:47.394 (Broadlink) Connected to Broadlink device.

2017-03-28 20:45:47.394 (Broadlink) All plugin system is on pause for 5s...

2017-03-28 20:45:47.394 (Broadlink) When Broadlink led is lit press the button on your remote within 5 seconds


2017-03-28 20:45:52.781 (Broadlink) b'&\x00\x84\x03\x11/\x13/\x12/\x13/\x11\x10\x11\x10\x11\x0f\x12/\x12\x00\x07[\x96\x91\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13\x0f\x10\x10\x11/\x13/\x12/\x120\x12\x0e\x12\x0f\x12\x0f\x12\x0e\x12\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x10\x11\x10\x11\x0f\x11\x0f\x12/\x120\x12/\x12\x0f\x110\x12/\x110\x12/\x12\x10\x11\x0f\x12\x0f\x110\x12\x00\x07[\x96\x90\x13\x0f\x11\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0f\x110\x12/\x110\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x0f\x12\x92\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x11\x0f\x120\x11/\x120\x12\x0e\x120\x12/\x120\x110\x11\x0f\x12\x0f\x11\x10\x110\x12\x00\x07\\\x95\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x11/\x120\x12\x0f\x11\x10\x110\x12/\x12/\x13.\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x91\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x10\x11\x10\x11/\x120\x12.\x12\x0f\x12/\x13/\x12/\x120\x12\x0f\x11\x10\x11\x0f\x12.\x13\x00\x07[\x96\x91\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x110\x12/\x12\x0f\x11\x10\x11/\x120\x12/\x120\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0e\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12/\x120\x12/\x12\x0f\x12/\x12/\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\x07\\\x95\x90\x13\x0e\x12\x10\x11\x0f\x12\x0f\x110\x12/\x12\x10\x11\x0f\x11/\x120\x110\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x0f\x12\x10\x10\x10\x11\x0f\x110\x12/\x120\x12\x0f\x110\x12/\x120\x11/\x12\x10\x11\x0f\x11\x10\x110\x12\x00\x07\\\x94\x92\x12\x0f\x11\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0e\x120\x12/\x110\x12/\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x91\x12\x0f\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11/\x12/\x12/\x13\x0f\x110\x110\x12/\x13/\x12\x0f\x11\x10\x11\x0f\x110\x11\x00\x07]\x94\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x11/\x13/\x12\x0f\x11\x10\x11/\x13/\x12/\x120\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12/\x13/\x12/\x11\x10\x11/\x120\x12/\x120\x12\x0e\x12\x10\x11\x0f\x12/\x11\x00\x07\\\x95\x92\x12\x0e\x12\x0f\x12\x0f\x12\x0f\x110\x12/\x12\x0f\x11\x0f\x12/\x120\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0f\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13/\x12\x0f\x110\x12/\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\x07\\\x95\x90\x12\x0f\x12\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0f\x110\x11/\x13/\x12/\x12\x10\x11\x0f\x11\x10\x11\x10\x11\x92\x12\x0e\x12\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x10\x11/\x12/\x120\x12\x0f\x110\x12/\x120\x100\x12\x0f\x12\x0f\x11\x10\x110\x12\x00\x07\\\x95\x91\x12\x0f\x11\x10\x11\x10\x11\x0f\x11/\x13/\x12\x0f\x11\x0f\x120\x12/\x12/\x110\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x91\x12\x0f\x12\x0f\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x10\x11/\x13/\x11/\x13\x0f\x11/\x13/\x12/\x120\x12\x0f\x11\x10\x11\x0f\x11/\x12\x00\x07\\\x96\x91\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x11/\x13\x0e\x12\x0f\x12/\x120\x12/\x13/\x12\x0f\x11\x10\x10\x10\x11\x0f\x11\x93\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12/\x120\x110\x12\x0f\x12.\x120\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\r\x05\x00\x00\x00\x00'

2017-03-28 20:45:52.781 Error: (Broadlink) 'onCommand' failed 'AttributeError':''bytes' object has no attribute 'hex''.

2017-03-28 20:45:52.781 Error: (Broadlink) ----> Line 117 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function onCommand

2017-03-28 20:45:52.781 Error: (Broadlink) ----> Line 339 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function learn

2017-03-28 20:45:54.556 User: Admin initiated a switch command (3379/Broadlink - Command/Set Level)

2017-03-28 20:45:54.585 (Broadlink) Calling message handler 'onCommand'.

2017-03-28 20:45:54.585 (Broadlink) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : True

2017-03-28 20:45:54.615 (Broadlink) Connected to Broadlink device.

2017-03-28 20:45:54.615 (Broadlink) All plugin system is on pause for 5s...

2017-03-28 20:45:54.615 (Broadlink) When Broadlink led is lit press the button on your remote within 5 secondes

2017-03-28 20:45:59.855 (Broadlink) b'&\x00\xe0\x01\x95\x91\x13\x0e\x12\x0f\x10\x11\x10\x11\x101\x13-\x13\x0f\x10\x10\x110\x110\x13/\x13.\x13\x0e\x12\x0f\x10\x10\x12\x10\x11\x92\x11\x10\x11\x10\x11\x0f\x0e\x12\x10\x11\x10\x11\x10\x10\x10\x10\x120\x110\x13/\x13\x0e\x101\x100\x120\x101\x13\x0e\x10\x11\x11\x0f\x120\x11\x00\x07\\\x96\x90\x12\x0f\x12\x0f\x11\x10\x10\x10\x110\x13/\x12\x0f\x11\x10\x100\x12/\x13/\x110\x12\x0f\x11\x10\x10\x11\x10\x10\x12\x91\x13\x0f\x10\x10\x11\x10\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0e\x120\x12/\x12/\x13\x0f\x110\x12/\x12.\x13/\x12\x0f\x11\x0f\x12\x10\x11/\x13\x00\x07[\x95\x92\x11\x0f\x12\x0e\x12\x10\x11\x0f\x110\x13/\x12\x0f\x11\x10\x11/\x13/\x11/\x13/\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x92\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x0f\x12\x0f\x12\x0f\x12/\x110\x12/\x13\x0e\x12/\x120\x12/\x12/\x12\x10\x11\x0e\x12\x0f\x12/\x12\x00\x07\\\x95\x92\x11\x0f\x12\x10\x11\x0f\x11\x10\x11/\x12/\x12\x10\x11\x0f\x12/\x13/\x12/\x12/\x11\x11\x11\x0f\x11\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13/\x11\x0f\x110\x12/\x13/\x12/\x12\x10\x11\x0f\x11\x0f\x120\x11\x00\x07\\\x95\x91\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11/\x13/\x11\x10\x11\x0f\x110\x12/\x13/\x12/\x13\x0e\x12\x0f\x11\x10\x11\x10\x10\x92\x12\x10\x11\x0f\x12\x0f\x11\x10\x11\x0e\x12\x0f\x12\x0f\x11\x10\x110\x12/\x12/\x13\x0e\x120\x11/\x120\x110\x12\x0f\x12\x0f\x11\x10\x11/\x13\x00\x07\\\x94\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12/\x13/\x12\x0e\x12\x10\x11/\x12/\x12/\x13/\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x92\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x0f\x11/\x120\x12/\x13\x0e\x12/\x120\x12/\x110\x12\x0e\x12\x10\x11\x0f\x12/\x13\x00\r\x05\x101\x100\x120\x101'

2017-03-28 20:45:59.855 Error: (Broadlink) 'onCommand' failed 'AttributeError':''bytes' object has no attribute 'hex''.

2017-03-28 20:45:59.855 Error: (Broadlink) ----> Line 117 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function onCommand

2017-03-28 20:45:59.855 Error: (Broadlink) ----> Line 339 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function learn

My config

Image

Config is Ok, on plugin point of view...
Now I suspect your python version < 3.5.
Looks like .hex() alias is available only from this one.

Can you confirm your plugin version ?

and try this please :

py
>>import codecs
>>codecs.encode(b'\x12', 'hex_codec')

Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 23:32
by StanHD
Thank you for your reply. I have installed python 3.5, but still also have 3.4 installed. Is that OK? I am worried about breaking the Sonos plug-in if I uninstall 3.4? I still get the same error.

Re: RE: Re: Python Plugin: Broadlink RM2

Posted: Tuesday 28 March 2017 23:34
by deennoo
zak45 wrote:
deennoo wrote:I'm facing an issue when trying to record an IR code

Code: Select all


2017-03-28 20:45:47.331 User: Admin initiated a switch command (3379/Broadlink - Command/Set Level)

2017-03-28 20:45:47.364 (Broadlink) Calling message handler 'onCommand'.

2017-03-28 20:45:47.364 (Broadlink) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : True

2017-03-28 20:45:47.394 (Broadlink) Connected to Broadlink device.

2017-03-28 20:45:47.394 (Broadlink) All plugin system is on pause for 5s...

2017-03-28 20:45:47.394 (Broadlink) When Broadlink led is lit press the button on your remote within 5 seconds


2017-03-28 20:45:52.781 (Broadlink) b'&\x00\x84\x03\x11/\x13/\x12/\x13/\x11\x10\x11\x10\x11\x0f\x12/\x12\x00\x07[\x96\x91\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13\x0f\x10\x10\x11/\x13/\x12/\x120\x12\x0e\x12\x0f\x12\x0f\x12\x0e\x12\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x10\x11\x10\x11\x0f\x11\x0f\x12/\x120\x12/\x12\x0f\x110\x12/\x110\x12/\x12\x10\x11\x0f\x12\x0f\x110\x12\x00\x07[\x96\x90\x13\x0f\x11\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0f\x110\x12/\x110\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x0f\x12\x92\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x11\x0f\x120\x11/\x120\x12\x0e\x120\x12/\x120\x110\x11\x0f\x12\x0f\x11\x10\x110\x12\x00\x07\\\x95\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x11/\x120\x12\x0f\x11\x10\x110\x12/\x12/\x13.\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x91\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x10\x11\x10\x11/\x120\x12.\x12\x0f\x12/\x13/\x12/\x120\x12\x0f\x11\x10\x11\x0f\x12.\x13\x00\x07[\x96\x91\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x110\x12/\x12\x0f\x11\x10\x11/\x120\x12/\x120\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0e\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12/\x120\x12/\x12\x0f\x12/\x12/\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\x07\\\x95\x90\x13\x0e\x12\x10\x11\x0f\x12\x0f\x110\x12/\x12\x10\x11\x0f\x11/\x120\x110\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x0f\x12\x10\x10\x10\x11\x0f\x110\x12/\x120\x12\x0f\x110\x12/\x120\x11/\x12\x10\x11\x0f\x11\x10\x110\x12\x00\x07\\\x94\x92\x12\x0f\x11\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0e\x120\x12/\x110\x12/\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x91\x12\x0f\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11/\x12/\x12/\x13\x0f\x110\x110\x12/\x13/\x12\x0f\x11\x10\x11\x0f\x110\x11\x00\x07]\x94\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x11/\x13/\x12\x0f\x11\x10\x11/\x13/\x12/\x120\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12/\x13/\x12/\x11\x10\x11/\x120\x12/\x120\x12\x0e\x12\x10\x11\x0f\x12/\x11\x00\x07\\\x95\x92\x12\x0e\x12\x0f\x12\x0f\x12\x0f\x110\x12/\x12\x0f\x11\x0f\x12/\x120\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x0f\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13/\x12\x0f\x110\x12/\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\x07\\\x95\x90\x12\x0f\x12\x0f\x12\x0f\x11\x10\x110\x12/\x12\x0f\x12\x0f\x110\x11/\x13/\x12/\x12\x10\x11\x0f\x11\x10\x11\x10\x11\x92\x12\x0e\x12\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x10\x11/\x12/\x120\x12\x0f\x110\x12/\x120\x100\x12\x0f\x12\x0f\x11\x10\x110\x12\x00\x07\\\x95\x91\x12\x0f\x11\x10\x11\x10\x11\x0f\x11/\x13/\x12\x0f\x11\x0f\x120\x12/\x12/\x110\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12\x91\x12\x0f\x12\x0f\x12\x0f\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x10\x11/\x13/\x11/\x13\x0f\x11/\x13/\x12/\x120\x12\x0f\x11\x10\x11\x0f\x11/\x12\x00\x07\\\x96\x91\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x11/\x13\x0e\x12\x0f\x12/\x120\x12/\x13/\x12\x0f\x11\x10\x10\x10\x11\x0f\x11\x93\x11\x10\x11\x0f\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12/\x120\x110\x12\x0f\x12.\x120\x12/\x12/\x13\x0f\x11\x0f\x12\x0f\x110\x12\x00\r\x05\x00\x00\x00\x00'

2017-03-28 20:45:52.781 Error: (Broadlink) 'onCommand' failed 'AttributeError':''bytes' object has no attribute 'hex''.

2017-03-28 20:45:52.781 Error: (Broadlink) ----> Line 117 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function onCommand

2017-03-28 20:45:52.781 Error: (Broadlink) ----> Line 339 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function learn

2017-03-28 20:45:54.556 User: Admin initiated a switch command (3379/Broadlink - Command/Set Level)

2017-03-28 20:45:54.585 (Broadlink) Calling message handler 'onCommand'.

2017-03-28 20:45:54.585 (Broadlink) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : True

2017-03-28 20:45:54.615 (Broadlink) Connected to Broadlink device.

2017-03-28 20:45:54.615 (Broadlink) All plugin system is on pause for 5s...

2017-03-28 20:45:54.615 (Broadlink) When Broadlink led is lit press the button on your remote within 5 secondes

2017-03-28 20:45:59.855 (Broadlink) b'&\x00\xe0\x01\x95\x91\x13\x0e\x12\x0f\x10\x11\x10\x11\x101\x13-\x13\x0f\x10\x10\x110\x110\x13/\x13.\x13\x0e\x12\x0f\x10\x10\x12\x10\x11\x92\x11\x10\x11\x10\x11\x0f\x0e\x12\x10\x11\x10\x11\x10\x10\x10\x10\x120\x110\x13/\x13\x0e\x101\x100\x120\x101\x13\x0e\x10\x11\x11\x0f\x120\x11\x00\x07\\\x96\x90\x12\x0f\x12\x0f\x11\x10\x10\x10\x110\x13/\x12\x0f\x11\x10\x100\x12/\x13/\x110\x12\x0f\x11\x10\x10\x11\x10\x10\x12\x91\x13\x0f\x10\x10\x11\x10\x11\x0f\x12\x0f\x12\x0f\x11\x10\x11\x0e\x120\x12/\x12/\x13\x0f\x110\x12/\x12.\x13/\x12\x0f\x11\x0f\x12\x10\x11/\x13\x00\x07[\x95\x92\x11\x0f\x12\x0e\x12\x10\x11\x0f\x110\x13/\x12\x0f\x11\x10\x11/\x13/\x11/\x13/\x12\x0f\x11\x10\x11\x0f\x12\x0f\x11\x92\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x0f\x12\x0f\x12\x0f\x12/\x110\x12/\x13\x0e\x12/\x120\x12/\x12/\x12\x10\x11\x0e\x12\x0f\x12/\x12\x00\x07\\\x95\x92\x11\x0f\x12\x10\x11\x0f\x11\x10\x11/\x12/\x12\x10\x11\x0f\x12/\x13/\x12/\x12/\x11\x11\x11\x0f\x11\x0f\x11\x10\x11\x92\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x0f\x12\x0f\x110\x12/\x13/\x11\x0f\x110\x12/\x13/\x12/\x12\x10\x11\x0f\x11\x0f\x120\x11\x00\x07\\\x95\x91\x13\x0f\x11\x0f\x12\x0f\x11\x10\x11/\x13/\x11\x10\x11\x0f\x110\x12/\x13/\x12/\x13\x0e\x12\x0f\x11\x10\x11\x10\x10\x92\x12\x10\x11\x0f\x12\x0f\x11\x10\x11\x0e\x12\x0f\x12\x0f\x11\x10\x110\x12/\x12/\x13\x0e\x120\x11/\x120\x110\x12\x0f\x12\x0f\x11\x10\x11/\x13\x00\x07\\\x94\x91\x12\x0f\x12\x0f\x11\x10\x11\x0f\x12/\x13/\x12\x0e\x12\x10\x11/\x12/\x12/\x13/\x12\x0f\x11\x10\x11\x10\x11\x0f\x11\x92\x12\x0f\x12\x0f\x11\x10\x11\x10\x11\x0f\x12\x0f\x11\x10\x11\x0f\x11/\x120\x12/\x13\x0e\x12/\x120\x12/\x110\x12\x0e\x12\x10\x11\x0f\x12/\x13\x00\r\x05\x101\x100\x120\x101'

2017-03-28 20:45:59.855 Error: (Broadlink) 'onCommand' failed 'AttributeError':''bytes' object has no attribute 'hex''.

2017-03-28 20:45:59.855 Error: (Broadlink) ----> Line 117 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function onCommand

2017-03-28 20:45:59.855 Error: (Broadlink) ----> Line 339 in /home/nico/domoticz/plugins/Broadlink/plugin.py, function learn

My config

Image

Config is Ok, on plugin point of view...
Now I suspect your python version < 3.5.
Looks like .hex() alias is available only from this one.

Can you confirm your plugin version ?

and try this please :

py
>>import codecs
>>codecs.encode(b'\x12', 'hex_codec')
Python 3.4 here.

Where to put your order ?

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 8:04
by zak45
For people that are not in python 3.5, lets try this version.
plugin.zip
(3.84 KiB) Downloaded 251 times

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 8:09
by domoraspberryitaly
Will try!

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 8:32
by zak45
StanHD wrote:Thank you for your reply. I have installed python 3.5, but still also have 3.4 installed. Is that OK? I am worried about breaking the Sonos plug-in if I uninstall 3.4? I still get the same error.
lets try this :

https://github.com/axper/python3-pycryp ... -installer

Re: RE: Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 8:49
by StanHD
zak45 wrote:
StanHD wrote:Thank you for your reply. I have installed python 3.5, but still also have 3.4 installed. Is that OK? I am worried about breaking the Sonos plug-in if I uninstall 3.4? I still get the same error.
lets try this :

https://github.com/axper/python3-pycryp ... -installer
Thanks, Installation was now successful, New hardware is available. I already new IP and MAC so filled these in, however getting this error in log:-

2017-03-29 07:45:08.810 (Broadlink RM2) Initialized version 1.0.0, author 'zak45'
2017-03-29 07:45:08.811 Error: Expected: myVar = Domoticz.Device(Name="myDevice", Unit=0, TypeName="", Type=0, Subtype=0, Switchtype=0, Image=0, Options="")
2017-03-29 07:45:08.811 Error: (Broadlink RM2) 'CDevice_init' failed 'TypeError':'argument 8 must be str, not dict'.
2017-03-29 07:45:08.811 Error: Device creation failed, Device object is not associated with a plugin.

Stan

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 10:09
by zak45
@StanHD

Domoticz version 3.70xx or > is required

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 10:12
by deennoo
zak45 wrote:For people that are not in python 3.5, lets try this version.
plugin.zip
Ok it works for me !

Learn : ok
Test : ok
Save : ok
Reset : ok
temp : ok

Debian 8.5 x64 + python 3.4 domoticz 3.7196

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 10:43
by domoraspberryitaly
got it working with python3.4 with the new plugin.py, thank you! don't forget the

sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
and
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 10:51
by StanHD
zak45 wrote:@StanHD

Domoticz version 3.70xx or > is required
Doh!, sorry should have realised. :oops:

Updated to latest Beta, on restart new "Command" switch is created and no errors. :D Can't do any more until I get home tonight.

So to sum-up:- Windows 7, Domoticz V3.7197, Python 3.4.3, Python 3.4 pycrypto-2.6.1 - Working.

Thank you very much for your support, and the plug-in, it is very much appreciated.

Stan

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 22:00
by StanHD
StanHD wrote:
zak45 wrote:@StanHD

Domoticz version 3.70xx or > is required
Doh!, sorry should have realised. :oops:

Updated to latest Beta, on restart new "Command" switch is created and no errors. :D Can't do any more until I get home tonight.

So to sum-up:- Windows 7, Domoticz V3.7197, Python 3.4.3, Python 3.4 pycrypto-2.6.1 - Working.

Thank you very much for your support, and the plug-in, it is very much appreciated.

Stan
Sorry another problem when attempting to learn:-

2017-03-29 20:54:33.867 User: Admin initiated a switch command (1300/Broadlink RM2 - Command/Set Level)
2017-03-29 20:54:33.904 (Broadlink RM2) Calling message handler 'onCommand'.
2017-03-29 20:54:33.904 (Broadlink RM2) onCommand called for Unit 1: Parameter 'Set Level', Level: 10 , Connected : True
2017-03-29 20:54:33.935 (Broadlink RM2) Connected to Broadlink device.
2017-03-29 20:54:33.935 (Broadlink RM2) All plugin system is on pause for 5s...
2017-03-29 20:54:33.935 (Broadlink RM2) When Broadlink led is lit press the button on your remote within 5 seconds
2017-03-29 20:54:38.514 (1-Wire) Temp (Bedroom Flow Temp)
2017-03-29 20:54:39.448 (Broadlink RM2) b'&\x00<\x00Z\x1b\x11\x0c\x11\x0c\x11\x1a\x11\x1a \x0c\x11\x0c\x11\x0c\x11\x0c\x11\r\x10\r\x10\r\x10\r\x1f\x1b\x10\r\x10\r\x10\r\x10\r\x10\r\x1f\r\x11\x1a \x1a \x0c\x11\x1a\x11\x0c \x0c\x11\x1a\x11\r\x10\x00\r\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2017-03-29 20:54:39.448 Error: (Broadlink RM2) 'onCommand' failed 'AttributeError':''bytes' object has no attribute 'hex''.
2017-03-29 20:54:39.448 Error: (Broadlink RM2) ----> Line 117 in C:\Program Files (x86)\Domoticz\plugins\Broadlink\plugin.py, function onCommand
2017-03-29 20:54:39.448 Error: (Broadlink RM2) ----> Line 339 in C:\Program Files (x86)\Domoticz\plugins\Broadlink\plugin.py, function learn

Stan

Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 22:27
by zak45
@StandHD,
you 're in python 3.4 so just download plugin.zip (few post above) and replace plugin.py in your Broadlink directory.

Re: RE: Re: Python Plugin: Broadlink RM2

Posted: Wednesday 29 March 2017 22:54
by StanHD
zak45 wrote:@StandHD,
you 're in python 3.4 so just download plugin.zip (few post above) and replace plugin.py in your Broadlink directory.
Ah, thanks, learning is working perfectly.Image
Once again thank you for this excellent plug-in and patient support.Image

Stan

Re: Python Plugin: Broadlink RM2

Posted: Thursday 30 March 2017 4:36
by markjgabb
hmmm...ive run your setup.exe but no new folders or files are created...dont see a log file anywhere obvious

ive also got the .py script but not sure where to put it when i cant find the folder
server 2012
domtoicz 3.6653

Re: Python Plugin: Broadlink RM2

Posted: Thursday 30 March 2017 12:22
by zak45
@markjgabb

this should be there : "%ProgramFiles(x86)%\Domoticz\plugins\Broadlink\"
And Domoticz v 3.7xxx or >