Python Plugin: Broadlink RM2

Python and python framework

Moderator: leecollings

User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

Do you have run it as "Administrator" ??
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post by StanHD »

zak45 wrote:Do you have run it as "Administrator" ??
Yes, I have tried both normal and as administrator.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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')
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post 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 ?
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

For people that are not in python 3.5, lets try this version.
plugin.zip
(3.84 KiB) Downloaded 251 times
domoraspberryitaly
Posts: 6
Joined: Tuesday 28 March 2017 13:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by domoraspberryitaly »

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

Re: Python Plugin: Broadlink RM2

Post 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
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post 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
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

@StanHD

Domoticz version 3.70xx or > is required
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
domoraspberryitaly
Posts: 6
Joined: Tuesday 28 March 2017 13:43
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post 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/
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post 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.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: RE: Re: Python Plugin: Broadlink RM2

Post 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
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: Python Plugin: Broadlink RM2

Post 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
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

@markjgabb

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

Who is online

Users browsing this forum: No registered users and 1 guest