Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failes to authenticate or encryption issue? #16

Open
betyar opened this issue Jun 5, 2020 · 5 comments
Open

failes to authenticate or encryption issue? #16

betyar opened this issue Jun 5, 2020 · 5 comments

Comments

@betyar
Copy link

betyar commented Jun 5, 2020

The script seems to no longer work. Until now it worked flawlessly. I am not sure that with the new release of the app something changed with the encryption. When discovery runs I get the device type, the IP and the MAC, then comes a Reconnect and and a Connect, reason: 0. That's all, it stops there. There is no timeout, nothing happens after that. At first I thought it might be a problem with authentication but the type, IP, and MAC are given which apparently follow device.auth(). Has anyone else had a similar problem? Is there a solution for this?

@betyar betyar changed the title failes to authenticate? failes to authenticate or encryption issue? Jun 5, 2020
@balistof
Copy link

balistof commented Jan 13, 2021

@betyar also having the same problem:

Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Reconnect
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Connect, reason: 0
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Killing job.
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Deleting pipe from pipes array
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Deleting device from founddevices array.
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: Deleting job from jobs array.
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: broadlink discover
Jan 13 21:27:34 openHABianDevice broadlink-thermostat.py[5331]: found: 192.168.0.122 0d93fa770f78
Jan 13 21:27:35 openHABianDevice broadlink-thermostat.py[5331]: PID child 5517
Jan 13 21:27:35 openHABianDevice broadlink-thermostat.py[5331]: Hysen heating controller

any luck or update on this?

@betyar
Copy link
Author

betyar commented Jan 27, 2021

I used to have this all the time. I found that if you define the device manually in broadlink-thermostat.py it works. You still get the Connect, reason: 0 error at the very beginning but it then gets past it and reads the device properly.

Below is a snippet of where you make the change (assuming the IP of your thermostat is 192.168.1.123). Also, make sure you change the byte array of your device's MAC address accordingly.

[...]
print ("broadlink discover")
hysen = 0x4EAD
d1 = broadlink.gendevice(hysen, ('192.168.1.123', 80), bytearray(b'\x34\xea\x34\x70\x44\x0a'))
devices = [d1]
for device in devices:
[...]

Unfortunately, I haven't found a way to work around this problem with DCHP allocated addresses. Also if you have more than one device then you have to add each one manually into the device array.

Hope this helps.

@mrbalintlorand
Copy link

mrbalintlorand commented Mar 30, 2021

@betyar Does it still work for you? I tried now recently, but I had no luck and go stuck at the described problem above. :/
I actually tried with this fork as it was updated to python 3: https://github.com/balistof/broadlink-thermostat
I also noticed that you wrote the MAC address in normal direction here above, but the script by itself when auto detecting devices on the network prints it out reversed. I tried defining it both ways but had no luck with the connection.
Thanks

@betyar
Copy link
Author

betyar commented Mar 30, 2021 via email

@mrbalintlorand
Copy link

mrbalintlorand commented Mar 30, 2021

@betyar Thanks! I'll try with this original repo then, maybe python 3 causes some issues… And may I ask what version of python-broadlink (https://github.com/mjg59/python-broadlink) you use as a dependency? I went the python 3 way because that is already updated to it, so I suppose I have to go back with that as well. Thanks

Edit: Yeah, I have the official app for the thermostat installed and working. Actually I had this script running fine before, set it up in late 2018. Back then I used this fork of the python-broadlink project: https://github.com/ptd006/python-broadlink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants