Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

chrispazz
Posts: 81
Joined: Friday 08 July 2016 10:38
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by chrispazz »

It WORKS!

;)

Thank you!!!
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 »

chrispazz wrote: Wednesday 18 November 2020 13:43 Great. I am trying
Which part of the CLI output should I save? First one or Base64?

Ty
not the Base64.
The one like this :
Spoiler: show
b2009e02095b080a092c082c090a0909092c092b090a0909092c0909092c0909092c092c090a092b090a082c090a0909092c092c080a092c080a090a082c090a082c092c090a092b090a0909092c092b0a09092c0909092c0909090a082c092c090a080a092c092c09090909092c09090a2c082c090a080a092c080a092c080a092c092b090a09000159095a090a092c082c090a0909092c082c090a0909092c0909092c0909092c092c090a082c090a092b090a0909092c092c0909092c080a090a082c090a092c082c090a092b090a0909092c092c080a092c0909092c090a080a092b0a2b090a0909092c092c0909090a082c090a092b092c090a080a092c0909092c0909092c092c080a0900015a085b080a092c092b090a0909092c092c080a090a082c090a082d080a082c092c090a092c080a092c080a090a082c092c090a082c090a080a082d080a092c092b090a092c0909090a082d082c090a092b090a092b090a080a092c092b090a0909092d082c090a080a092c0909092c092c080a0909092c0909092c0909092d082c080a0900015a095a0909092c092c09090909092c092c0909090a082c090a082d080a092c082c090a092c080a092c0909090a082d082c090a092b090a080a092c0909092c092c080a092c090a080a092c092b090a092b090a092b090a0909092c092c080a090a082d082c090a0909092c0909092c092c080a090a082c090a082c090a092c082c09090900015a095a0909092c092c090a080a082c092c090a0909092c0909092c0909092c092c090a082c090a082c090a080a092c092b090a092b090a0909092c0909092c092c090a092b090a0909092c092c080a092c0909092c0909090a082c092c0909090a092c092c080a0909092c0909092d082c0909090a082d080a092c0909092c082c090a080005dc092c0909090a082d082c
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 »

chrispazz wrote: Wednesday 18 November 2020 13:49 It WORKS!

;)

Thank you!!!
Great
henk99
Posts: 28
Joined: Thursday 02 March 2017 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by henk99 »

I have 4 Broadcom SP3S smartplugs which used to work fine with the older plugin.
Due to a system fail I installed domoticz completely new, with the 2020.2 version (instead of the old V3.8) and also with the new V4 plugin. The installing went fine, and according to description. Then:
1. Added one of the plugs in 'Hardware' with all the data needed
2. Three new devices can be seen in the list
3. Switch fuction works, current wattage works

At this point I go into the settings for the usage, and set it to 'usage' and select 'computed', as these are also the settings in my old version to be able to see the used energy (KWh). As soon as I update this, domoticz freezes and doesn't come out of it.

I restarted the domoticz service and when it is back I have 30 seconds or so to do anything. So, by doing that a few times, I was able to remove the item in 'hardware' and domoticz is back to normal again.

What is going wrong here? As soon as I set the usage to computional, domoticz goes crazy. By the way, this is a brand new install from scratch with Debian 10 (buster) and domoticz 2020.2.
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 »

henk99 wrote: Thursday 19 November 2020 23:36 What is going wrong here? As soon as I set the usage to computional, domoticz goes crazy. By the way, this is a brand new install from scratch with Debian 10 (buster) and domoticz 2020.2.
you're right.... same here.
Do not know where the problem is.!!!???

Just remove the device to solve Domoticz reboot until had some times to investigate.
henk99
Posts: 28
Joined: Thursday 02 March 2017 11:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by henk99 »

zak45 wrote: Friday 20 November 2020 16:51
henk99 wrote: Thursday 19 November 2020 23:36 What is going wrong here? As soon as I set the usage to computional, domoticz goes crazy. By the way, this is a brand new install from scratch with Debian 10 (buster) and domoticz 2020.2.
you're right.... same here.
Do not know where the problem is.!!!???

Just remove the device to solve Domoticz reboot until had some times to investigate.
Thank you for taking the time to look into it, much appreciated!
THBR
Posts: 37
Joined: Saturday 02 November 2019 21:05
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by THBR »

henk99 wrote: Sunday 22 November 2020 15:51
zak45 wrote: Friday 20 November 2020 16:51
henk99 wrote: Thursday 19 November 2020 23:36 What is going wrong here? As soon as I set the usage to computional, domoticz goes crazy. By the way, this is a brand new install from scratch with Debian 10 (buster) and domoticz 2020.2.
you're right.... same here.
Do not know where the problem is.!!!???

Just remove the device to solve Domoticz reboot until had some times to investigate.
Thank you for taking the time to look into it, much appreciated!
Same problem here (also new install from scratch with Debian 10 (buster) and domoticz 2020.2.)

Regards, Theo (NL).
mojso
Posts: 86
Joined: Friday 08 November 2019 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by mojso »

I can not update the broadling plugin does not open the zip file. also the reinstall stops when broadliksetup.zip needs to open it. the dropbox link has been deleted or there is a new link
doggy101
Posts: 4
Joined: Sunday 27 December 2020 11:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by doggy101 »

Hi zak45,

Just came along this topic and tried to install but the dropbox link is dead, can you re-up the files?
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 »

hummm.. again problem with Dropbox :(
Will move to Gdrive and let you know.
doggy101
Posts: 4
Joined: Sunday 27 December 2020 11:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by doggy101 »

great and thanks in advance
vernwood
Posts: 3
Joined: Tuesday 29 December 2020 8:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by vernwood »

Hi zak45,

is there any plan to support the new broadlink sp4l in this plugin?
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 »

vernwood wrote: Tuesday 29 December 2020 8:21 Hi zak45,

is there any plan to support the new broadlink sp4l in this plugin?
Hi,
I just wait for the new version, this one include sp4l
https://github.com/mjg59/python-broadlink/pulls
doggy101
Posts: 4
Joined: Sunday 27 December 2020 11:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by doggy101 »

Hi Zak,
I got an error while executing the install script
hope you can help
does it have anything to to with moving to Google drive

We download plugin files to: BroadlinkSetup.zip
>> Bytes downloaded -->**195101**: 100% Done
________________________________________
# we extract necessary plugin files
----------------------------------------
BadZipFile
Python 3.7.3: /usr/bin/python
Tue Dec 29 18:01:12 2020

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

/home/pi/domoticz/plugins/Broadlink/setup.py in <module>()
249
250 # opening the zip file in READ mode
251 with ZipFile(updname, 'r') as izip:
252 # printing all the contents of the zip file
253 izip.printdir()
ZipFile = <class 'zipfile.ZipFile'>
updname = 'BroadlinkSetup.zip'
izip undefined

/usr/lib/python3.7/zipfile.py in __init__(self=<zipfile.ZipFile [closed]>, file='BroadlinkSetup.zip', mode='r', compression=0, allowZip64=True, compresslevel=None)
1220 try:
1221 if mode == 'r':
1222 self._RealGetContents()
1223 elif mode in ('w', 'x'):
1224 # set the modified flag so central directory gets written
self = <zipfile.ZipFile [closed]>
self._RealGetContents = <bound method ZipFile._RealGetContents of <zipfile.ZipFile [closed]>>

/usr/lib/python3.7/zipfile.py in _RealGetContents(self=<zipfile.ZipFile [closed]>)
1287 raise BadZipFile("File is not a zip file")
1288 if not endrec:
1289 raise BadZipFile("File is not a zip file")
1290 if self.debug > 1:
1291 print(endrec)
global BadZipFile = <class 'zipfile.BadZipFile'>
BadZipFile: File is not a zip file
__cause__ = None
__class__ = <class 'zipfile.BadZipFile'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of BadZipFile object>
__dict__ = {}
__dir__ = <built-in method __dir__ of BadZipFile object>
__doc__ = None
__eq__ = <method-wrapper '__eq__' of BadZipFile object>
__format__ = <built-in method __format__ of BadZipFile object>
__ge__ = <method-wrapper '__ge__' of BadZipFile object>
__getattribute__ = <method-wrapper '__getattribute__' of BadZipFile object>
__gt__ = <method-wrapper '__gt__' of BadZipFile object>
__hash__ = <method-wrapper '__hash__' of BadZipFile object>
__init__ = <method-wrapper '__init__' of BadZipFile object>
__init_subclass__ = <built-in method __init_subclass__ of type object>
__le__ = <method-wrapper '__le__' of BadZipFile object>
__lt__ = <method-wrapper '__lt__' of BadZipFile object>
__module__ = 'zipfile'
__ne__ = <method-wrapper '__ne__' of BadZipFile object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of BadZipFile object>
__reduce_ex__ = <built-in method __reduce_ex__ of BadZipFile object>
__repr__ = <method-wrapper '__repr__' of BadZipFile object>
__setattr__ = <method-wrapper '__setattr__' of BadZipFile object>
__setstate__ = <built-in method __setstate__ of BadZipFile object>
__sizeof__ = <built-in method __sizeof__ of BadZipFile object>
__str__ = <method-wrapper '__str__' of BadZipFile object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__suppress_context__ = False
__traceback__ = <traceback object>
__weakref__ = None
args = ('File is not a zip file',)
with_traceback = <built-in method with_traceback of BadZipFile object>

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "setup.py", line 251, in <module>
with ZipFile(updname, 'r') as izip:
File "/usr/lib/python3.7/zipfile.py", line 1222, in __init__
self._RealGetContents()
File "/usr/lib/python3.7/zipfile.py", line 1289, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
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 »

yep,
you need to do the manual installation until all fixed.
efkz
Posts: 1
Joined: Saturday 02 January 2021 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by efkz »

Hi Zak!

I had a problem installing. I got the same result as the previous one (doggy101).
I hope you can help me move on. Thanks.

sudo python --version
Python 3.7.3

Installation :

"The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "setup.py", line 251, in <module>
with ZipFile(updname, 'r') as izip:
File "/usr/lib/python3.7/zipfile.py", line 1222, in __init__
self._RealGetContents()
File "/usr/lib/python3.7/zipfile.py", line 1289, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file"


Manual installation:

"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/local/lib/python3.7/dist-packages (from broadlink==0.14.1) (3.3.1)
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/dist-packages (from cryptography>=2.1.1->broadlink==0.14.1) (1.14.4)
Requirement already satisfied: six>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from cryptography>=2.1.1->broadlink==0.14.1) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.12->cryptography>=2.1.1->broadlink==0.14.1) (2.20)
Building wheels for collected packages: broadlink
Building wheel for broadlink (setup.py) ... done
Created wheel for broadlink: filename=broadlink-0.14.1-py3-none-any.whl size=12074 sha256=142f7701858e9ab6677a137094d6f54418c8567324e069d0b0587f9e680acced
Stored in directory: /root/.cache/pip/wheels/03/85/4c/25bef0be6bd1e75ada7bc473dcc71f62b4dff3ed89bd3432d7
Successfully built broadlink
Installing collected packages: broadlink
Attempting uninstall: 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"
garycooper
Posts: 21
Joined: Sunday 10 March 2019 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : Broadlink

Post by garycooper »

Hy ! Could you tell me how updating the plugin without loosing devices please ?

Thks
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 »

garycooper wrote: Saturday 02 January 2021 22:37 Hy ! Could you tell me how updating the plugin without loosing devices please ?

Thks
What's your actual version ?
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 »

efkz wrote: Saturday 02 January 2021 20:25 Hi Zak!

I had a problem installing. I got the same result as the previous one (doggy101).
I hope you can help me move on. Thanks.

Traceback (most recent call last):
File "setup.py", line 251, in <module>
with ZipFile(updname, 'r') as izip:
File "/usr/lib/python3.7/zipfile.py", line 1222, in __init__
self._RealGetContents()
File "/usr/lib/python3.7/zipfile.py", line 1289, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file"
setup.py do not work, this is why manual installation is necessary for the moment.
Alain
Posts: 164
Joined: Sunday 26 April 2020 5:27
Target OS: Linux
Domoticz version: 2022.1
Location: Netherlands
Contact:

Re: Python Plugin : Broadlink

Post by Alain »

I keep getting authentication errors. I have an RM4C.

Error: (RM4 Woonkamer) Error to connect to Broadlink device: 192.168.0.100
2021-01-03 07:40:33.804 Error: (RM4 Woonkamer) Traceback (most recent call last):
2021-01-03 07:40:33.804 File "/home/alain/domoticz/plugins/Broadlink/plugin.py", line 1780, in broadlink_connect
2021-01-03 07:40:33.804 DEVICE.auth()
2021-01-03 07:40:33.804 File "/usr/local/lib/python3.8/dist-packages/broadlink/__init__.py", line 271, in auth
2021-01-03 07:40:33.804 check_error(response[0x22:0x24])
2021-01-03 07:40:33.804 File "/usr/local/lib/python3.8/dist-packages/broadlink/exceptions.py", line 97, in check_error
2021-01-03 07:40:33.804 raise exception(error_code)
2021-01-03 07:40:33.804 broadlink.exceptions.AuthenticationError: Authentication failed
2021-01-03 07:40:33.804
2021-01-03 07:40:33.804 Error: (RM4 Woonkamer) Error to connect to Broadlink device: 192.168.0.100
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest