relevant part of my climate.pyvicare_heating entity:
```
hvac_modes: heat, off…, auto
preset_modes: comfort, eco
hvac_action: idle
preset_mode: null
vicare_modes: standby, forcedReduced, forcedNormal, heating
```
When I use climate.set_preset_mode, I get following result:
starting from preset_mode: null
climate.set_preset_mode --> eco : 'Command failed with status code 502. Reason given was: COMMAND_NOT_FOUND')
climate.set_preset_mode --> comfort : 502
climate.set_preset_mode --> null (or none) : 502
starting from preset_mode: eco or comfort
climate.set_preset_mode --> eco : OK, no errors, preset changes correctly (or stays the same when specifying the same preset)
climate.set_preset_mode --> comfort : OK, no errors, preset changes correctly (or stays the same when specifying the same preset)
climate.set_preset_mode --> null (or none) : 502, preset stays in the mode it was in
The 502 error (generates two almost identical error messages):
```
2022-02-05 23:23:24 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: (PyViCareCommandError(...), 'Command failed with status code 502. Reason given was: COMMAND_NOT_FOUND')
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 372, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 575, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 921, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 486, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/vicare/climate.py", line 342, in set_preset_mode
self._circuit.deactivateProgram(self._current_program)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareDevice.py", line 465, in deactivateProgram
return self.service.setProperty(f"heating.circuits.{self.circuit}.operating.programs.{program}", "deactivate", {})
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareCachedService.py", line 29, in setProperty
response = super().setProperty(property_name, action, data)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareService.py", line 60, in setProperty
return self.oauth_manager.post(url, post_data)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareAbstractOAuthManager.py", line 91, in post
self.__handle_command_error(response)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareAbstractOAuthManager.py", line 67, in __handle_command_error
raise PyViCareCommandError(response)
PyViCare.PyViCareUtils.PyViCareCommandError: (PyViCareCommandError(...), 'Command failed with status code 502. Reason given was: COMMAND_NOT_FOUND')
2022-02-05 23:23:24 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547632870448] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 534, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1253, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 372, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 575, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1630, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1667, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 921, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 486, in async_set_preset_mode
await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/vicare/climate.py", line 342, in set_preset_mode
self._circuit.deactivateProgram(self._current_program)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareDevice.py", line 465, in deactivateProgram
return self.service.setProperty(f"heating.circuits.{self.circuit}.operating.programs.{program}", "deactivate", {})
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareCachedService.py", line 29, in setProperty
response = super().setProperty(property_name, action, data)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareService.py", line 60, in setProperty
return self.oauth_manager.post(url, post_data)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareAbstractOAuthManager.py", line 91, in post
self.__handle_command_error(response)
File "/usr/local/lib/python3.9/site-packages/PyViCare/PyViCareAbstractOAuthManager.py", line 67, in __handle_command_error
raise PyViCareCommandError(response)
PyViCare.PyViCareUtils.PyViCareCommandError: (PyViCareCommandError(...), 'Command failed with status code 502. Reason given was: COMMAND_NOT_FOUND')
```
Additional info:
In the official ViCare app there are no issues setting eco/comfort or disabling them.
In the official ViCare app the eco mode is not available to choose from when forcedReduced mode is active. (So I could understand an error when doing `climate.set_preset_mode --> eco` whenever the starting vicare_mode would be forcedReduced)
## System Health
version | core-2022.2.2
-- | --
installation_type | Home Assistant OS
dev | false
hassio | true
docker | true
user | root
virtualenv | false
python_version | 3.9.7
os_name | Linux
os_version | 5.10.63-v8
arch | aarch64
timezone | Europe/Brussels
<details><summary>Home Assistant Community Store</summary>
GitHub API | ok
-- | --
Github API Calls Remaining | 4987
Installed Version | 1.20.0
Stage | running
Available Repositories | 975
Downloaded Repositories | 2
</details>
<details><summary>Home Assistant Cloud</summary>
logged_in | false
-- | --
can_reach_cert_server | ok
can_reach_cloud_auth | ok
can_reach_cloud | ok
</details>
<details><summary>Home Assistant Supervisor</summary>
host_os | Home Assistant OS 7.2
-- | --
update_channel | stable
supervisor_version | supervisor-2022.01.1
docker_version | 20.10.9
disk_total | 57.8 GB
disk_used | 4.2 GB
healthy | true
supported | true
board | rpi4-64
supervisor_api | ok
version_api | ok
installed_addons | File editor (5.3.3), Samba share (9.5.1), Terminal & SSH (9.3.0), Check Home Assistant configuration (3.9.0)
</details>