zacs / ha-dualmodegeneric

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

Newest update no longer turns on and off heating based on temp #67

Open Legendhidde opened 6 months ago

Legendhidde commented 6 months ago

After updating in HACS to ee73489 my thermostats no longer turn the heating on or off based on temperature. I understand the latest update changed some things, but the readme has not been updated yet. Am I supposed to change something in my configuration yaml?

david-kalbermatten commented 6 months ago

Can you please share your config? I can't reproduce the error on my end. It works with and without enable_heat_cool. Also, are you sure it's not just something like the min_cycle_duration that prevents you from short-cycling your setup?

david-kalbermatten commented 6 months ago

I have one idea why this might be. I still have one PR open #66 that properly implements climate.turn_on and climate.turn_off. If you are using these in an automation/script like so:

- service: climate.turn_off
  target:
    entity_id: climate.your_dual_mode_generic_climate_entity

In this case, yes, the newest update may have changed the behavior. If that is the case, you should see some error messages in the log, indicating that the integration dual_mode_generic does not support this action climate.turn_off.

If you can confirm that the above is how you interact with this integration, I'll go ahead and merge #66 which implements the on/off actions

MrXANA91 commented 6 months ago

The climate.turn_off and climate.turn_on services are indeed not available for dual_mode_generic climate entities in the Automations UI. Pretty sure that #66 would solve this issue.

For now, the workaround is to call the climate.set_hvac_mode service and set the mode to either off to turn it off or the wanted mode to turn it on.

Legendhidde commented 4 months ago

Hi, sorry for the late reply and thanks for all the suggestions! I reverted to a previous update.

I have now tried updating and my dual-mode thermostats are still broken. However, I have discovered interesting behaviour.

When my Home Assistant instance is first started, the dual-mode thermostat does not work. I changed my config to no longer use climate.turn_off but that didn't fix it unfortunately. To make it work, I go to the thermostat, select either heat or cool, then it will work based on the temperature I set. Then I switch back to heat/cool and it works perfectly. It's just after restarting that it doesn't work.

I took a video of this happening to hopefully clarify: https://www.youtube.com/watch?v=ebmFzV2CT5Y

Changing this to heat or cool only works on a per thermostat basis, if I change it for one thermostat it doesn't fix the others that I have.

climate:
 - platform: dualmode_generic
   name: Woonkamer Thermostaat
   unique_id: climate.living_room_thermostat
   heater: switch.livingaircoheat
   cooler: switch.livingaircocool
   fan: switch.livingaircofan
   fan_behavior: neutral
   dryer: switch.livingaircodry
   dryer_behavior: neutral
   target_sensor: sensor.living_room_temperature
   reverse_cycle: cooler, heater, dryer, fan
   enable_heat_cool: True
   min_temp: 12
   max_temp: 35
   cold_tolerance: 0.5
   hot_tolerance: 0.3
   target_temp_high: 32
   target_temp_low: 17
   precision: 0.5
   keep_alive:
    minutes: 15

 - platform: dualmode_generic
   name: Werkkamer Thermostaat
   unique_id: climate.office_thermostat
   heater: switch.officeaircoheat
   cooler: switch.officeaircocool
   fan: switch.officeaircofan
   fan_behavior: neutral
   dryer: switch.officeaircodry
   dryer_behavior: neutral
   target_sensor: sensor.office_temperature
   reverse_cycle: cooler, heater, dryer, fan
   enable_heat_cool: True
   min_temp: 12
   max_temp: 35
   cold_tolerance: 0.5
   hot_tolerance: 0.3
   target_temp_high: 32
   target_temp_low: 17
   precision: 0.5
   keep_alive:
    minutes: 15

switch:
  - platform: template
    switches:
      livingaircodry:
        value_template: "{{ is_state('climate.airco_living_room', 'dry') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: dry
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
      livingaircofan:
        value_template: "{{ is_state('climate.airco_living_room', 'fan_only') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: fan_only
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
      livingaircocool:
        value_template: "{{ is_state('climate.airco_living_room', 'cool') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: cool
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
          - service: climate.set_temperature
            data:
             temperature: "{{ state_attr('climate.woonkamer_thermostaat', 'target_temp_high') }}"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
      livingaircoheat:
        value_template: "{{ is_state('climate.airco_living_room', 'heat') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: heat
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
          - service: climate.set_temperature
            data:
             temperature: "{{ state_attr('climate.woonkamer_thermostaat', 'target_temp_low') }}"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: 74a834924b7dcfd0ef7e3e7e1a48a44d
      officeaircodry:
        value_template: "{{ is_state('climate.airco_office', 'dry') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: dry
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
      officeaircofan:
        value_template: "{{ is_state('climate.airco_office', 'fan_only') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: fan_only
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
      officeaircocool:
        value_template: "{{ is_state('climate.airco_office', 'cool') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: cool
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
          - service: climate.set_temperature
            data:
             temperature: "{{ state_attr('climate.werkkamer_thermostaat', 'target_temp_high') }}"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
      officeaircoheat:
        value_template: "{{ is_state('climate.airco_office', 'heat') }}"
        turn_on:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: heat
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
          - service: climate.set_temperature
            data:
             temperature: "{{ state_attr('climate.werkkamer_thermostaat', 'target_temp_low') }}"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
        turn_off:
          - service: climate.set_hvac_mode
            data:
             hvac_mode: "off"
            target:
             device_id: c38f0fc06d226e3910a54b9f53ea850e
Legendhidde commented 4 months ago

Just figured out that when I call the climate.set_temperature event on my thermostat, I get an error if I only set target_temp_high or only target_temp_low, I always have to set both. When I set both target_temp_high and target_temp_low, my switch still doesn't work as my heater and cooler stay off. When I also send "temperature" my heater or cooler finally run.

After that, the thermostat and widget work fine again.

Legendhidde commented 4 months ago

Sorry, I can't help troubleshooting any further. After a week without heating or cooling working I've switched to the dual-smart-thermostat add-on from Swingerman.