#tplink

1 messages ยท Page 1 of 1 (latest)

meager narwhal
#

Hi @vapid roost, so before you added the fisrt device with the IP you didn't see any devices? Was this on the overview page or if you click in to the integration itself?

vapid roost
meager narwhal
#

If you do "Add integration" > "TPLink Kasa Smart" and leave host empty does it find them all?

vapid roost
#

Yes it does, I did not expect I could leave the field empty (will learn me to read next time).

#

Still makes me wonder why it discovers them when I start the flow,
but not automatically like other devices in HA.

meager narwhal
#

I think it's because once you've added one then the integrations discovery starts to kick in. Before that it's using the list of know mac address prefixes via dhcp

#

Would you mind generating some fixtures via the python-kasa devtools?

vapid roost
#

Doing so as we speak.

#

Just the entire files for all 4?

#

They seem to be mostly the same, except for the MAC address.

meager narwhal
#

That's great, thanks very much!

grave thunder
#

Maybe we could improve the config flow UX by adding a menu as the first step, allowing to select automatic discovery or manual entry?

#

The text mentions that devices are automatically discovered if no address is given, but having a menu would make it nicer ๐Ÿ™‚

vapid roost
#

That would improve it, but ideally it uses the native things?

grave thunder
#

Hmm, what do you mean by native things in this context? The standard config flow elements? If so, there's self.async_show_menu which is widely used inside homeassistant to do something like this. Probably not worth changing during the beta, but just something to keep in mind for future improvements.

vapid roost
#

I just mean, why do we need to manually start the flow for devices to get discovered? Normally they all show up in HA with an option to configure, even when the integration was not set up before.

grave thunder
#

Ahh, that one. So when the integration has not yet been set up, the discovery is based on MAC addresses. We haven't yet updated the list in manifest.json to contain all currently known ones, but we should do that before the release.

#

Thanks for those files, they will help us to get more devices autodetected out of the box!

vapid roost
#

Indeed, there are more that could be discovered looking at the library as well.

#

I expected at least 1 to show up, P115EU_1.0_1.3.0_-_50 would match with

    {
      "hostname": "p1*",
      "macaddress": "30DE4B*"
    },
``` (line 191-194 in the manifest).
#

"macaddress": "3C52A1*" would match my P115 as well (currently limited to hostname e[sp]* and l5*.

#

"macaddress": "5091E3*" is in there as well but currently only hostname k[lps]*

#

I'm not an active HA developer but just wondering, do we always need to have both a hostname and macaddress?

grave thunder
#

We could indeed be more lax on those filters, but having a partial hostname will avoid false positives given that tplink manufactures a lot of network equipment and other devices we don't currently support.

#

I think we could use a simple wildcard like *<any 2-digit+ number>* to match, to avoid overly complicating the matter. I'll sync the known addresses to see how it would look like

grave thunder
#

@vapid roost your devices should be discovered automatically starting from the next beta release: https://github.com/home-assistant/core/pull/109437/ - thanks again for those fixture files! edit: oh, 2024.2.0b4 which contains that PR was released just a few minutes ago.

GitHub

Proposed change

Add more known OUIs for tplink's dhcp discovery, synced from python-kasa/python-kasa#677
This makes the existence of support more visible, especially for users with newly suppo...