jlvaillant / intellicenter

Home Assistant Integration for Pentair Intellicenter
GNU General Public License v3.0
34 stars 14 forks source link

Heater question #80

Open Kapncanada opened 3 weeks ago

Kapncanada commented 3 weeks ago

Hi guys, I'm able to adjust the temperature with HomeKit integration just not the actual on off portion. image

At the bottom where it says heat it doesn't do anything. Any suggestions?

Also one more question with the temperature, I'm in Canada where we use both metric and imperial measurements. Metric for home heating and imperial for pool and oven temp. Is there a way to set just the pool to be in F?

Thanks guys

sparment commented 2 weeks ago

I'm having the same issue - also posted on issue #70. I believe the problem may be the operations available with the water heater entity created in Home Assistant. My integration creates two choices: "off" and "Gas Heater". My hunch is when the water heater entity is pushed to HomeKit, the "Gas Heater" operation is not recognized and causes a problem. HomeKit is likely looking for "off" or "heat". Out of curiosity what do you see listed in the operations list in the water heater entity attributes?

Kapncanada commented 2 weeks ago

Same as yours. Heat and off.

dwradcliffe commented 2 weeks ago

I'm almost certain this is because the integration is using custom modes which are not actually supported by Home Assistant. It "works" (there are actually errors) for normal HA usage but I'm guessing does not translate to homekit. I did look at some ways to fix this a while back, but didn't get very far.

sparment commented 2 weeks ago

Did a bit more digging. I think the issue could be that there are only two supported features defined for the water heater entity: target_temperature and operation_mode. Reference the "water_heater.py" file in the code. I'm thinking HimeKit also needs hvac_mode defined as a supported feature.

sparment commented 2 weeks ago

I figured out a workaround in the meantime. I installed a custom template from HACS climate_template and added the following code to my configuration.yaml file. Really important - for this work the heater has to be named "heat" in Intellicenter with a lowercase "h".


  - platform: climate_template
    name: Pool Heater
    modes:
      - "off"
      - heat
    min_temp: 40
    max_temp: 104
    current_temperature_template: "{{ state_attr('water_heater.pool', 'current_temperature') }}"
    target_temperature_template: "{{ state_attr('water_heater.pool', 'temperature') }}"
    hvac_mode_template: >
          {% if is_state_attr('water_heater.pool', 'operation_mode', 'heat') %}
            heat
          {% elif is_state_attr('water_heater.pool', 'operation_mode', 'off') %}
            off
          {% endif %}
    hvac_action_template: >
          {% if is_state('water_heater.pool', 'on') %}
            heating
          {% elif is_state('water_heater.pool', 'idle') %}
            idle
          {% elif is_state('water_heater.pool', 'off') %}
            off
          {% endif %}
    set_temperature:
        - service: water_heater.set_temperature
          target:
            entity_id: water_heater.pool
          data:
            temperature: "{{ temperature }}"
    set_hvac_mode:
        - service: water_heater.set_operation_mode
          target:
            entity_id: water_heater.pool
          data:
            operation_mode: "{{ hvac_mode }}"

This creates a climate entity that mirrors the water heater entity. I then passed the climate entity to HomeKit and all works!