Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heater question #80

Open
Kapncanada opened this issue Aug 22, 2024 · 5 comments
Open

Heater question #80

Kapncanada opened this issue Aug 22, 2024 · 5 comments

Comments

@Kapncanada
Copy link

Kapncanada commented Aug 22, 2024

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
Copy link

sparment commented Sep 1, 2024

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
Copy link
Author

Same as yours. Heat and off.

@dwradcliffe
Copy link
Contributor

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
Copy link

sparment commented Sep 1, 2024

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
Copy link

sparment commented Sep 1, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants