Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

Post Reply
User avatar
wizardnl
Posts: 10
Joined: Wednesday 11 January 2017 1:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by wizardnl »

when running the setup i get the following error

File "setup.py", line 223
print("\r>> Bytes downloaded -->" + state + str(leng) + state, end='', flush =True)
^
SyntaxError: invalid syntax
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Monday 17 August 2020 19:32 when running the setup i get the following error

File "setup.py", line 223
print("\r>> Bytes downloaded -->" + state + str(leng) + state, end='', flush =True)
^
SyntaxError: invalid syntax
please check that :
Be sure that your active python version is > 3.4
this mean: python --version
should give output e.g. python 3.x.x and not python 2.x.x
see this link https://www.domoticz.com/wiki/Using_Python_plugins
or this one : https://linuxconfig.org/how-to-change-f ... bian-linux
DrMacabre
Posts: 74
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Python Plugin : Broadlink

Post by DrMacabre »

Gret work. How do import my commands from the official app ?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DrMacabre wrote: Thursday 20 August 2020 11:15 Gret work. How do import my commands from the official app ?
Thanks.
Import work only from e-control app.
if you use it, see this link :
https://www.domoticz.com/wiki/Plugins/B ... RM2_Device
DrMacabre
Posts: 74
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Python Plugin : Broadlink

Post by DrMacabre »

zak45 wrote: Thursday 20 August 2020 11:59
DrMacabre wrote: Thursday 20 August 2020 11:15 Gret work. How do import my commands from the official app ?
Thanks.
Import work only from e-control app.
if you use it, see this link :
https://www.domoticz.com/wiki/Plugins/B ... RM2_Device
Oh ok, like the old version then. I thought there was something else. What’s the « upload » « import » and « econtrol » buttons for ?

I got a broadlink bad key when trying to connect to the web interface/import
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DrMacabre wrote: Thursday 20 August 2020 15:49
Oh ok, like the old version then. I thought there was something else. What’s the « upload » « import » and « econtrol » buttons for ?

I got a broadlink bad key when trying to connect to the web interface/import
1:
upload : allow to upload file
import : read ini files from import directory and try to generate ini files to be used by the plugin
econtrol: generate ini files into import folder from e-control database files ( the 3 files required )

2: ????
DrMacabre
Posts: 74
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Python Plugin : Broadlink

Post by DrMacabre »

zak45 wrote: Thursday 20 August 2020 16:16
DrMacabre wrote: Thursday 20 August 2020 15:49
Oh ok, like the old version then. I thought there was something else. What’s the « upload » « import » and « econtrol » buttons for ?

I got a broadlink bad key when trying to connect to the web interface/import
2: ????
I want to import the 3 files, in the instructions, it says connect to http://mydomoticzIP:9000/import

That’s where i get broadlink bad key onscreen message.

Is there another way to upload the 3 files from the app to the plugin ?
DrMacabre
Posts: 74
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Python Plugin : Broadlink

Post by DrMacabre »

Ok the 3 files are now in /ini/ but from there, what should i do ?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DrMacabre wrote: Thursday 20 August 2020 17:05 Ok the 3 files are now in /ini/ but from there, what should i do ?
the files need to be under import folder ....

Just click on e-control button, should create all ini files for import. (name start by IMP-)
If all is ok, click on import and should create ini files that will be under plugin control after.

I let the old WiKi for reference only, but all is now into the admin file (including the file transfert - upload button)
DrMacabre
Posts: 74
Joined: Monday 26 December 2016 16:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11590
Location: France
Contact:

Re: Python Plugin : Broadlink

Post by DrMacabre »

Sorry, i still mostly get it, i have now a bunch of ini files in /import/ and some broadlink ini files in /ini/ but i don’t remember how to turn this into devices. I recently lost my whole domoticz and had to start from scratch but with time i totally forgot the process to make this plugin works. All i can remember is having all my buttons from e-control showing up as devices in domoticz before i crashed :|
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DrMacabre wrote: Thursday 20 August 2020 19:16 Sorry, i still mostly get it, i have now a bunch of ini files in /import/ and some broadlink ini files in /ini/ but i don’t remember how to turn this into devices. I recently lost my whole domoticz and had to start from scratch but with time i totally forgot the process to make this plugin works. All i can remember is having all my buttons from e-control showing up as devices in domoticz before i crashed :|
No problem.
This is a new plugin with new logic.
Now, Domoticz device is not automatically created, you select the ini file you want and click on create device.
User avatar
wizardnl
Posts: 10
Joined: Wednesday 11 January 2017 1:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by wizardnl »

zak45 wrote: Monday 17 August 2020 21:07
wizardnl wrote: Monday 17 August 2020 19:32 when running the setup i get the following error

File "setup.py", line 223
print("\r>> Bytes downloaded -->" + state + str(leng) + state, end='', flush =True)
^
SyntaxError: invalid syntax
please check that :
Be sure that your active python version is > 3.4
this mean: python --version
should give output e.g. python 3.x.x and not python 2.x.x
see this link https://www.domoticz.com/wiki/Using_Python_plugins
or this one : https://linuxconfig.org/how-to-change-f ... bian-linux
We execute this command : sudo -H python -m pip install python-broadlink-master/.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing ./python-broadlink-master
Requirement already satisfied: cryptography>=2.1.1 in /usr/lib/python2.7/dist-packages (from broadlink==0.14.1) (2.6.1)
Building wheels for collected packages: broadlink
Running setup.py bdist_wheel for broadlink ... done
Stored in directory: /root/.cache/pip/wheels/22/00/bf/e3f9625cfd51378837b1b45ad17d219988821a8bf1c810e9d6
Successfully built broadlink
Installing collected packages: broadlink
Found existing installation: broadlink 0.14.1
Uninstalling broadlink-0.14.1:
Successfully uninstalled broadlink-0.14.1
Successfully installed broadlink-0.14.1
We have installed : python-broadlink-master/.
________________________________________
# We do necessary modifications depend of Platform
----------------------------------------
put *.py files executable (+x) OK
put *.sh files executable (+x) OK
________________________________________
Checking installation ....
----------------------------------------
Successfully imported googletrans
Error importing translate


Thank this was indeed my error change my python version now during the setup i get a "Error importing translate" error sorry i am a noob with these things
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Thursday 20 August 2020 23:06 We execute this command : sudo -H python -m pip install python-broadlink-master/.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing ./python-broadlink-master
Requirement already satisfied: cryptography>=2.1.1 in /usr/lib/python2.7/dist-packages (from broadlink==0.14.1) (2.6.1)
Building wheels for collected packages: broadlink
Running setup.py bdist_wheel for broadlink ... done
Stored in directory: /root/.cache/pip/wheels/22/00/bf/e3f9625cfd51378837b1b45ad17d219988821a8bf1c810e9d6
Successfully built broadlink
Installing collected packages: broadlink
Found existing installation: broadlink 0.14.1
Uninstalling broadlink-0.14.1:
Successfully uninstalled broadlink-0.14.1
Successfully installed broadlink-0.14.1
We have installed : python-broadlink-master/.
________________________________________
# We do necessary modifications depend of Platform
----------------------------------------
put *.py files executable (+x) OK
put *.sh files executable (+x) OK
________________________________________
Checking installation ....
----------------------------------------
Successfully imported googletrans
Error importing translate


Thank this was indeed my error change my python version now during the setup i get a "Error importing translate" error sorry i am a noob with these things
please type in term session : python --version
and provide your output ....
"
debian@debian10:~$ python --version
Python 3.7.3
debian@debian10:~$

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

Re: Python Plugin : Broadlink

Post by zak45 »

@wizardnl

I need also this :

sudo -H python -m pip list
User avatar
wizardnl
Posts: 10
Joined: Wednesday 11 January 2017 1:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by wizardnl »

pi@raspberrypi:~ $ python --version
Python 3.8.0
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo -H python -m pip list
Package Version
----------------- ---------
asn1crypto 0.24.0
broadlink 0.14.1
certifi 2018.8.24
chardet 3.0.4
configparser 3.5.0b2
cryptography 2.6.1
entrypoints 0.3
enum34 1.1.6
idna 2.6
ipaddress 1.0.17
keyring 17.1.1
keyrings.alt 3.1.1
pip 18.1
pycrypto 2.6.1
PyGObject 3.30.4
pyOpenSSL 19.0.0
pyxdg 0.25
requests 2.21.0
requests-toolbelt 0.9.1
RPi.GPIO 0.7.0
SecretStorage 2.3.1
setuptools 40.8.0
six 1.12.0
urllib3 1.24.1
wheel 0.32.3
pi@raspberrypi:~ $
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Thursday 20 August 2020 23:32 pi@raspberrypi:~ $ python --version
Python 3.8.0
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo -H python -m pip list
Package Version
----------------- ---------
asn1crypto 0.24.0
broadlink 0.14.1
pi@raspberrypi:~ $
Looks ok....
Do you install with "python setup.py" or "sudo python setup.py" ???
User avatar
wizardnl
Posts: 10
Joined: Wednesday 11 January 2017 1:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by wizardnl »

zak45 wrote: Thursday 20 August 2020 23:38
wizardnl wrote: Thursday 20 August 2020 23:32 pi@raspberrypi:~ $ python --version
Python 3.8.0
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo -H python -m pip list
Package Version
----------------- ---------
asn1crypto 0.24.0
broadlink 0.14.1
pi@raspberrypi:~ $
Looks ok....
Do you install with "python setup.py" or "sudo python setup.py" ???
python setup.py
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Thursday 20 August 2020 23:42 Do you install with "python setup.py" or "sudo python setup.py" ???
python setup.py
[/quote]

do with : sudo python setup.py
User avatar
wizardnl
Posts: 10
Joined: Wednesday 11 January 2017 1:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by wizardnl »

zak45 wrote: Thursday 20 August 2020 23:43
wizardnl wrote: Thursday 20 August 2020 23:42 Do you install with "python setup.py" or "sudo python setup.py" ???
python setup.py
do with : sudo python setup.py
[/quote]

pi@raspberrypi:~/domoticz/plugins/broadlink $ sudo python setup.py
File "setup.py", line 223
print("\r>> Bytes downloaded -->" + state + str(leng) + state, end='', flush=True)
^
SyntaxError: invalid syntax
pi@raspberrypi:~/domoticz/plugins/broadlink $
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Thursday 20 August 2020 23:47 pi@raspberrypi:~/domoticz/plugins/broadlink $ sudo python setup.py
File "setup.py", line 223
print("\r>> Bytes downloaded -->" + state + str(leng) + state, end='', flush=True)
^
SyntaxError: invalid syntax
pi@raspberrypi:~/domoticz/plugins/broadlink $
So, come back error occur with wrong python version ...

and when you do : sudo python --version ??
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest