Open sellison2 opened 9 hours 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!
(message by CodeOwnersMention)
tplink documentation tplink source (message by IssueLinks)
I want to point out this can also prevent adding a new Kasa device. If I bring a brand new Kasa device online, and it gets assigned the IP address of an existing device, HA will fail to add it with "device already exists". So then I have to pop into core.config_entries, find what HA currently thinks should use that IP address, turn that device on, wait for it to get a new IP address, and then I can successfully add the new device.
The problem
If you have multiple Kasa bulbs, and one of them gets assigned an IP address that had been previously in use by another, the old device will show an incorrect state.
So for example, I turned on the overhead light in a room in my house, all the bulbs report in with their state:
The thing is, a bulb in a completely different room erroneously reports that it's on as well:
The reason is because Kitchen Table Northeast had last used the IP address that Bonus Room Northeast is now using. You can see that by finding it in ~/config/.storage/core.config_entries:
This can present several problems. For example, it may cause an area or light to report there's a light active when there isn't one. The biggest frustration is if you have your lights in a group. In this example, if I decide to change all the lights in the kitchen to green, it'll change the single bulb in the bonus room as well.
If I turn on the offending bulb, once it reports in that fixes the status. So if I turned on all the lights in the kitchen, Kitchen Table Northeast will report in with a new IP address, at which point it will no longer mirror Bonus Room Northeast.
I would assume a fix could be to clear out the IP address from the core.config_entries when a new device checks in with that same IP address. It seems there's no issue updating the IP address when the bulb comes online with a new one.
What version of Home Assistant Core has the issue?
core-2024.9.0
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?
No response
Additional information
No response