hristo-atanasov / Tasmota-IRHVAC

Home Assistant platform for controlling IR Air Conditioners via Tasmota IRHVAC command and compatible hardware
187 stars 64 forks source link

Homekit will not create hvac entity in homekit component in startup if state is auto #62

Closed chicaneau closed 2 years ago

chicaneau commented 2 years ago

Please see https://github.com/home-assistant/core/issues/66784

homekit component dev advised there is an issue with sending 'auto' as a hvac action as this is not a supported action by the core HVAC component, see here https://developers.home-assistant.io/docs/core/entity/climate/?_highlight=hvac#hvac-action

Logger: homeassistant.components.homekit
Source: components/homekit/type_thermostats.py:466
Integration: HomeKit (documentation, issues)
First occurred: 10:01:32 AM (1 occurrences)
Last logged: 10:01:32 AM

Failed to create a HomeKit accessory for climate.office_aircon
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/homekit/init.py", line 595, in add_bridge_accessory
acc = get_accessory(self.hass, self.driver, state, aid, conf)
File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 224, 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 236, in init
self._async_update_state(state)
File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 466, in _async_update_state
homekit_hvac_action = HC_HASS_TO_HOMEKIT_ACTION[hvac_action]
KeyError: 'auto'
ahmetem commented 2 years ago

Logger: homeassistant.components.homekit Source: components/homekit/type_thermostats.py:624 Integration: HomeKit (documentation, issues) First occurred: 00:05:19 (1 occurrences) Last logged: 00:05:19

Failed to create a HomeKit accessory for climate.klima Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/homekit/init.py", line 595, in add_bridge_accessory acc = get_accessory(self.hass, self.driver, state, aid, conf) File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 222, 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 357, in init self._async_update_state(state) File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 624, in _async_update_state homekit_hvac_action = HC_HASS_TO_HOMEKIT_ACTION[hvac_action] KeyError: 'unavailable'

hristo-atanasov commented 2 years ago

@chicaneau @ahmetem Can you replace your current climate.py with the linked one from below (open the link -> right click on the page -> save file)? Home Assistant restart is needed after replacing the file. Check if everything in HomeKit works now and keep me updated with the results. Thank you in advance! https://raw.githubusercontent.com/hristo-atanasov/Tasmota-IRHVAC/webkit-fix/custom_components/tasmota_irhvac/climate.py

hristo-atanasov commented 2 years ago

Ok, update to the latest v2022.04.08 and update me with the results. :)

chicaneau commented 2 years ago

@hristo-atanasov nice work!! you solved it! v2022.04.08 appears to be working perfectly on restart, persistence is remaining! thankyou so much