Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

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

Re: Python Plugin : Broadlink

Post by zak45 »

Broadlink repository is now hosted on Github:
https://github.com/zak-45/Broadlink-Domoticz-plugin

To be Git compliant, just copy https://github.com/zak-45/Broadlink-Dom ... oadlink.py
to your plugin folder
pfloryann
Posts: 178
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.1
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

Thank you. I tried but with python 3.11.3 doesn't work. I'm back to 3.9 and installing the plugin works perfectly.

Now i have another problem with plugin dashboard, sometihing is wrong, it looks a little different than it was normally: Buttons not working, can't send a command and idx from ini file missing.
I attached an print screen.

Please help me!
Thank you for your support!
Attachments
bug.jpg
bug.jpg (212.14 KiB) Viewed 2906 times
Domoticz on Raspberry Pi 4 with Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy
rewil
Posts: 4
Joined: Friday 03 June 2022 17:16
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by rewil »

Can u add in github malual:
"To be able to see the Web Pages, Custom menu need to be activated: Domoticz / settings."
- screens for this?
"Default link to Web Admin is:"
localhost:XXXX

---

I dont have Web Admin in Custom Pages, but plugin is working :/

BIG THANKS TO ADD REPO TO GITHUB!!!
pfloryann
Posts: 178
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.1
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

this screenshot it was from domoticz custom and custom menu is activated in domoticz. I have the broadlink plugin old version 1.6.1 on another raspberry pi and works very well.
Domoticz on Raspberry Pi 4 with Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

rewil wrote: Friday 12 May 2023 21:36 Can u add in github malual:
"To be able to see the Web Pages, Custom menu need to be activated: Domoticz / settings."
- screens for this?
"Default link to Web Admin is:"
localhost:XXXX

---

I dont have Web Admin in Custom Pages, but plugin is working :/

BIG THANKS TO ADD REPO TO GITHUB!!!
You should have that on the Wiki , no ??
If not, this one need to be updated.
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

pfloryann wrote: Friday 12 May 2023 20:38 Thank you. I tried but with python 3.11.3 doesn't work. I'm back to 3.9 and installing the plugin works perfectly.

Now i have another problem with plugin dashboard, sometihing is wrong, it looks a little different than it was normally: Buttons not working, can't send a command and idx from ini file missing.
I attached an print screen.

Please help me!
Thank you for your support!
Hummm... mainly browser javascript support. Not any clue on what is working or not on Pi ...
pfloryann
Posts: 178
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.1
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

Domoticz server is on Raspberry pi, but i access Domoticz from Pc, screenshot is from PC is not in Raspberry browser.

I have 2 raspberry pi...one with Buster Os, python 3.7 and broadlink plugin 1.6.1 - no problem.
Second server with Bullseye Os, python 3.9 and broadlink 1.6.4 - here i have that problem.
Domoticz on Raspberry Pi 4 with Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy
zak45
Posts: 953
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 13 May 2023 0:18 Domoticz server is on Raspberry pi, but i access Domoticz from Pc, screenshot is from PC is not in Raspberry browser.

I have 2 raspberry pi...one with Buster Os, python 3.7 and broadlink plugin 1.6.1 - no problem.
Second server with Bullseye Os, python 3.9 and broadlink 1.6.4 - here i have that problem.
Ok, thanks, clear now.
Nothing had changed on how the plugin work, Javascript is there since the first release ...!!
If you put your browser in devlopper tool, do yo see any error ?

and could be nice to see one of your ini file ...
pfloryann
Posts: 178
Joined: Wednesday 09 January 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.1
Contact:

Re: Python Plugin : Broadlink

Post by pfloryann »

So, i cheked in the browser console and i found the problem...in folder domoticz/www/js(on raspberry pi path: /home/pi/domoticz/www/js) missing jquery-3.4.1.min.js which the plugin needs. I put it manually and interface of the plugin is good and works. I'm back tomorow with the necessary steps to install this plugin on raspberry pi.

Please check these aspects and if you could add this jquery to the installation kit, I think it would be good.

Thank you!
Domoticz on Raspberry Pi 4 with Zigbee2mqtt and zigbee devices (Xiaomi, Ikea,Tuya, Philips, Osram), Broadlink, Solar power Victron Energy
zak45
Posts: 953
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 13 May 2023 0:59 So, i cheked in the browser console and i found the problem...in folder domoticz/www/js(on raspberry pi path: /home/pi/domoticz/www/js) missing jquery-3.4.1.min.js which the plugin needs. I put it manually and interface of the plugin is good and works. I'm back tomorow with the necessary steps to install this plugin on raspberry pi.

Please check these aspects and if you could add this jquery to the installation kit, I think it would be good.

Thank you!
Great, thanks for the info... the jquery should be provided by Domoticz installation, so maybe something new with Domoticz now. will double check, but I don't want to touch the www folder.
andreaburlizzi
Posts: 6
Joined: Wednesday 01 June 2016 16:55
Target OS: Windows
Domoticz version: 3.9389
Contact:

Re: Python Plugin : Broadlink

Post by andreaburlizzi »

Hello guys, i'm getting a problem with this plugin, i installed domoticz from scratch after a problem with the previous hardware. I got two rm2 pro + devices, both were working with a past version of the plugin without any problem. Now using 1 6 4 only one of them works, when i try to add the other one it results offline and it doesn't work, whem i try to delete it from domoticz everithing crashes. Both devices working using them alone, not together. Last version of Domoticz, Windows 11 and i tried every version of python from 9 to 11, without success. What can i do?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Let's stay on python 3.9. post the log file when you start the second plugin to check.
andreaburlizzi
Posts: 6
Joined: Wednesday 01 June 2016 16:55
Target OS: Windows
Domoticz version: 3.9389
Contact:

Re: Python Plugin : Broadlink

Post by andreaburlizzi »

Here is the log, there is no reference to the other rm pro, they look red and they don't work on the switches tab
Spoiler: show
2023-06-07 17:55:33486 Broadlink Cucina: Worker thread started.
2023-06-07 17:55:33487 Status: Broadlink Cucina: Entering work loop.
2023-06-07 17:55:33525 Status: Broadlink Cucina: Started.
2023-06-07 17:55:34656 Broadlink Cucina: lang file : C:\Program Files (x86)\Domoticz\plugins\Broadlink\lng/enenlng
2023-06-07 17:55:34657 Broadlink Cucina: Language loaded for : en
2023-06-07 17:55:34603 Status: Broadlink Cucina: Initialized version 164, author 'zak45'
2023-06-07 17:55:35694 Broadlink Cucina: Listen on BROWebServer - Port: 9000
2023-06-07 17:55:35701 Broadlink Cucina: Plugin Device count start on : 9
2023-06-07 17:55:35706 Broadlink Cucina: Command line file updated: C:\Program Files (x86)\Domoticz\plugins\Broadlink\log/3RM2txt
2023-06-07 17:55:35707 Broadlink Cucina: Connecting to: 19216806 : 780F774DF086
2023-06-07 17:55:36174 Broadlink Cucina: Connected to Broadlink device: 19216806 RM2
2023-06-07 17:55:36178 Broadlink Cucina: Admin html file created: C:\Program Files (x86)\Domoticz\www/templates/Broadlink-RM2-3html
2023-06-07 17:55:42049 Broadlink Cucina: Update 1:'END of remotePlugin' (Broadlink Cucina - RM2-Status)
2023-06-07 17:55:42052 Broadlink Cucina: Update 1:'On' (Broadlink Cucina - RM2-Status)
andreaburlizzi
Posts: 6
Joined: Wednesday 01 June 2016 16:55
Target OS: Windows
Domoticz version: 3.9389
Contact:

Re: Python Plugin : Broadlink

Post by andreaburlizzi »

i'm adding also the general domoticz log

Code: Select all

2023-06-07 18:06:44.218 Sunrise: 05:19:00 SunSet: 20:13:00
2023-06-07 18:06:44.218 Day length: 14:55:00 Sun at south: 12:46:00
2023-06-07 18:06:44.218 Civil twilight start: 04:46:00 Civil twilight end: 20:46:00
2023-06-07 18:06:44.219 Nautical twilight start: 04:05:00 Nautical twilight end: 21:27:00
2023-06-07 18:06:44.219 Astronomical twilight start: 03:18:00 Astronomical twilight end: 22:14:00
2023-06-07 18:06:44.288 Active notification Subsystems: (0/13)
2023-06-07 18:06:44.305 Starting shared server on: :::6144
2023-06-07 18:06:44.160 Status: Domoticz V2023.1 (c)2012-2023 GizMoCuz
2023-06-07 18:06:44.164 Status: Build Hash: f9b9ac774, Date: 2023-02-14 15:06:40
2023-06-07 18:06:44.175 Status: Startup Path: C:\Program Files (x86)\Domoticz\
2023-06-07 18:06:44.283 Status: PluginSystem: Started, Python version '3.10.11', 1 plugin definitions loaded.
2023-06-07 18:06:44.292 Status: WebServer(HTTP) started on address: :: with port 8080
2023-06-07 18:06:44.304 Status: WebServer(SSL) started on address: :: with port 443
2023-06-07 18:06:44.305 Status: TCPServer: shared server started...
2023-06-07 18:06:44.306 Status: RxQueue: queue worker started...
2023-06-07 18:06:46.317 Broadlink Cucina: Worker thread started.
2023-06-07 18:06:46.468 Broadlink Camera: Worker thread started.
2023-06-07 18:06:46.317 Status: Broadlink Cucina: Entering work loop.
2023-06-07 18:06:46.384 Status: Broadlink Cucina: Started.
2023-06-07 18:06:46.468 Status: Broadlink Camera: Entering work loop.
2023-06-07 18:06:46.468 Status: Broadlink Camera: Started.
2023-06-07 18:06:46.554 Status: EventSystem: reset all events...
2023-06-07 18:06:46.555 Status: NotificationSystem: thread started...
2023-06-07 18:06:46.556 Status: EventSystem: reset all device statuses...
2023-06-07 18:06:46.665 Status: Python EventSystem: Initializing event module.
2023-06-07 18:06:46.744 Status: PluginSystem: 2 plugins started.
2023-06-07 18:06:46.745 Status: EventSystem: Started
2023-06-07 18:06:46.746 Status: EventSystem: Queue thread started...
2023-06-07 18:06:47.751 Broadlink Cucina: lang file : C:\Program Files (x86)\Domoticz\plugins\Broadlink\lng/en_en.lng
2023-06-07 18:06:47.817 Broadlink Cucina: Language loaded for : en
2023-06-07 18:06:47.658 Status: Broadlink Cucina: Initialized version 1.6.4, author 'zak45'
2023-06-07 18:06:47.154 Error: Broadlink Camera: (Broadlink) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\Broadlink\;C:\Program Files (x86)\Python310-32\python310.zip;C:\Program Files (x86)\Python310-32\Lib\;C:\Program Files (x86)\Python310-32\DLLs\;C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python310-32;C:\Program Files (x86)\Python310-32\lib\site-packages'.
2023-06-07 18:06:47.191 Error: Broadlink Camera: Traceback (most recent call last):
2023-06-07 18:06:47.206 Error: Broadlink Camera: File "C:\Program Files (x86)\Domoticz\plugins\Broadlink\plugin.py", line 130, in <module>
2023-06-07 18:06:47.206 Error: Broadlink Camera: import broadlink
2023-06-07 18:06:47.206 Error: Broadlink Camera: File "C:\Program Files (x86)\Python310-32\lib\site-packages\broadlink\__init__.py", line 13, in <module>
2023-06-07 18:06:47.206 Error: Broadlink Camera: from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
2023-06-07 18:06:47.206 Error: Broadlink Camera: File "C:\Program Files (x86)\Python310-32\lib\site-packages\cryptography\hazmat\primitives\ciphers\__init__.py", line 11, in <module>
2023-06-07 18:06:47.206 Error: Broadlink Camera: from cryptography.hazmat.primitives.ciphers.base import (
2023-06-07 18:06:47.208 Error: Broadlink Camera: File "C:\Program Files (x86)\Python310-32\lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 10, in <module>
2023-06-07 18:06:47.217 Error: Broadlink Camera: from cryptography.exceptions import (
2023-06-07 18:06:47.218 Error: Broadlink Camera: File "C:\Program Files (x86)\Python310-32\lib\site-packages\cryptography\exceptions.py", line 9, in <module>
2023-06-07 18:06:47.218 Error: Broadlink Camera: from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
2023-06-07 18:06:47.218 Error: Broadlink Camera: ImportError: PyO3 modules may only be initialized once per interpreter process
2023-06-07 18:06:48.825 Broadlink Cucina: Listen on BROWebServer - Port: 9000
2023-06-07 18:06:48.872 Broadlink Cucina: Plugin Device count start on : 9
2023-06-07 18:06:48.902 Broadlink Cucina: Command line file updated: C:\Program Files (x86)\Domoticz\plugins\Broadlink\log/3RM2.txt
2023-06-07 18:06:48.915 Broadlink Cucina: Connecting to: 192.168.0.6 : 780F774DF086
2023-06-07 18:06:49.436 Broadlink Cucina: Connected to Broadlink device: 192.168.0.6 RM2
2023-06-07 18:06:49.441 Broadlink Cucina: Admin html file created: C:\Program Files (x86)\Domoticz\www/templates/Broadlink-RM2-3.html
2023-06-07 18:06:55.310 Broadlink Cucina: Update 1:'END of remotePlugin' (Broadlink Cucina - RM2-Status)
2023-06-07 18:06:55.313 Broadlink Cucina: Update 1:'On' (Broadlink Cucina - RM2-Status)
2023-06-07 18:07:06.794 Status: [web:8080] Incoming connection from: 192.168.0.2
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

2023-06-07 18:06:47.154 Error: Broadlink Camera: (Broadlink) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\Broadlink\;C:\Program Files (x86)\Python310-32\python310.zip;C:\Program Files (x86)\Python310-32\Lib\;C:\Program Files (x86)\Python310-32\DLLs\;C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python310-32;C:\Program Files (x86)\Python310-32\lib\site-packages'.

this is problematic.....

Did you follow all steps to install python on windows ? specially, you need to allow python for all users etc ... (admin right)
And do you have installed the plugin on cmd with admin rights ?
andreaburlizzi
Posts: 6
Joined: Wednesday 01 June 2016 16:55
Target OS: Windows
Domoticz version: 3.9389
Contact:

Re: Python Plugin : Broadlink

Post by andreaburlizzi »

zak45 wrote: Wednesday 07 June 2023 23:52 2023-06-07 18:06:47.154 Error: Broadlink Camera: (Broadlink) failed to load 'plugin.py', Python Path used was 'C:\Program Files (x86)\Domoticz\plugins\Broadlink\;C:\Program Files (x86)\Python310-32\python310.zip;C:\Program Files (x86)\Python310-32\Lib\;C:\Program Files (x86)\Python310-32\DLLs\;C:\Program Files (x86)\Domoticz;C:\Program Files (x86)\Python310-32;C:\Program Files (x86)\Python310-32\lib\site-packages'.

this is problematic.....

Did you follow all steps to install python on windows ? specially, you need to allow python for all users etc ... (admin right)
And do you have installed the plugin on cmd with admin rights ?
yes, i did all this, also i tried without success every possible solution on this thread, sometimes one rm pro is working, sometimes the other, totally random. Is it possible to retrieve somewhere the old version of this plugin? i used it for years and it always worked perfectly with every version of domoticz!
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

for the old, nope.
problem resolution is to have this new one work for you, as this work for me and others.
Can you confirm this work when only one is defined in Domoticz ?
andreaburlizzi
Posts: 6
Joined: Wednesday 01 June 2016 16:55
Target OS: Windows
Domoticz version: 3.9389
Contact:

Re: Python Plugin : Broadlink

Post by andreaburlizzi »

yes, when i use just one everything works fine, problems start when i add the second one, sometimes also when i delete the second remote domoticz crashes, really annoying. Also it doesn't always add the second device on domoticz, even if it's in the hardware list
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Have you double checked that you use different Listener Port ?
zak45
Posts: 953
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Do not have 2 devices, but tried to declare a false second one and I got the same error as you :

ImportError: PyO3 modules may only be initialized once per interpreter process

Something in the Python framework that do not allow now to have the same plugin twice .... !!!!!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest