JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.03k stars 85 forks source link

Move_to Preset Faills to call service #390

Closed TheDescender closed 12 months ago

TheDescender commented 12 months ago

Description

Using the integration's move_to preset option select list on the Tapo C210 doesn't work and returns the following error: Failed to call service select/select_option. connection lost

Anyone having the same issue? And a potential Idea what could cause this?

Full Error Log below.

Reproduction Steps

  1. Go to Device controls
  2. Click on Move to Preset list option
  3. Run move_to service with parameter from dropdown list
  4. Observe Fail to call service Error

Expected behavior

I expect the camera to pan to the select preset position.

If applicable, add error logs.

Logger: homeassistant.components.websocket_api.http.connection Source: custom_components/tapo_control/select.py:718 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 10:49:51 PM (27 occurrences) Last logged: 11:32:58 PM

[547388439824] Preset 1 is not set in the app [547388439824] Preset 3 is not set in the app [547388439824] Preset 5 is not set in the app [547388439824] Preset 6 is not set in the app [547388439824] Preset 7 is not set in the app Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service return await cast( ^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call response_data = task.result() # pop exception if have ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 106, in async_select_option await entity.async_select_option(option) File "/config/custom_components/tapo_control/select.py", line 718, in async_select_option await self.hass.async_add_executor_job(self._controller.setPreset, foundKey) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pytapo/init.py", line 846, in setPreset raise Exception("Preset {} is not set in the app".format(str(presetID))) Exception: Preset 1 is not set in the app

Device Firmware

1.3.6

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Raspberry Pi4 HassOS

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 12 months ago

Search for similar issues before opening the ticket like the template is asking you.

TheDescender commented 12 months ago

Sorry about that. Seems like when I searched issues for keyword preset yesterday I was still filtered on open issues. Must've been more tired than I thought. Didn't mean to upset you. Appreciate your quick response. Problem solved.

JurajNyiri commented 12 months ago

No worries, I am going to take a deeper look into this because this keeps coming up so there must be a bug somewhere I was not able to replicate yet. Reopening https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/340 .

JurajNyiri commented 12 months ago

I was able to replicate this and this is now fixed in 5.3.2.