ollo69 / ha-smartthinq-sensors

HomeAssistant custom integration for SmartThinQ LG devices configurable with Lovelace User Interface.
Apache License 2.0
1.12k stars 157 forks source link

Error trying to enable/disable EXPRESS MODE / EXPRESS FRIDGE on LG L257S fridge #795

Open fabianosan opened 6 days ago

fabianosan commented 6 days ago

Describe the bug When I try to enable;disable EXPRESS MODE or EXPRESS FRIDGE in the refrigerator (Controls), I got the error in the log attached

Expected behavior I expected that the button for EXPRESS MODE and EXPRESS FRIDGE works

Screenshots image

Environment details:

image

Diagnostics log file: smartthinq_sensors-175158070cd6fc6b3cd0b0ec0cb87265-Geladeira-b9f2f984d99d692b1f0d2ee1fd8c48c6.json

Output of HA logs

2024-09-12 14:47:36.833 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140701813770128] 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 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, 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 "/config/custom_components/smartthinq_sensors/switch.py", line 269, in async_turn_off
    await self.entity_description.turn_off_fn(self._wrap_device)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 312, in set_express_fridge
    await self._set_feature(turn_on, STATE_EXPRESS_FRIDGE, CMD_STATE_EXPRESS_FRIDGE)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 291, in _set_feature
    await self.set(keys[0], keys[1], key=keys[2], value=status_value)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 579, in set
    await self._set_control(full_key, ctrl_path=ctrl_path)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 551, in _set_control
    await self._client.session.device_v2_controls(
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1322, in device_v2_controls
    res = await self.post2(cmd_path, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1079, in post2
    return await self._auth.gateway.core.lgedm2_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 393, in lgedm2_post
    return self._manage_lge_result(out, is_api_v2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 405, in _manage_lge_result
    raise API2_ERRORS[code](message)
custom_components.smartthinq_sensors.wideq.core_exceptions.DelayedResponseError: {'data': None}

2024-09-12 14:50:11.633 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140701821384400] 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 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, 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 "/config/custom_components/smartthinq_sensors/switch.py", line 277, in async_turn_on
    await self.entity_description.turn_on_fn(self._wrap_device)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 320, in set_express_mode
    await self._set_feature(turn_on, STATE_EXPRESS_MODE, CMD_STATE_EXPRESS_MODE)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 291, in _set_feature
    await self.set(keys[0], keys[1], key=keys[2], value=status_value)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 579, in set
    await self._set_control(full_key, ctrl_path=ctrl_path)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 551, in _set_control
    await self._client.session.device_v2_controls(
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1322, in device_v2_controls
    res = await self.post2(cmd_path, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1079, in post2
    return await self._auth.gateway.core.lgedm2_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 393, in lgedm2_post
    return self._manage_lge_result(out, is_api_v2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 405, in _manage_lge_result
    raise API2_ERRORS[code](message)
custom_components.smartthinq_sensors.wideq.core_exceptions.DelayedResponseError: {'data': None}

2024-09-12 14:50:26.954 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140701821384400] 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 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, 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 "/config/custom_components/smartthinq_sensors/switch.py", line 277, in async_turn_on
    await self.entity_description.turn_on_fn(self._wrap_device)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 320, in set_express_mode
    await self._set_feature(turn_on, STATE_EXPRESS_MODE, CMD_STATE_EXPRESS_MODE)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 291, in _set_feature
    await self.set(keys[0], keys[1], key=keys[2], value=status_value)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 579, in set
    await self._set_control(full_key, ctrl_path=ctrl_path)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 551, in _set_control
    await self._client.session.device_v2_controls(
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1322, in device_v2_controls
    res = await self.post2(cmd_path, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1079, in post2
    return await self._auth.gateway.core.lgedm2_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 374, in lgedm2_post
    async with self._get_session().post(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1353, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 684, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 994, in start
    with self._timer:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 713, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError

2024-09-12 14:51:00.955 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140701796929104] 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 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, 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 "/config/custom_components/smartthinq_sensors/switch.py", line 277, in async_turn_on
    await self.entity_description.turn_on_fn(self._wrap_device)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 312, in set_express_fridge
    await self._set_feature(turn_on, STATE_EXPRESS_FRIDGE, CMD_STATE_EXPRESS_FRIDGE)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 291, in _set_feature
    await self.set(keys[0], keys[1], key=keys[2], value=status_value)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 579, in set
    await self._set_control(full_key, ctrl_path=ctrl_path)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 551, in _set_control
    await self._client.session.device_v2_controls(
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1322, in device_v2_controls
    res = await self.post2(cmd_path, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1079, in post2
    return await self._auth.gateway.core.lgedm2_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 374, in lgedm2_post
    async with self._get_session().post(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1353, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 684, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 994, in start
    with self._timer:
  File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 713, in __exit__
    raise asyncio.TimeoutError from None
TimeoutError

Additional context Add any other context about the problem here.

McGiverGim commented 2 days ago

I tried with my fridge and I got a similar error:

Registrador: homeassistant.components.websocket_api.http.connection
Fuente: components/websocket_api/commands.py:245
integración: Home Assistant WebSocket API (documentación, problemas)
Ocurrió por primera vez: 16:00:50 (1 ocurrencias)
Última vez registrado: 16:00:50

[546799590928] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2761, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2804, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 996, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1068, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/switch.py", line 277, in async_turn_on
    await self.entity_description.turn_on_fn(self._wrap_device)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 320, in set_express_mode
    await self._set_feature(turn_on, STATE_EXPRESS_MODE, CMD_STATE_EXPRESS_MODE)
  File "/config/custom_components/smartthinq_sensors/wideq/devices/refrigerator.py", line 291, in _set_feature
    await self.set(keys[0], keys[1], key=keys[2], value=status_value)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 579, in set
    await self._set_control(full_key, ctrl_path=ctrl_path)
  File "/config/custom_components/smartthinq_sensors/wideq/device.py", line 551, in _set_control
    await self._client.session.device_v2_controls(
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1322, in device_v2_controls
    res = await self.post2(cmd_path, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 1079, in post2
    return await self._auth.gateway.core.lgedm2_post(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 393, in lgedm2_post
    return self._manage_lge_result(out, is_api_v2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthinq_sensors/wideq/core_async.py", line 406, in _manage_lge_result
    raise exc.APIError(message, code)
custom_components.smartthinq_sensors.wideq.core_exceptions.APIError: 0103 - {'data': None}