For comunicate with the device we need the internal IP + MAC
The prodotocoll is pretty symple but since today this kind of device is not fully supported but really easy to implement.
[python]
import broadlink
# set this variables
strHost = 'xxx.xxx.xxx.xxx' #ip device
strMac = 'xx:xx:xx:xx:xx:xx:' #mac device
# other stuff:
strType = '0x4ead' #HYSEN THERMOSTAT TYPE
#convert mac string
macbytes = bytearray.fromhex(strMac.replace(':',''))
#get the broadlink hysen device
device = broadlink.hysen((strHost,80),macbytes,strType)
# get auth for futher comunications
device.auth()
#from now you can talk with the device, for example read the complete status :
data = device.get_full_status()
# do wathever you want with data :)
Sample implementations:
- Broadlink comunication protocol:
https://github.com/mjg59/python-broadlink/blob/master/broadlink/__init__.py - nest like knob kodepen :
https://codepen.io/dalhundal/pen/KpabZB
Next step:
- implement the core features for an hysen device
- implement the "setter" code section
- clean code
- upload to github for public release
STAY TUNE !
Hi, tried it out but I received the following error at device.auth(): TypeError: sequence item 0: expected str instance, bytes found. Could it be the encryption has changed? Do you have any idea how to fix this?