Skip to content

Error -40214 on move to preset #1104

@jeros45

Description

@jeros45

Description

Hello :)

Sometimes on my Tapo C210, I have an error -40214.
I tried to fix this with a manual retry (with a recursive method) with the flag continue_on_error, but it doesn't work :(

The documentation says :

Please note that continue_on_error will not suppress/ignore misconfiguration or errors that Home Assistant does not handle.

I saw closed issues, and I understand the error is thrown by the camera.

Is it possible to catch the exception and throw another exception compatible with the continue_on_error flag ?

Thank's in advance :)

Reproduction Steps

  1. Call the move to preset service

Expected behavior

When the camera throw the -40214 error, catch it and throw another exception compatible with continue_on_error

If applicable, add error logs.

Error executing script. Unexpected error for device at pos 1: Error: -40214, Response: {"error_code": -40214} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1026, in _async_step_device await device_action.async_call_action_from_config( self._hass, self._action, dict(self._variables), self._context ) File "/usr/src/homeassistant/homeassistant/components/device_automation/action.py", line 72, in async_call_action_from_config await platform.async_call_action_from_config(hass, config, variables, context) File "/usr/src/homeassistant/homeassistant/components/select/device_action.py", line 121, in async_call_action_from_config await hass.services.async_call( ...<5 lines>... ) File "/usr/src/homeassistant/homeassistant/core.py", line 2816, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2859, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 830, 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 902, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 188, in async_handle_select_option await self.async_select_option(option) File "/config/custom_components/tapo_control/select.py", line 1206, in async_select_option await self.hass.async_add_executor_job(self._controller.setPreset, foundKey) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 2274, in setPreset return self.executeFunction( ~~~~~~~~~~~~~~~~~~~~^ "motorMoveToPreset", {"preset": {"goto_preset": {"id": str(presetID)}}} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 650, in executeFunction data = self.performRequest( ~~~~~~~~~~~~~~~~~~~^ { ^ ...<2 lines>... } ^ )["result"]["responses"][0] ^ File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 811, in performRequest return self.performRequest(requestData, loginRetryCount + 1) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 813, in performRequest raise Exception( ...<4 lines>... ) Exception: Error: -40214, Response: {"error_code": -40214}

Device Firmware

1.4.7 Build 250625 Rel.58841n

Integration Version

7.0.2

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Core 2025.11.1 on Pi4

Search for similar issues

Yes

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions