yoziru / esphome-zehnder-comfoair

Interact with Zehnder Comfoair Q using ESPHome and Home Assistant
https://yoziru.github.io/esphome-zehnder-comfoair/
GNU General Public License v3.0
25 stars 9 forks source link

add extract and supply only? #10

Closed SkullboyNL closed 5 months ago

SkullboyNL commented 6 months ago

Could you possibly add an option to set extract and supply only? Similar to the ESP version of Vekexasia? This is how Vekexasia it does

#define CMD_ventilation_supply_only         { 0x84, 0x15, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x00, 0x00, 0x01 }
#define CMD_ventilation_supply_only_reset   { 0x85, 0x15, 0x06, 0x01 }
#define CMD_ventilation_extract_only        { 0x84, 0x15, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x00, 0x00, 0x00 }
#define CMD_ventilation_extract_only_reset  { 0x85, 0x15, 0x07, 0x01 }

Thank you in advance.

yoziru commented 5 months ago

Done in https://github.com/yoziru/esphome-zehnder-comfoair/commit/b8bf4c3520e9f3af38c167ce782a16b42b9e9008

SkullboyNL commented 5 months ago

Thanks for the work. There's an error in the text sensor causing you to get an error that X doesn't exist. This fixes it: text_sensors.yml

  - platform: template
    id: balance_mode # PDO 55
    name: 'Balance Mode'
    icon: mdi:arrow-split-vertical
    on_value:
      then:
        - lambda: id(balance_mode_select).publish_state(x);

Okay, there's a name difference in the options of the text sensor and select. The 'o' in 'only' is not capitalized. Here's the solution. Select.yml

  - platform: template
    name: 'Balance mode'
    id: balance_mode_select
    icon: mdi:arrow-split-vertical
    options:
     - "Balanced"
     - "Supply Only"
     - "Exhaust Only"
    optimistic: true
    restore_value: true
    set_action:
      - lambda: |
          if (x == "Balanced") {
            id(comfoair)->set_balance_mode(zehnder_comfoair_q::BALANCE_MODE_BALANCED);
          } else if (x == "Supply Only") {
            id(comfoair)->set_balance_mode(zehnder_comfoair_q::BALANCE_MODE_SUPPLY_ONLY);
          } else if (x == "Exhaust Only") {
            id(comfoair)->set_balance_mode(zehnder_comfoair_q::BALANCE_MODE_EXHAUST_ONLY);
          }