michaelarnauts / comfoconnect

Python Zehnder ComfoConnect LAN C library to interface with ComfoAir Q350/450/600 units.
Other
94 stars 34 forks source link

New pip package for home assistant integration #23

Closed somm15 closed 4 years ago

somm15 commented 4 years ago

Hi Michael,

Thanks for the config, it's really great with ha. I'm automating the ComfoAir to boost when the light is on in the bathroom (humidity sensor is good but I would like to really boost). Unfortunately, I didn't find how to revert to auto mode. As far as I understand "auto" is not in the speed_list for a fan object in ha. So I don't know how to do it in a clean way.

Meanwhile, I wrote this little python script to be called from ha:

#!/usr/bin/python3
from pycomfoconnect import Bridge,ComfoConnect
from pycomfoconnect.const import *
local_uuid = bytes.fromhex('00000000000000000000000000000005')
bridges = Bridge.discover("X.X.X.X")
pin = 0000
local_name = "Custom script"

bridge=bridges[0]
comfoconnect = ComfoConnect(bridge, local_uuid, local_name, pin)
comfoconnect.connect(True)
comfoconnect.cmd_rmi_request(CMD_MODE_MANUAL)
comfoconnect.cmd_rmi_request(CMD_MODE_AUTO)
comfoconnect.disconnect()

it's probably ugly but it does work. Unfortunately, the pip package is rather old the the const for auto mode is not there yet. Could you please publish a new pip package ? If I can be super annoying, could you require that new version in ha? (If there is a solution to revert to auto mode from ha directly it's event better)

Thanks in advance,

Regards,

decontamin4t0R commented 4 years ago

The Boost mode is a seperate timer from the levels and the automatic/manual control - It overrides these. You need ot send the correct boost off command to stop the boost.

somm15 commented 4 years ago

It actually works with my script. I just set the speed to high when the switch is pressed in the bathroom. High is same speed as boost but without timeout.

My problem is to restore the auto mode. If the version embedded with ha would be thd latest one, my script would work.

But boost on/off from ha would indeed be cleaner.

klaudiusz223 commented 4 years ago

Simply write comfoconnect.cmd_rmi_request(b'\x85\x15\x08\x01') instead of comfoconnect.cmd_rmi_request(CMD_MODE_AUTO) You don't need to use constans from pycomfoconnect library. You can define Your own. But I agree with You, new version is needed for simplicity. I had problems with correct setting pip package for my implementation https://github.com/klaudiusz223/ComfoAirQ-Homie and I could not force pip to automatically install pycomfoconnect from github

somm15 commented 4 years ago

@klaudiusz223 , good point I should have done that right away 👍

michaelarnauts commented 4 years ago

0.4 has been tagged and uploaded to pypi.