home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.83k stars 30.91k forks source link

SmartThings climate show error when turn on #124336

Open ArkadiuszNiemiec opened 3 months ago

ArkadiuszNiemiec commented 3 months ago

The problem

Home Assistant WebSocket API throws an unexpected exception when toggling the Samsung AC on after it was sitting idle for some time. The request actually works, the AC turns on.

I'm basically copying the issue #115450 that @liamlain posted a few months ago. It was closed by @mib1185 as it's in the custom component. I have the same issue, and it's the core component that links to this repo (https://www.home-assistant.io/integrations/smartthings/) and has a known issue list here as well: https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+smartthings%22 Correct me if I'm wrong, but I think it belongs here 😄

What version of Home Assistant Core has the issue?

core-2024.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

SmartThings

Link to integration documentation on our website

https://www.home-assistant.io/integrations/smartthings/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-08-21 00:17:53.264 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140400324533344] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/smartthings/climate.py", line 433, in async_turn_on
    await self._device.switch_on(set_status=True)
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/device.py", line 1039, in switch_on
    result = await self.command(component_id, Capability.switch, Command.on)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/device.py", line 842, in command
    response = await self._api.post_device_command(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 147, in post_device_command
    return await self.post(API_DEVICE_COMMAND.format(device_id=device_id), data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 395, in post
    return await self.request("post", self._api_base + resource, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pysmartthings/api.py", line 368, in request
    raise APIResponseError(
pysmartthings.errors.APIResponseError: Unprocessable Entity (422): {"requestId": "7559339092759799214", "error": {"code": "UnprocessableEntityError", "message": "response code is BAD_REQUEST", "details": []}}

Additional information

No response

home-assistant[bot] commented 3 months ago

smartthings documentation smartthings source

ArkadiuszNiemiec commented 3 months ago

Looks like the main dependency pysmartthings is now deprecated: https://github.com/andrewsayre/pysmartthings

DAGA86 commented 1 week ago

Any news on this? Any solution? This also happens to me. Although the AC turns on, the error breaks all my automations. Tried a lot of different possibilities, like turning it on, changing the mode, etc.