home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.3k stars 30.61k forks source link

Homekit Climate problems since .109 #35256

Closed rjw2324 closed 4 years ago

rjw2324 commented 4 years ago

The problem

Failed to create a HomeKit accessory for climate.pool. In earlier version of HA, there was no issue with homekit controller for pool climate. ## Environment Home Assistant 0.109.4 - Home Assistant Core release with the issue: Home Assistant 0.109.4 - Last working Home Assistant Core release (if known): 108.8? - Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant - Integration causing this issue: Pentair Screenlogic - Link to integration documentation on our website: https://community.home-assistant.io/t/new-addon-pentair-screenlogic/162332 ## Problem-relevant `configuration.yaml`
climate:
  - platform: mqtt
    name: "Pool"
    min_temp: 40
    max_temp: 104
    modes:
      - "off"
      - "heat"
    current_temperature_topic: pentair/pooltemp/state
    action_topic: pentair/circuit/505/state
    mode_command_topic: pentair/heater/pool/mode/set
    mode_state_topic: pentair/heater/pool/mode/state
    temperature_command_topic: pentair/heater/pool/temperature/set
    temperature_state_topic: pentair/heater/pool/setpoint/state
  - platform: mqtt

Traceback/Error logs

Log Details (ERROR)
Logger: homeassistant.components.homekit
Source: components/homekit/type_thermostats.py:441
Integration: HomeKit (documentation, issues)
First occurred: 11:14:09 AM (2 occurrences)
Last logged: 11:14:09 AM

Failed to create a HomeKit accessory for climate.pool
Failed to create a HomeKit accessory for climate.spa
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit/__init__.py", line 422, in add_bridge_accessory
    acc = get_accessory(self.hass, self.driver, state, aid, conf)
  File "/usr/src/homeassistant/homeassistant/components/homekit/__init__.py", line 326, in get_accessory
    return TYPES[a_type](hass, driver, name, state.entity_id, aid, config)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 224, in __init__
    self._update_state(state)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 441, in _update_state
    homekit_hvac_action = HC_HASS_TO_HOMEKIT_ACTION[hvac_action]
KeyError: 'OFF'

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @bdraco, mind taking a look at this issue as its been labeled with a integration (homekit) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

bdraco commented 4 years ago

OFF isn't a valid HVAC_ACTION. It should be off

It needs to be one of these: https://developers.home-assistant.io/docs/entity_climate#hvac-action

bdraco commented 4 years ago

mode_state_topic needs to send CURRENT_HVAC_HEAT ("heating") and CURRENT_HVAC_OFF ("off") instead of ON and OFF for it to work

rjw2324 commented 4 years ago

Just to confirm, so this is an issue is the Pentair integration? It’s just odd that it worked just fine a few weeks ago. Seems like one update or another busted it..

bdraco commented 4 years ago

Just to confirm, so this is an issue is the Pentair integration?

Yes

It’s just odd that it worked just fine a few weeks ago. Seems like one update or another busted it..

The homekit integration used to update the hvac_action characteristic at the end of the update, it is now the second characteristic that is updated. It is likely it was failing before but wasn't noticeable because all the other states were set before it hit the invalid hvac_action state coming from the pentair addon via mqtt.

I'll add an mqtt label in case someone thinks mqtt should prevent the invalid state from being set or has a way to clean it up.

probot-home-assistant[bot] commented 4 years ago

mqtt documentation mqtt source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @home-assistant/core, @emontnemery, mind taking a look at this issue as its been labeled with a integration (mqtt) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

rjw2324 commented 4 years ago

@bwoodworth

bwoodworth commented 4 years ago

I'm pretty sure the issue is with the action_topic. It is actually unnecessary so you can remove it from your configuration. Try that and see if it works.

rjw2324 commented 4 years ago

That worked! Thanks everyone!