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.21k stars 30.57k forks source link

TP-Link Kasa HS300 current sensors missing names #98245

Closed derobert closed 9 months ago

derobert commented 1 year ago

The problem

HS300 amperage sensors have all been renamed "Current"; wattage sensors "Current consumption"; etc. The plug names are still there, but all the sensor names have been lost. This makes them difficult to use (each HS300 has 6 outlets, each with its own set of sensors — so each power strip now has 6 sensors just labeled "Current")

I confirmed the names are still in the Kasa app, too. And the "Controls" (on/off switch) still have the name.

What version of Home Assistant Core has the issue?

core-2023.8.1

What was the last working version of Home Assistant Core?

core-2023.7.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP-Link Kasa

Link to integration documentation on our website

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

Diagnostics information

config_entry-tplink-8cae9b2164fa4b7f03f34191422d247f.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Note that I have two Kasa plugs which are currently unplugged, so the integration is showing a failed setup on them. That's not new — they've been unplugged for months.

(I'm not sure if 2023.8.0 had the issue, I waited until .1 was out to upgrade. Also I'm only 75% sure they were working in 2023.7; they were at some point, but its possible the regression was earlier. Can't say I check the names every day...)

home-assistant[bot] commented 1 year ago

Hey there @rytilahti, @thegardenmonkey, 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.

(message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

plasticfist commented 1 year ago

I can confirm this is an issue across multiple devices, not just the HS300. I believe this problem was recently introduced, a recent update changed the names of all my sensors. This bug makes all the sensor dashboards useless, it is unreasonable to have to rename every sensor on every plug, thats in the hundreds for me... please fix

spiceywasabi commented 1 year ago

Also can confirm this, after upgrading Home Assistant the names are gone the underlying sensor names are still there but the display names got changed to either the smart power strip name or just blank.

Screenshot 2023-08-11 at 9 50 08 AM Screenshot 2023-08-11 at 9 50 03 AM
Home Assistant 2023.8.1
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0
BusyCityGuy commented 1 year ago

Also experiencing this. The entity ID contains the correct name, but the entity Name is too generic/doesn't include my custom name. image

Home Assistant 2023.8.2
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0
rytilahti commented 1 year ago

Regression from #96246, I don't have free cycles to look into what's the proper way to fix this. @joostlek any ideas?

joostlek commented 1 year ago

I made another PR because I saw that there were names that shouldn't be there.

To confirm, if you rename the device in HA to something else, does the name of the entity change?

BusyCityGuy commented 1 year ago

@joostlek After renaming the entity, the devices did indeed also get renamed with the same prefix.

e.g. I renamed my TP Link HS300 power strip: from TP-LINK_Power Strip_03E5 to Kasa Smart Power Strip 03E5 (Kitchen,

and the devices under it automatically changed for example, from TP-LINK_Power Strip_03E5 Plug 4 to Kasa Smart Power Strip 03E5 (Kitchen) Plug 4

joostlek commented 1 year ago

The plugs should be separate devices right?

BusyCityGuy commented 1 year ago

It's a power strip that has individually controllable outlets. I'm very new to Home Assistant so I'm not the best one to comment how it should be set up. But my use cases are plotting energy use by individual outlet, and have each outlets unique name show up correctly on the graph. I don't know if that means they need to be devices rather than entities, the distinction isn't clear to me.

I also would like the outlets sensors (current, power, and voltage) to be clearly associated with an individual outlet, whereas right now it's all jumbled in a mix of entities under the single power strip device.

Notably, the power strip isn't really anything by itself besides a container for the individual outlets, e.g. I dont think it has its own sensors or controls outside of the individual outlets.

closesim commented 1 year ago

Hi, I have the same issue. Booted HA 2023.7 in a another container. Here's is how should look like (2023.7 1 plug):

image

Here is how it looks in 2023.8, same device

image

Device info page (2023.7) with the rest of plugs

image

Device info page (2023.8)

image

As you also can see Switches states are not working properly in the frontend. On and Off commands in scripts seems to work properly

Edit: Switches states apparently broke after deleting and adding again the HS300 to HA in my original 2023.8 installation. Not sure at this moment.

joostlek commented 1 year ago

I'll take a look at this later this Sunday or Monday. Thanks for these screenshots!

spiceywasabi commented 1 year ago

One thing to add (picking a random power strip here) when used on assistant it reads out the whole name and sometimes requires it e.g. TP DASH LINK UNDERSCORE POWER STRIP ZERO 3 E 5 Plug 5 Which is a major change from just saying Plug 5

gefriedman commented 1 year ago

Same issue here. These all had names like "Computer" and "Monitors" before I upgraded over the weekend.

Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

I'd be pleased to provide additional info if requested. image

joostlek commented 1 year ago

Whoops, I forgot to link the PR I made. It's now up to the code owners to do a test and approve.

rytilahti commented 1 year ago

I don't have devices to test this, friendly ping to @bdraco who has some.

BusyCityGuy commented 1 year ago

Since the PR was declined because "virtual devices are a non-optimal workaround", what's the way forward here? I'm curious how did this used to work? Was it always this messy? This issue was listed above as a regression of https://github.com/home-assistant/core/pull/96246, so could we at least go back to whatever it was before?

bdraco commented 1 year ago

There are a few options:

In the mean time the plugs can be renamed manually

spiceywasabi commented 1 year ago

Renaming each plug might be possible, but is there any way to group the 3 sensors generated per plug/outlet or is that now a manual rename. For each smart power strip thats 12 renames at least. Just curious if there's a neat trick in the mean time

plasticfist commented 1 year ago

I think @BusyCityGuy suggestion is the best, at least until a correct fix is identified. This integration was working perfectly for me earlier. I have about 10 of the six plug power strips, so renaming all of the voltage, watts, amps properties one at a time across every plug just isn't reasonable to do. In part I have to admit because these all use to have very nice automatically assigned names based on the Kasa plug name, before the update... Yeah, I know, I should dive into the code, I can I hear someone thinking it.

issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

joostlek commented 10 months ago

Still cooking, there has been progress on this. Some bumps on the road but the end is in sight