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
72.15k stars 30.19k forks source link

After update 2024.7, Bulbs L530E will unavailable and including in Tapo app #121362

Closed zetaho2003 closed 2 months ago

zetaho2003 commented 3 months ago

The problem

Alter update 2024.7, Bulbs L530E will unavailable per few minute.

And then also can not use in Tapo app.

Some time restart can be to fix, Some need factory reset the Bulbs.

What version of Home Assistant Core has the issue?

core-2024.7.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP-Link Smart Home

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

記錄器: kasa.smartprotocol
來源: components/tplink/coordinator.py:49

Received unknown error code: -1011

記錄器: homeassistant.components.tplink.coordinator
來源: helpers/update_coordinator.py:344
整合: TP-Link Smart Home

Error fetching 192.168.10.216 data: ('Unable to query the device, timed out: 192.168.10.216: ', TimeoutError())

記錄器: homeassistant.components.websocket_api.http.connection
來源: components/websocket_api/commands.py:241
整合: Home Assistant WebSocket API

[140571442292496] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/tplink/entity.py", line 94, in _async_wrap
    await func(self, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 401, in async_turn_on
    await self._async_turn_on_with_brightness(brightness, transition)
  File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 294, in _async_turn_on_with_brightness
    await self._light_module.set_brightness(brightness, transition=transition)
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/modules/light.py", line 125, in set_brightness
    return await self._device.modules[Module.Brightness].set_brightness(brightness)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/modules/brightness.py", line 75, in set_brightness
    return await self.call("set_device_info", {"brightness": brightness})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 443, in _query_helper
    res = await self.protocol.query({method: params})
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 68, in query
    return await self._query(request, retry_count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 108, in _query
    raise ex
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 73, in _query
    return await self._execute_query(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 223, in _execute_query
    self._handle_response_error_code(response_data, smart_method)
  File "/usr/local/lib/python3.12/site-packages/kasa/smartprotocol.py", line 293, in _handle_response_error_code
    raise DeviceError(msg, error_code=error_code)
kasa.exceptions.DeviceError: Error querying device: 192.168.10.216: DEVICE_ERROR(-1301) for method: set_device_info (error_code=DEVICE_ERROR)

The above exception was the direct cause of the following 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/light/__init__.py", line 628, in async_handle_light_on_service
    await light.async_turn_on(**filter_turn_on_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/tplink/entity.py", line 115, in _async_wrap
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Unable to communicate with the device async_turn_on: Error querying device: 192.168.10.216: DEVICE_ERROR(-1301) for method: set_device_info (error_code=DEVICE_ERROR)

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @rytilahti, @bdraco, @sdb9696, mind taking a look at this issue as it has been labeled with an integration (tplink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tplink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tplink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

sdb9696 commented 3 months ago

Hi @zetaho2003, Can you tell us the hardware and firmware versions reported in the tapo app? Do you know if they have recently updated the firmware?

After you factory reset do the devices work or do they fail again?

zetaho2003 commented 3 months ago

Hi @zetaho2003, Can you tell us the hardware and firmware versions reported in the tapo app? Do you know if they have recently updated the firmware?

After you factory reset do the devices work or do they fail again?

hardware versions 1.0 firmware versions 1.3.0

No firmware updates recently

After you factory reset, the devices still fail again. So i can not use the devices in HA now.

sdb9696 commented 3 months ago

And are they working in the tapo app after a factory reset?

zetaho2003 commented 3 months ago

And are they working in the tapo app after a factory reset?

Yes, The Bulbs are normal in the tapo app after a factory reset.

sdb9696 commented 3 months ago

Can you post fresh logs after the reset, including any of the responses to the component_nego request.

zetaho2003 commented 3 months ago

Can you post fresh logs after the reset, including any of the responses to the component_nego request.

home-assistant_tplink_2024-07-06T09-38-21.125Z.log

This log is Integrated from light bulb to HA and until to unavailable.

sdb9696 commented 3 months ago

So it looks like the bulb is working ok, then you change the brightness a few times and it stops working. Is that right? Was it working with a previous version of HA with this integration?

zetaho2003 commented 3 months ago

So it looks like the bulb is working ok, then you change the brightness a few times and it stops working. Is that right? Was it working with a previous version of HA with this integration?

Yes, right. Before I've tried doing nothing and it's the same.

Yes, it working with a previous version of HA with this integration. because i don't have backup a previous version, so can not restore it.

sdb9696 commented 3 months ago

Hmm, ok. How comfortable are you with troubleshooting outside of HA? Would you be able to try out the kasa cli from https://github.com/python-kasa/python-kasa so we can continue troubleshooting? If so it will have to be tomorrow morning now as I’m out for the rest of the day. Are you on discord?

zetaho2003 commented 3 months ago

Hmm, ok. How comfortable are you with troubleshooting outside of HA? Would you be able to try out the kasa cli from https://github.com/python-kasa/python-kasa so we can continue troubleshooting? If so it will have to be tomorrow morning now as I’m out for the rest of the day. Are you on discord?

I'm ok. Yes, i have on discord. ID same as github.

zetaho2003 commented 3 months ago

Upload log home-assistant.log

sdb9696 commented 2 months ago

Update: after troubleshooting with @zetaho2003 we have identified this as an issue specific to the L530E with hardware version 1.0. (firmware version 1.3.0 but could be other firmware versions too).

We're currently testing a fix. If anyone else affected would like to test the fix please hmu on discord.

rytilahti commented 2 months ago

@sdb9696 it'd be great if you'd add a note in this issue about the probably cause & the potential fix for the sake of posterity :-)

edit: https://github.com/python-kasa/python-kasa/pull/1052 is the proposed fix

sdb9696 commented 2 months ago

@rytilahti, still working on the full root cause as there are multiple issues here, some addressed by https://github.com/python-kasa/python-kasa/pull/1052, another issue with setting color temp in HA that should be addressed with https://github.com/home-assistant/core/pull/121696. There's still an outstanding issue to be closed out that could be caused by the color temp problem but not confirmed yet.

sdb9696 commented 2 months ago

@home-assistant reopen