Mode and preset selection for Haier Aircons not working
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
same problem
Same problem, Used to work before, yesterday I made the upgrade from HA Core 2024.11.1 to 2024.11.3 and since then, error I get this error in hon
Same problem. with HA core v2023.11.1 works correctly but after update to v2024.11.2 does not work. when i try to turn off my air conditioning, HA reports following error: climate/set_hvac_mode Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0
Same problem here :-)
Same here, airco does turn off though. But HA still shows as 'on'
Same problem. :(
+1
same problem here with 0.14.0 and 2024.12.1
Same problem, hope you could take a look at it @Andre0512 🤗
+1
@Andre0512 do we need to start looking for an other integration?
Tried the Givroux one, but it's missing sensors and entities.
Could you please let us all know.
Same issue here with AS35X and AS50XCAHRA
Same problem using HA 14.1 and core 2024.12.5
Same problem. with HA core v2023.11.1 works correctly but after update to v2024.11.2 does not work. when i try to turn off my air conditioning, HA reports following error: climate/set_hvac_mode Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0
I'm having the same problem, but I'm not sure if this is related to an HA upgrade. I'm still running HA V2024.10.3 in a docker container that does not auto update. Both HON en PYHON are not updated since august 2024 and Hacks is from september.
Is it possible that the Haier API is returning a different return code for turning off? I think that a 0 is a normal return code for this state. According to the Apple App store there are a serie of small bugfixes done on the Hon APP and in november they updated from 2.13 to 2.14.
I looked in the code but I can't find the valid enum values, I think if we update the enum value for turning off to the correct value instead of 0 it will be fixed.
I encountered the issue with turning off the AC using the hon integration and found a solution that works for me. The fix involves modifying the climate.py file:
Replace:
self._device.sync_command("stopProgram", "settings")
With:
self._device.settings["settings.onOffStatus"].value = "0"
This resolves the problem and ensures the AC turns off correctly.
For anyone interested, I’ve shared my patched version of the integration here:
https://github.com/sgmckay25/hon/tree/patch-1
Please note that this fork is not actively maintained. I hope this helps others facing the same issue!
works for me too, great solution @sgmckay25 Thanksss
your fix work @sgmckay25 thanks!!!
But I continue with this problem when I want to define a custom program (favorite program in hOn app) do you guys have the same error?
Thanks for the fix! There are 2 instances of the original string so be sure to replace both.
Can someone please confirm if the fix allows starting custom programs on an air conditioner?
I have performed the fix and turning the air conditioning on/off works fine with the fix thnx. But choosing a favorite program that is created in the HON app itself gives this error message. It also wants to turn on the air conditioning and apply the preset settings. That gives this error message.
"Action climate/set_preset_mode could not be performed. Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0"
I have the same problem with Haier AS35S2SF1FA-MW3
I encountered the issue with turning off the AC using the
honintegration and found a solution that works for me. The fix involves modifying theclimate.pyfile:Replace:
self._device.sync_command("stopProgram", "settings") With:
self._device.settings["settings.onOffStatus"].value = "0" This resolves the problem and ensures the AC turns off correctly.
For anyone interested, I’ve shared my patched version of the integration here: https://github.com/sgmckay25/hon/tree/patch-1
Please note that this fork is not actively maintained. I hope this helps others facing the same issue!
It works for me tnks
I have performed the fix and turning the air conditioning on/off works fine with the fix thnx. But choosing a favorite program that is created in the HON app itself gives this error message. It also wants to turn on the air conditioning and apply the preset settings. That gives this error message.
"Action climate/set_preset_mode could not be performed. Allowed values: ['2', '4', '5', '6', '7', '8'] But was: 0"
have this issue too...