michaelarnauts / comfoconnect

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

Request: add activation time for functions #54

Closed apollon9 closed 1 year ago

apollon9 commented 2 years ago

In the smartphone app, for some functions (e.g. bypass) a duration time > 60min can be selected via dropdown. from const.py: CMD_BYPASS_ON = b'\x84\x15\x02\x01\x00\x00\x00\x00\ [ x10\x0e\ ] x00\x00\x01' Where the section in [brackets] is seconds coded in int32LE: h | sec | i32LE 1 3600 = 10 0e (currently hard-coded in comfoconnect->const) 2 7200 = 20 1c 3 10800 = 30 2a 4 14400 = 40 38 5 18000 = 50 46 6 21600 = 60 54 7 25200 = 70 62 8 28800 = 80 70 9 32400 = 90 7e 10 36000 = a0 8c 11 39600 = b0 9a 12 43200 = c0 a8

Replacing the section in brackets with different time parameters shows a result >1h in app (actually tested for 2h, 10h, and 12h). The app provides [1h;2h;3h;6h;12h;24h) but different times also seem to work.

Request: add parameter to set a duration time for parameters supporting that.

michaelarnauts commented 1 year ago

I'm working on a rewrite of this library, and I took the opportunity to lean and use asyncio. The goal is to have a much cleaner API, without having to use the command strings from the const file, but simple methods with params.

I'm working on the creating the command strings with parameters like you specified above.

michaelarnauts commented 1 year ago

This is implemented here: https://github.com/michaelarnauts/aiocomfoconnect/blob/master/aiocomfoconnect/comfoconnect.py#L180

You can also pass -1 to set the duration unlimited (usefull when controlling from Home Assistant, and you don't really need the timeout).

I'll update the Home Assistant integration soon.