zacs / ha-dualmodegeneric

Generic thermostat capable of heating and cooling
68 stars 26 forks source link

Reverse Cycle Compressor/Heat/Fan #36

Open Delgrey opened 2 years ago

Delgrey commented 2 years ago

I'm not getting this sorry.

I have a 20yo ducted reverse cycle system. The relay controls are:

  1. Compressor - Runs the compressor in cooling mode
  2. Fan - Runs the fan (stand alone mode for air circulation. Fan runs automatically with compressor)
  3. Heat - Changes direction of compressor (reverse cycle/heat pump mode)

So to make this work I need:

  1. Cooling: Just contact 1
  2. Heating: Contacts 1&3
  3. Fan Only Mode: Just contact 2

I have defined a group and climate entry:

ac_heat:
  name: ac_heat
  entities:
    - switch.heat_relay
    - switch.compressor_relay

climate:
  - platform: dualmode_generic
    name: House
    unique_id: climate.ingalara
    heater: group.ac_heat
    cooler: switch.compressor_relay
    fan: switch.fan_relay
    fan_behavior: neutral
    target_sensor: sensor.kitchen_temperature
    reverse_cycle: cooler, heater
    enable_heat_cool: True
    min_temp: 18
    max_temp: 28
    cold_tolerance: 0.8
    hot_tolerance: 0.4
    min_cycle_duration:
      minutes: 5
    precision: 0.5
    target_temp: 22

Expected behaviour is:

What I'm seeing:

Hard to explain exactly, but can someone help where I'm going wrong? Thanks!

girlpunk commented 2 years ago

Try creating three template switches, for heating, cooling, and fan respectively. Make sure each switch checks the status of all three contacts, for example the cooling switch should only report as on when contact 1 is on, and contacts 2 & 3 are off. Use these as the entities for heater, cooler, and fan respectively.

mjsambol commented 2 years ago

Hi, I am not a developer of the system but I recently adopted it for a HVAC setup similar to yours. In my case the fan doesn't automatically get power with heat or cool, but otherwise seems similar.

To start with your observations:

Clicking two arrows: All relays remain off, system idle no matter what I set the target temp to

Correct, that's intended behavior. The arrows change the desired temp, not the mode.

Clicking heat icon: Works as expected, but if I click cooling then heating compressor doesn't come on Move from heat to cool it says cooling but the heat relay stays on and the compressor is off stays (reversed)

I don't see anything obviously wrong in your configuration. Did you wait the configured 5 minutes? The thermostat will maintain its current operation for min_cycle_duration so as not to cause unnecessary wear and tear on the compressor.

Clicking the fan icon toggles the fan contact on and off, but doesn't force it to "fan only" mode

Different thermostats treat the fan differently - you and I are used to a "fan only" mode, but on some thermostats the fan button is for speed of the fan in coordination with other modes like heat / cold. That's what you're seeing here.

What I did to get the setup that I wanted and that it seems you want is to create a set of template switches for each of heat, cool, and fan, and to have the climate entity use only those template switches. The template switches each look like this:

    upstairs_thermostat_heat_mode:
      value_template: "{{ states.variable.upstairs_thermostat_heat_mode_active.state }}"
      turn_on:
        - service: homeassistant.turn_on
          target:
            entity_id: switch.upstairs_thermostat_fan
        - service: homeassistant.turn_on
          target:
            entity_id: switch.upstairs_thermostat_heat
        - service: variable.set_variable
          data_template:
            variable: upstairs_thermostat_heat_mode_active
            value: true
        - service: variable.set_variable
          data_template:
            variable: upstairs_thermostat_dry_mode_active
            value: false
        - service: variable.set_variable
          data_template:
            variable: upstairs_thermostat_cool_mode_active
            value: false
        - service: variable.set_variable
          data_template:
            variable: upstairs_thermostat_fan_mode_active
            value: false
      turn_off:
        - service: homeassistant.turn_off
          target:
            entity_id: switch.upstairs_thermostat_heat
        - service: homeassistant.turn_off
          target:
            entity_id: switch.upstairs_thermostat_fan
        - service: variable.set_variable
          data_template:
            variable: upstairs_thermostat_heat_mode_active
            value: false

As you can see this also makes use of variables, which I get from the hass-variables component

I also needed some automation to turn the fan off when exiting from the cooling or heating modes.

This is probably not the only way to achieve what you're after, it's just what worked for me. (And just as I'm finishing composing this I see that someone else also recommended using templates!) Good luck.