Python Plugin: Broadlink RM2

Python and python framework

Moderator: leecollings

Post Reply
plaaggeest
Posts: 6
Joined: Thursday 27 April 2017 20:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by plaaggeest »

deennoo wrote:Just test on debian, Domoticz looks lib at

Code: Select all

/usr/local/lib/python3.4/dist-packages/
this mean you need to install python who is used for domoticz

Code: Select all

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install Crypto 
sudo pip3 install broadlink
When done, you have to copy lib on the good dir :

Code: Select all

sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/
Then restart domoticz en enjoy !

Code: Select all

sudo service domoticz restart
@zak45 maybe you can update your wiki with this thank you for this great plugin !

when did you release the one for Orange Box ? ahrd to transforme to freebox revolution ?
Hi,

Code: Select all

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install Crypto 
runs without any problems, but when I perform

Code: Select all

sudo pip3 install broadlink
I receive the following error:

Code: Select all

sudo pip3 install broadlink     Downloading/unpacking broadlink
  Downloading broadlink-0.4.tar.gz
  Running setup.py (path:/tmp/pip-build-8kfdo1wo/broadlink/setup.py) egg_info for package broadlink
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12
        except ImportError, e:
                          ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12

    except ImportError, e:

                      ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-8kfdo1wo/broadlink
Storing debug log for failure in /root/.pip/pip.log
I am a noob and cant tell what the issue is. Some able to help me out?
jlites00
Posts: 22
Joined: Friday 31 March 2017 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by jlites00 »

I receive the following error:

CODE: SELECT ALL
sudo pip3 install broadlink Downloading/unpacking broadlink
Downloading broadlink-0.4.tar.gz
Running setup.py (path:/tmp/pip-build-8kfdo1wo/broadlink/setup.py) egg_info for package broadlink
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12
except ImportError, e:
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12

except ImportError, e:

^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-8kfdo1wo/broadlink
Storing debug log for failure in /root/.pip/pip.log
I'm having the same problem. I tried installing Python 3.5 . Still the same issue.
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:Hi,
there is no way to do that in oneshot for all devices.
On the next release, you should be able to put device off by using Domoticz param:
Capture.JPG
You have to create à pushon button
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
lonwan
Posts: 7
Joined: Thursday 27 April 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Moscow
Contact:

Re: Python Plugin: Broadlink RM2

Post by lonwan »

plaaggeest wrote:
Hi,

Code: Select all

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install Crypto 
runs without any problems, but when I perform

Code: Select all

sudo pip3 install broadlink
I receive the following error:

Code: Select all

sudo pip3 install broadlink Downloading/unpacking broadlink
 Downloading broadlink-0.4.tar.gz
 Running setup.py (path:/tmp/pip-build-8kfdo1wo/broadlink/setup.py) egg_info for package broadlink
 Traceback (most recent call last):
 File "<string>", line 17, in <module>
 File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12
 except ImportError, e:
 ^
 SyntaxError: invalid syntax
 Complete output from command python setup.py egg_info:
 Traceback (most recent call last):

 File "<string>", line 17, in <module>

 File "/tmp/pip-build-8kfdo1wo/broadlink/setup.py", line 12

 except ImportError, e:

 ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-8kfdo1wo/broadlink
Storing debug log for failure in /root/.pip/pip.log
I am a noob and cant tell what the issue is. Some able to help me out?

I have the same problem!! And I also tried install Python 3.5, the problem did not disappear. I ask for help!
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

This is not due to python version but to broadlink version. Actual version 0.4 had compatibility problem, hope should be solved soon.
in the meantime, see there:
https://www.domoticz.com/forum/viewtopi ... 4&start=20
lonwan
Posts: 7
Joined: Thursday 27 April 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Moscow
Contact:

Re: Python Plugin: Broadlink RM2

Post by lonwan »

Thanks, i'll try it today
plaaggeest
Posts: 6
Joined: Thursday 27 April 2017 20:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by plaaggeest »

zak45 wrote:This is not due to python version but to broadlink version. Actual version 0.4 had compatibility problem, hope should be solved soon.
in the meantime, see there:
https://www.domoticz.com/forum/viewtopi ... 4&start=20
Alright, got the broadlink installed via above comment. Thank you!

Copied the plugin files to the created folder.

Created the Broadlink Hardware with IP+Mac. But still have python issues:

Code: Select all

2017-04-28 12:52:28.495 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM2/:/usr/local/lib/python35.zip:/usr/local/lib/python3.5/:/usr/local/lib/python3.5/plat-linux:/usr/local/lib/python3.5/lib-dynload'.
2017-04-28 12:52:28.495 Error: (Broadlink) Module Import failed, exception: 'ImportError'
2017-04-28 12:52:28.495 Error: (Broadlink) Module Import failed: ' Name: broadlink'
2017-04-28 12:52:40.754 Hardware Monitor: Fetching data (System sensors)
2017-04-28 12:52:46.349 (Nest) Thermostat (Thermostaat)
2017-04-28 12:52:46.350 (Nest) Temp + Humidity (Beneden)
2017-04-28 12:53:10.790 Hardware Monitor: Fetching data (System sensors)
2017-04-28 12:53:16.924 (Nest) Thermostat (Thermostaat)
2017-04-28 12:53:16.926 (Nest) Temp + Humidity (Beneden)
2017-04-28 12:53:21.504 (433 Receiver) Temp + Humidity (Boven)
2017-04-28 12:53:30.239 Error: Broadlink hardware (13) thread seems to have ended unexpectedly
Any ideas what this could be?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

plaaggeest wrote:
zak45 wrote:This is not due to python version but to broadlink version. Actual version 0.4 had compatibility problem, hope should be solved soon.
in the meantime, see there:
https://www.domoticz.com/forum/viewtopi ... 4&start=20
Alright, got the broadlink installed via above comment. Thank you!

Copied the plugin files to the created folder.

Created the Broadlink Hardware with IP+Mac. But still have python issues:

Code: Select all

2017-04-28 12:52:28.495 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM2/:/usr/local/lib/python35.zip:/usr/local/lib/python3.5/:/usr/local/lib/python3.5/plat-linux:/usr/local/lib/python3.5/lib-dynload'.
2017-04-28 12:52:28.495 Error: (Broadlink) Module Import failed, exception: 'ImportError'
2017-04-28 12:52:28.495 Error: (Broadlink) Module Import failed: ' Name: broadlink'
2017-04-28 12:52:40.754 Hardware Monitor: Fetching data (System sensors)
2017-04-28 12:52:46.349 (Nest) Thermostat (Thermostaat)
2017-04-28 12:52:46.350 (Nest) Temp + Humidity (Beneden)
2017-04-28 12:53:10.790 Hardware Monitor: Fetching data (System sensors)
2017-04-28 12:53:16.924 (Nest) Thermostat (Thermostaat)
2017-04-28 12:53:16.926 (Nest) Temp + Humidity (Beneden)
2017-04-28 12:53:21.504 (433 Receiver) Temp + Humidity (Boven)
2017-04-28 12:53:30.239 Error: Broadlink hardware (13) thread seems to have ended unexpectedly
Any ideas what this could be?
maybe this :

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

you need to adapt to your configuration
lonwan
Posts: 7
Joined: Thursday 27 April 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Moscow
Contact:

Re: Python Plugin: Broadlink RM2

Post by lonwan »

zak45 wrote:
maybe this :

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

you need to adapt to your configuration
Made on your last post, installed version 0.3 (Successfully installed broadlink-0.3 pycrypto-2.6.1), but in the directory /usr/local/lib/python3.4/dist-packages/ there is no broadlink folder
As a result, I again have a snag. What am I doing wrong?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

lonwan wrote:
zak45 wrote:
maybe this :

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

you need to adapt to your configuration
Made on your last post, installed version 0.3 (Successfully installed broadlink-0.3 pycrypto-2.6.1), but in the directory /usr/local/lib/python3.4/dist-packages/ there is no broadlink folder
As a result, I again have a snag. What am I doing wrong?
do you have mixed python version i.e 2.7.x & 3.x ?
lonwan
Posts: 7
Joined: Thursday 27 April 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Moscow
Contact:

Re: Python Plugin: Broadlink RM2

Post by lonwan »

zak45 wrote: do you have mixed python version i.e 2.7.x & 3.x ?
yes, 2.7 and 3.4, and I tried to install 3.5.
What can I do to make it work?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

lonwan wrote:
zak45 wrote: do you have mixed python version i.e 2.7.x & 3.x ?
yes, 2.7 and 3.4, and I tried to install 3.5.
What can I do to make it work?
your default python env should be 2.7, this made problem.
you should use pip3 command for each installation.
lonwan
Posts: 7
Joined: Thursday 27 April 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Moscow
Contact:

Re: Python Plugin: Broadlink RM2

Post by lonwan »

zak45 wrote: your default python env should be 2.7, this made problem.
you should use pip3 command for each installation.
Spoiler: show
I use pip3 command, But the folder "broadlink" appears in the /usr/local/lib/python3.5/site-packages.
I copied the folder "broadlink" in /usr/local/lib/python3.4/dist-packages/broadlink and /usr/lib/python3.4/
And restarted the service:

Code: Select all

sudo systemctl restart domoticz.service 
But I still get an error in the log, I'm clearly doing something wrong:

Code: Select all

2017-04-29 13:47:54.340 Error: PluginList: Error 'Error document empty.' at line 0 column 0 in XML ''.
2017-04-29 13:47:56.847 (Broadlink) Stopped.
2017-04-29 13:47:57.047 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM2/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2017-04-29 13:47:57.047 Error: (Broadlink) Module Import failed, exception: 'ImportError'
2017-04-29 13:47:57.047 Error: (Broadlink) Module Import failed: ' Name: Crypto'
and:

Code: Select all

2017-04-29 13:53:00.767 Error: Broadlink hardware (10) thread seems to have ended unexpectedly
P.S.:
I finally realized my mistake. I copied the folder "Crypto" :

Code: Select all

sudo cp -r /usr/local/lib/python3.5/site-packages/Crypto /usr/local/lib/python3.4/dist-packages
sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
I restarted the service and I had a temperature sensor and a remote in the switches section! Now it works! Thanks a lot for your help, zak45.
Just want to say that the team

Code: Select all

Python3 --version
Gives out:

Code: Select all

Python 3.5.3
But the team

Code: Select all

Sudo apt-get remove python3
Issue a delete request:

Code: Select all

Libpython3.4 libpython3.4-dev python3.4-dev
What does it mean? Do I have python3.4 and python3.5.3 on the same system?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

@lonwan
nice to see it's work ;-)

yes, you can have various python version installed on the same system. Could be necessary as some script work only with 2.7.x some other with 3.x etc ...
reza
Posts: 112
Joined: Tuesday 13 September 2016 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by reza »

hi. i want test it with windows. i run setup.exe but after install dont add broadlink in hardware.
reza
Posts: 112
Joined: Tuesday 13 September 2016 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by reza »

Untitledjjj.jpg
Untitledjjj.jpg (70.62 KiB) Viewed 3487 times
reza
Posts: 112
Joined: Tuesday 13 September 2016 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by reza »

also for raspberry i want use stable version. can i use this for stable version ?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

reza wrote:also for raspberry i want use stable version. can i use this for stable version ?
yes , can be used from plugin POV but need beta Domoticz version... worked at home since many weeks without trouble.
And for installation problem please read wiki and forum, lot's of informations has been provided.
reza
Posts: 112
Joined: Tuesday 13 September 2016 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by reza »

i want just use stable version 3.5877 (because i did some change in domoticz and i dont want update this). so can you help me for run this on 3.5877 version ?
i need this plugin very :(
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 »

reza wrote:i want just use stable version 3.5877 (because i did some change in domoticz and i dont want update this). so can you help me for run this on 3.5877 version ?
i need this plugin very :(
Sorry , this need domoticz v3.7xxx or better.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest