Closed fredrike closed 4 years ago
We shouldn't remove it, as we are finding valid values in __init__
# determine available modes for this entity, prefer AUTO over HEAT_COOL and COOL over FAN_ONLY
self.hc_homekit_to_hass = {
c: s
for s, c in HC_HASS_TO_HOMEKIT.items()
if (
s in hc_modes
and not (
(s == HVAC_MODE_HEAT_COOL and HVAC_MODE_AUTO in hc_modes)
or (s == HVAC_MODE_FAN_ONLY and HVAC_MODE_COOL in hc_modes)
)
)
}
hc_valid_values = {k: v for v, k in self.hc_homekit_to_hass.items()}
HC_HOMEKIT_TO_HASS
is a bit suspect since its reversing the dict() and there are duplicate values
HC_HOMEKIT_TO_HASS
is only being used for water heaters so thats not the issue anyways
Its building the list right without auto
2020-03-29 16:33:38 DEBUG (SyncWorker_3) [custom_components.homekit.type_thermostats] self.hc_homekit_to_hass: {0: 'off', 1: 'heat', 2: 'cool', 3: 'auto'}, hc_valid_values: {'off': 0, 'heat': 1, 'cool': 2, 'auto': 3}
Has auto
No auto
2020-03-29 16:33:38 DEBUG (SyncWorker_3) [custom_components.homekit.type_thermostats] self.hc_homekit_to_hass: {0: 'off', 1: 'heat', 2: 'cool', 3: 'heat_cool'}, hc_valid_values: {'off': 0, 'heat': 1, 'cool': 2, 'heat_cool': 3}
Per #28586 you may need to disable auto start
@fredrike
_LOGGER.debug("self.hc_homekit_to_hass: %s, hc_valid_values: %s", self.hc_homekit_to_hass, hc_valid_values)
Would you please add this to your type_thermostats.py
After this line
hc_valid_values = {k: v for v, k in self.hc_homekit_to_hass.items()}
And then restart with logger for homekit set to debug (https://www.home-assistant.io/integrations/logger/) and paste in the result here?
Okay where is my type_thermostats file? I’ll give this a try.
Okay where is my type_thermostats file? I’ll give this a try.
It depends on your installation but in hassio it exist under /usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py
Send me a message and I'll try to help you.
I'm getting something similar on 0.108.1 using an Ecobee with Homekit. I get the following repeatedly in my logs:
2020-04-09 15:10:57 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 386, in update_state
HC_HASS_TO_HOMEKIT_ACTION[hvac_action]
KeyError: 'fan'
I'm getting something similar on 0.108.1 using an Ecobee with Homekit. I get the following repeatedly in my logs:
2020-04-09 15:10:57 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/homekit/type_thermostats.py", line 386, in update_state HC_HASS_TO_HOMEKIT_ACTION[hvac_action] KeyError: 'fan'
Might have fixed that in #33682
Not much can be done to investigate this until someone does the testing in https://github.com/home-assistant/core/issues/33386#issuecomment-605664790 who has a Daikin
Testing in progress...
https://github.com/home-assistant/core/pull/34073 should resolve most of these type of issues
The problem
Mapping from Homekit thermostat to HA is wrong..
https://github.com/home-assistant/core/blob/b731ddabde71b54fe295e76c26896b884b71ea9e/homeassistant/components/homekit/type_thermostats.py#L71-L79
I suggest that
HVAC_MODE_AUTO: 3,
is removed.Environment
Problem-relevant
configuration.yaml
Traceback/Error logs
Additional information
There have been a discussion here: https://community.home-assistant.io/t/support-for-daikin-airbase-units/102622/104 which diggs down to that it is the Homekit integration that does wrong.