python-broadlink icon indicating copy to clipboard operation
python-broadlink copied to clipboard

Luceco Castra (Hangzhou Broadlink) discoverable, but gives Authentication Error

Open rbubley opened this issue 3 years ago • 3 comments

python-broadink can discover a Luceco Castra smart light with PIR (reporting devtype=25722, name='ACpir'), but attempting to auth() the device throws an exception:

>>> import broadlink
>>> dev=broadlink.hello('192.168.XXX.XXX')
>>> dev
broadlink.device.Device(('192.168.XXX.XXX', 80), mac=b'\xXX\xXX\xXX\xXX\xXX', devtype=25722, timeout=10, name='ACpir', model='', manufacturer='', is_locked=True)
>>> dev.auth()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/russ/.local/lib/python3.10/site-packages/broadlink/device.py", line 185, in auth
    e.check_error(response[0x22:0x24])
  File "/home/russ/.local/lib/python3.10/site-packages/broadlink/exceptions.py", line 152, in check_error
    raise exception(error_code)
broadlink.exceptions.AuthenticationError: [Errno -1] Authentication failed

rbubley avatar Sep 25 '22 22:09 rbubley

I found the solution in here, it is because is_locked=True.

In my case I am using RM4 pro, I need to open the BroadLink App, select the device -> click "..." in the top bar -> click "Property", then find the "Lock device" setting and turn it off. Then calling device.auth() just works for me.

Reference: https://github.com/mjg59/python-broadlink/issues/674#issuecomment-1134248621

zhou9110 avatar Sep 30 '22 07:09 zhou9110

Let's add it. Does it work with the lb1 class?

felipediel avatar Apr 21 '24 11:04 felipediel