Skip to content

Issue Title: Discovery error: KH100 Hub (with Kasa protocol) triggers Failed to determine the right tapo protocol #976

Description

@mulle78de

Description

The automatic discovery process triggers an error in the logs when detecting the KH100 Smart IoT Hub. While the H100 Smart Hub works flawlessly, the KH100 seems to use the Kasa-based/unified discovery mechanism, causing the Tapo integration to pick it up mistakenly. The setup then fails during the protocol negotiation phase with a CannotConnect exception.

Steps to Reproduce

  1. Have a KH100 Hub active in the same local network.
  2. Allow Home Assistant to automatically discover the device via the tapo custom component.
  3. The configuration flow triggers an error during the async_step_discovery_auth_confirm phase.

Error Log / Traceback

Logger: custom_components.tapo.config_flow
Quelle: custom_components/tapo/config_flow.py:229
Integration: TP-Link Tapo
Erstmals aufgetreten: 09:49:11 (6 Vorkommnisse)
Zuletzt protokolliert: 09:56:51
Failed to setup cannot connectTraceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 318, in _async_get_device
    device = await connect_discovered_device(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        discovered_device, credential, session
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.14/site-packages/plugp100/discovery/service.py", line 43, in connect_discovered_device
    return await connect(config, session)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/plugp100/devices/factory.py", line 55, in connect
    protocol = await _get_or_guess_protocol(config, session)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/plugp100/devices/factory.py", line 80, in _get_or_guess_protocol
    raise Exception("Failed to determine the right tapo protocol")
Exception: Failed to determine the right tapo protocol

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/tapo/config_flow.py", line 229, in async_step_discovery_auth_confirm
    device = await self._async_get_device_from_discovered(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._discovered_info, user_input
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/tapo/config_flow.py", line 295, in _async_get_device_from_discovered
    return await self._async_get_device(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        config | {CONF_HOST: discovered.ip}, discovered
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/tapo/config_flow.py", line 328, in _async_get_device
    raise CannotConnect from error
custom_components.tapo.errors.CannotConnect

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions