KeyError: 'settings.onOffStatus' when calling climate.set_hvac_mode with version v0.14.0
- Lingua principale
- Python
- Stelle
- 1.5k
- Fork
- 2.4k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hello Andre0512 (or relevant developers),
I am experiencing an issue with the Haier hOn integration, version v0.14.0, when trying to control my Haier air conditioner.
When I attempt to set the HVAC mode (e.g., turn off the AC or change to cool/heat), I receive a KeyError: 'settings.onOffStatus' error.
Environment:
Haier hOn Integration Version: v0.14.0 (as shown in the attached screenshot from HACS)
Home Assistant Core Version: [2025.5.1]
Haier Air Conditioner Model: [AB35S2SC2FA-1]
Haier Air Conditioner Firmware Version: [5.15.0]
Problem Description:
The climate entity for my Haier AC (climate.ced_server_condizionatore) appears correctly in Home Assistant with all standard attributes and modes. However, any attempt to change the HVAC mode via Home Assistant (e.g., calling climate.set_hvac_mode service with hvac_mode: 'off' or any other mode) results in an error.
Steps to Reproduce:
Navigate to Developer Tools > Services in Home Assistant.
Call the climate.set_hvac_mode service.
Select the Haier AC entity (e.g., climate.ced_server_condizionatore).
Set an hvac_mode (e.g., off, cool).
The service call fails, and the error below appears in the logs.
Error Log:
Python
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 250, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<7 lines>...
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
hass, entity, func, data, call.context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 677, in async_handle_set_hvac_mode_service
await self.async_set_hvac_mode(hvac_mode)
File "/config/custom_components/hon/climate.py", line 204, in async_set_hvac_mode
self._device.settings["settings.onOffStatus"].value = "1"
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'settings.onOffStatus'
Entity Attributes (from Developer Tools > States for climate.ced_server_condizionatore):
YAML
hvac_modes:
- "off"
- auto
- cool
- dry
- heat
- fan_only
min_temp: 16
max_temp: 30
target_temp_step: 1
fan_modes:
- auto
- low
- medium
- high
preset_modes:
- iot_10_heating
- iot_auto
- iot_cool
- iot_dry
- iot_fan
- iot_heat
- iot_simple_start
swing_modes:
- "off"
- vertical
- horizontal
- both
current_temperature: 23
temperature: 23
fan_mode: auto
preset_mode: null
swing_mode: vertical
icon: mdi:air-conditioner
friendly_name: CED Server Condizionatore
supported_features: 441
Additional Context:
It seems the integration is trying to access self._device.settings["settings.onOffStatus"] to change the device state, but this key is not found, leading to the KeyError. This might be due to an API change, a specific behavior of my AC model/firmware, or an issue in how the settings are populated.
Thank you for your work on this integration and for any help you can provide.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.