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 »

zak45 wrote: Thursday 20 August 2020 23:52
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 ??
Hmm strange version show 3.8


pi@raspberrypi:~ $ python --version
Python 3.8.0
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Friday 21 August 2020 0:02 and when you do : sudo python --version ??


Hmm strange version show 3.8


pi@raspberrypi:~ $ python --version
Python 3.8.0
Hummm... you do it with : sudo ???
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 »

found out under sudo 1 was running a 2.7 python and pi user 3.8 version so i change it. setup with sudo now also run but also the outcome was "Error importing translate"

d17d219988821a8bf1c810e9d6
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
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 21:03
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.
Alright, i select the ini file by clicking « ini directory » i suppose and then there should be a create device button ? (which i don’t see on my ipad if I’m in the right place)
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DrMacabre wrote: Friday 21 August 2020 7:54 Alright, i select the ini file by clicking « ini directory » i suppose and then there should be a create device button ? (which i don’t see on my ipad if I’m in the right place)
Nope..."ini directory" button browse only.
You need to go to manage and click on the ini file :
Capture.PNG
Capture.PNG (100.32 KiB) Viewed 2762 times
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

wizardnl wrote: Friday 21 August 2020 0:38 found out under sudo 1 was running a 2.7 python and pi user 3.8 version so i change it. setup with sudo now also run but also the outcome was "Error importing translate"

d17d219988821a8bf1c810e9d6
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
Can you double-check this link ( change system-wide):
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 »

zak45 wrote: Friday 21 August 2020 11:58
DrMacabre wrote: Friday 21 August 2020 7:54 Alright, i select the ini file by clicking « ini directory » i suppose and then there should be a create device button ? (which i don’t see on my ipad if I’m in the right place)
Nope..."ini directory" button browse only.
You need to go to manage and click on the ini file :

Capture.PNG
Got it, thank you :)
pfloryann
Posts: 254
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.3
Location: BlooeSky
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

Hi,

I tried to import codes from econtrol app but i have this error:

2020-08-22 18:59:54.462 Error: (Broadlink) Traceback (most recent call last):
2020-08-22 18:59:54.462 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1824, in create_ini_import
2020-08-22 18:59:54.462 with open(path + "jsonSubIr", encoding='utf-8') as remote_name:
2020-08-22 18:59:54.462 FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/domoticz/plugins/Broadlink/ini/import/jsonSubIr'
2020-08-22 18:59:54.462
Domoticz on Raspberry Pi 4 Debian 13 x64
Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy, Yeelight, Xiaomi Purifier Pro, Roborock S5, Gree AC, JBL soundbar, Philips Android Tv
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

pfloryann wrote: Saturday 22 August 2020 18:17 Hi,

I tried to import codes from econtrol app but i have this error:

2020-08-22 18:59:54.462 Error: (Broadlink) Traceback (most recent call last):
2020-08-22 18:59:54.462 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1824, in create_ini_import
2020-08-22 18:59:54.462 with open(path + "jsonSubIr", encoding='utf-8') as remote_name:
2020-08-22 18:59:54.462 FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/domoticz/plugins/Broadlink/ini/import/jsonSubIr'
2020-08-22 18:59:54.462
Do you have put the 3 required files under /home/pi/domoticz/plugins/Broadlink/ini/import/ ?
pfloryann
Posts: 254
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.3
Location: BlooeSky
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

i haven't files into import folder this is empty. Can you tell me please what files must be there?
zak45 wrote: Saturday 22 August 2020 21:43
pfloryann wrote: Saturday 22 August 2020 18:17 Hi,

I tried to import codes from econtrol app but i have this error:

2020-08-22 18:59:54.462 Error: (Broadlink) Traceback (most recent call last):
2020-08-22 18:59:54.462 File "/home/pi/domoticz/plugins/Broadlink/plugin.py", line 1824, in create_ini_import
2020-08-22 18:59:54.462 with open(path + "jsonSubIr", encoding='utf-8') as remote_name:
2020-08-22 18:59:54.462 FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/domoticz/plugins/Broadlink/ini/import/jsonSubIr'
2020-08-22 18:59:54.462
Do you have put the 3 required files under /home/pi/domoticz/plugins/Broadlink/ini/import/ ?
Domoticz on Raspberry Pi 4 Debian 13 x64
Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy, Yeelight, Xiaomi Purifier Pro, Roborock S5, Gree AC, JBL soundbar, Philips Android Tv
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

pfloryann wrote: Saturday 22 August 2020 23:26 i haven't files into import folder this is empty. Can you tell me please what files must be there?

this can help you : https://www.domoticz.com/wiki/Plugins/B ... RM2_Device
oeble
Posts: 5
Joined: Monday 27 June 2016 12:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Python Plugin : Broadlink

Post by oeble »

Hi ,


I use 2 times RM2Pro ... How to get them both in the custom pages ?..I have only one now.
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

oeble wrote: Thursday 27 August 2020 11:12 Hi ,


I use 2 times RM2Pro ... How to get them both in the custom pages ?..I have only one now.
you create a hardware for each, with different port number.
oeble
Posts: 5
Joined: Monday 27 June 2016 12:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Python Plugin : Broadlink

Post by oeble »

Hi Zak45 ,
What do you mean by different port number ? . I have them both working on different IP's and different Mac's.
Do you mean the listener ports ?. the 9000 ?....o what i just try :?
oeble
Posts: 5
Joined: Monday 27 June 2016 12:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Python Plugin : Broadlink

Post by oeble »

Yes it was ...thanks !
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

oeble wrote: Thursday 27 August 2020 22:24 Yes it was ...thanks !
that's it ;)
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Hi,

# 1.5.0 : 27/08/2020
# show admin html page when enter base URL (e.g:http://192.168.1.120:9000)
#
malliaso
Posts: 3
Joined: Saturday 29 August 2020 7:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by malliaso »

Hi,

Thank you for all the good work. I seem to have installed the broadlink plugin correctly using the setup.py and following instructions, with no errors. However when i am trying to add an RM PRo 2 i get this error in the logs
\\ (Broadlink) failed to load 'plugin.py', Python Path used was '/config/plugins/BroadlinkRM2/:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload:/usr/lib/python3.6/site-packages'.
2020-08-29 08:06:26.660 Error: (Kitchen Remote) Module Import failed, exception: 'ModuleNotFoundError'

i am on Python 3.7 and i have set it as default. I also did a sudo apt-get install python3.6 libpython3.6 python3.6-dev, because i notices above that it is looking at python 3.6 folders which where not there before.

Any ideas what is the issue?

Thank you again
zak45
Posts: 954
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

malliaso wrote: Saturday 29 August 2020 7:17 Hi,

\\ (Broadlink) failed to load 'plugin.py', Python Path used was '/config/plugins/BroadlinkRM2/:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload:/usr/lib/python3.6/site-packages'.
2020-08-29 08:06:26.660 Error: (Kitchen Remote) Module Import failed, exception: 'ModuleNotFoundError'

i am on Python 3.7 and i have set it as default. I also did a sudo apt-get install python3.6 libpython3.6 python3.6-dev, because i notices above that it is looking at python 3.6 folders which where not there before.

Any ideas what is the issue?

Thank you again
this path is strange : '/config/plugins/BroadlinkRM2/

you need to create a foder named Broadlink under your </domoticzHome/>plugins folder
execute setup from there.
but before all of that, you need to be sure that you have followed all pre-request as explained of post #1.
malliaso
Posts: 3
Joined: Saturday 29 August 2020 7:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by malliaso »

thank you for your quick reply.

I am running the setup.py from within the Broadlink folder under the plugins in domoticz (actual path for reference is /home/pi/homeassistant/domoticz/plugins/BroadlinkRM2). /home/pi/homeassistant/domoticz is the config directory that i defined in my docker-compose file for domoticz (i am on a raspberry pi 3 using domoticz docker image lsioarmhf/domoticz) . So maybe that is why it is "substituting"' with /config. I have default python set as 3.7. restarted domoticz. i did the entire process from scratch just to be sure. Not getting any errors when running setup.py. All seems ok, but i am still getting the same error when adding my Broadlink RM2
\\ (Broadlink) failed to load 'plugin.py', Python Path used was '/config/plugins/BroadlinkRM2/:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload:/usr/lib/python3.6/site-packages'.
2020-08-29 08:06:26.660 Error: (Kitchen Remote) Module Import failed, exception: 'ModuleNotFoundError'
Not sure whether it adds any info but i also tried the "old" broadlink plugin version and it seems to be working fine (i can add all RM2 remotes), just gettin constant 0 reading on temperature(although they are RMpros with temp sensors). But all command, import etc switches appear fine.

Thank you again.
Post Reply