-
-
Notifications
You must be signed in to change notification settings - Fork 28.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switchbot_cloud cannot connect while sending commands from an automation #116791
Comments
Rolling back to 2024.4.4 fixes the issue. |
I looked through some of the issues and I can see multiple duplicated issues: is:issue is:open in:body await created:2024-05-04 Search filter:
|
Hey there @SeraphicRav, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) switchbot_cloud documentation |
I tried with the container version with version 2024.5.2 with control from the dashboard or automation and did not meet any error. @johnypony3 Can you please try updating to the latest version and tell me you can see any improvement? |
The problem
Issue resolved with:pip install CoraWhat version of Home Assistant Core has the issue?
core-2024.5.1
What was the last working version of Home Assistant Core?
core-2024.4.4
What type of installation are you running?
Home Assistant Container
Integration causing the issue
None
Link to integration documentation on our website
None
Diagnostics information
2024-05-04 08:40:51.465 ERROR (MainThread) [homeassistant.components.script.1712581780298] Ashley’s Light Fader: If at step 5: Error executing script. Unexpected error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/lightener/light.py", line 256, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switch_as_x/entity.py", line 152, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/switch.py", line 39, in async_turn_on
await self.send_command(CommonCommands.ON)
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/entity.py", line 45, in send_command
await self._api.send_command(
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 291, in send_command
await self._request(f"devices/{device_id}/commands", callback="post", json=json)
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 217, in _request
raise CannotConnect()
switchbot_api.CannotConnect
2024-05-04 08:40:51.781 ERROR (MainThread) [homeassistant.components.script.1712581780298] Ashley’s Light Fader: Error executing script. Unexpected error for if at pos 5:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1043, in _async_if_step
await self._async_run_script(if_data["if_then"])
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1210, in _async_run_script
result = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1731, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 451, in async_run
await self._async_step(log_exceptions=False)
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 503, in _async_step
self._handle_exception(
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 533, in _handle_exception
raise exception
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/lightener/light.py", line 256, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switch_as_x/entity.py", line 152, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/switch.py", line 39, in async_turn_on
await self.send_command(CommonCommands.ON)
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/entity.py", line 45, in send_command
await self._api.send_command(
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 291, in send_command
await self._request(f"devices/{device_id}/commands", callback="post", json=json)
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 217, in _request
raise CannotConnect()
switchbot_api.CannotConnect
2024-05-04 08:40:51.878 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Parallel action at step 1: parallel 1: Error executing script. Unexpected error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/script/init.py", line 654, in _service_handler
response = await self._async_start_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/script/init.py", line 612, in _async_start_run
script_result = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/script/init.py", line 643, in _async_run
return await self.script.async_run(script_vars, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1731, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 451, in async_run
await self._async_step(log_exceptions=False)
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 503, in _async_step
self._handle_exception(
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 533, in _handle_exception
raise exception
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1043, in _async_if_step
await self._async_run_script(if_data["if_then"])
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1210, in _async_run_script
result = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 1731, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 451, in async_run
await self._async_step(log_exceptions=False)
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 503, in _async_step
self._handle_exception(
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 533, in _handle_exception
raise exception
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 501, in _async_step
await getattr(self, handler)()
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 736, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/script.py", line 699, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/config/custom_components/lightener/light.py", line 256, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/light/init.py", line 627, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switch_as_x/entity.py", line 152, in async_turn_on
await self.hass.services.async_call(
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/switch.py", line 39, in async_turn_on
await self.send_command(CommonCommands.ON)
File "/usr/local/lib/python3.12/site-packages/homeassistant/components/switchbot_cloud/entity.py", line 45, in send_command
await self._api.send_command(
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 291, in send_command
await self._request(f"devices/{device_id}/commands", callback="post", json=json)
File "/usr/local/lib/python3.12/site-packages/switchbot_api/init.py", line 217, in _request
raise CannotConnect()
switchbot_api.CannotConnect
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
I was able to reproduce the issue and the solution by recreating the container, observing the issue, executing the fix and observing resolved issue.The issue is not resolved unfortunately.
The text was updated successfully, but these errors were encountered: