simbaja / ha_gehome

GE Home Appliances (SmartHQ) for Home Assistant
MIT License
302 stars 71 forks source link

Error Setting fan_mode via HomeKit Integration #235

Open nikoszagk opened 4 months ago

nikoszagk commented 4 months ago

When attempting to set the fan_mode through HomeKit integration in my Home Assistant setup, I encountered an error. Specifically, the error message states that "low" is not a valid fan_mode option. However, setting the fan_mode through Home Assistant directly works without any issues.

assistant.exceptions.ServiceValidationError: The fan_mode low is not a valid fan_mode: Auto, Low, Med, High

Steps to Reproduce:

  1. Set up Home Assistant with the HomeKit integration enabled.
  2. Using a HomeKit-compatible device, attempt to set the fan_mode to "low" for the climate entity.
  3. Observe the error message mentioned above.

Expected Behavior: Setting the fan_mode to "low" through HomeKit integration should be recognized as a valid option.

Actual Behavior: An error is thrown indicating that "low" is not a valid fan_mode option, despite it working correctly when set through Home Assistant directly.

Any relevant logs or error messages

homeassistant.exceptions.ServiceValidationError: The fan_mode high is not a valid fan_mode: Auto, Low, Med, High
2024-03-01 23:24:13.478 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall climate.set_fan_mode (c:01HQXYEGH1WNSPAB2BWW7XJ9Y4): entity_id=['climate.d828c9ba7319_climate'], fan_mode=low>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2165, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 565, in async_handle_set_fan_mode_service
    self._valid_mode_or_raise("fan", fan_mode, self.fan_modes)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 533, in _valid_mode_or_raise
    raise ServiceValidationError(
homeassistant.exceptions.ServiceValidationError: The fan_mode low is not a valid fan_mode: Auto, Low, Med, High

It seems there might be an inconsistency between the validation of fan_mode options between Home Assistant and the HomeKit integration. Further investigation is needed to identify and resolve this issue.

simbaja commented 4 months ago

Hmm, based on that error, it doesn't even look like it's getting to the integration code. It looks like it's failing during HASS's validation. Is there any issue listed for the HomeKit integration related to fans?

nikoszagk commented 4 months ago

hello @simbaja , I didn't find any issue regarding fans for the HomeKit integration https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+homekit%22+fan

Although this time I tried to add the accessory from the UI of Home Assistant instead editing the configuration.yaml. The result was that it could find the fan of the A/C. The main thing is that 2 months ago the fan was working properly in homekit but after an update it broke. I couldn't find the version of that time that fan broke. Here is two screenshots of adding the accessory through UI

Screenshot 2024-03-06 at 5 00 13 PM Screenshot 2024-03-06 at 5 00 25 PM

As you can see there is no entities.

On the other side here is the entities for my A/C

Screenshot 2024-03-06 at 5 06 22 PM

It doesn't include fan loool :D That's why i opened this ticket because it disappeared from the entities

Thanks NZ

simbaja commented 2 months ago

Sorry for the delay, but I don't think there's an actual fan entity that it creates. Can you add "climate" domain entities to homekit?