Mode and preset selection for Haier Aircons not working
- 主要语言
- Python
- 星标
- 1.5k
- 派生
- 2.4k
- PR 合并指标
- 30 天内没有已合并 PR
描述
**Describe the bug**
till yesterday all was working fine, but now when I am trying to select preset mode "iot_heat" I am getting this error:
websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0
**To Reproduce**
Steps to reproduce the behavior:
in HA go to Developer settings and trigger Action - Climate: Set preset mode with value iot_heat
**Expected behavior**
the preset heating shall be set, instead I am getting unknown error
I was thinking that it was caused by HA itself but I did the same thing with Tuya Thermostat (set HVAC preset/mode) and all is ok with this. So seems that it is only related to way how Haier controls the appliance mode
**Screenshots**

**Environment (please complete the following information):**
- Core 2024.11.3
- Supervisor 2024.11.4
- Operating System 13.2
- hOn Integration Version 0.14.0
- pyhOn Version 0.17.5
**Additional context**
Add any other context about the problem here.
**Home Assistant Logs**
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
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(
^^^^^^^^^^^^^^^^^^^^^^^^^^
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 800, in async_handle_set_preset_mode_service
await self.async_set_preset_mode(preset_mode)
File "/config/custom_components/hon/climate.py", line 232, in async_set_preset_mode
self._device.sync_command("startProgram", "settings")
File "/usr/local/lib/python3.12/site-packages/pyhon/appliance.py", line 311, in sync_command
self.sync_parameter(base_param, target_param)
File "/usr/local/lib/python3.12/site-packages/pyhon/appliance.py", line 326, in sync_parameter
target.value = main.value
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyhon/parameter/enum.py", line 51, in value
raise ValueError(f"Allowed values: {self._values} But was: {value}")
ValueError: Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。