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

TP-Link Tapo P125M disappears after upgrading firmware #97247

Closed jasonmalinowski closed 11 months ago

jasonmalinowski commented 1 year ago

The problem

I have a TP-Link Tapo P125M (the Matter variant) connected to Home Assistant to automate a lamp. It has been working fine, until a week ago the plug had a firmware update to 1.0.6. Since then, the plug is now 'unavailable' in Home Assistant, and cannot be toggled. The Tapo app itself still shows the plug and I'm able to use it's own app to turn it on or off just fine.

I'm sure I can 'fix' this by resetting the plug and connecting it again, but I'm not sure if there's anything useful I can grab from logs before I destroy the repro.

What version of Home Assistant Core has the issue?

core-2023.7.3

What was the last working version of Home Assistant Core?

core-2023.7.2

(although to be clear: this broke when the plug firmware was updated)

What type of installation are you running?

Home Assistant OS

Integration causing the issue

matter

Link to integration documentation on our website

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

Diagnostics information

matter-4ee6d034c3ecfe3b0e81f88314a6c567-Mini Smart Wi-Fi Plug-3effd0f20a2a39d8bea069ce9c250cce.json.txt

Example YAML snippet

n/a, configured via UI.

Anything in the logs that might be useful for us?

I tried enabling diagnostic logging on the Matter integration and then restarted the integration, if this helps:

2023-07-24 23:55:10.523 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.airnow_aqi (None) cannot be converted to the unit of previously compiled statistics (aqi). Generation of long term statistics will be suppressed unless the unit changes back to aqi or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
2023-07-25 12:59:32.430 ERROR (MainThread) [pyhap.hap_handler] ('192.168.160.218', 50104): Client 9400a19f-cad4-4b46-bbef-a78052c97d1e with uuid {UUID('7a254749-dc20-4216-9a73-d59cf62f9d85'): b"\xba\n'\x96\xf7\xf9a\x81\x06\xed\x02\x12g^\x06\xc3\x96l\xdf\xcd\xbb\x03\xab#>]d\xab|\xd8\x85\xda"} attempted pair verify without being paired first (paired clients=Home Assistant Bridge).
2023-07-25 22:42:32.441 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Matter' for matter integration not ready yet: Failed to connect to matter server; Retrying in background
2023-07-25 22:47:47.628 DEBUG (MainThread) [homeassistant.components.matter] Add-on store info: {'advanced': False, 'arch': ['aarch64', 'amd64'], 'available': True, 'build': False, 'description': 'Matter WebSocket Server for Home Assistant Matter support.', 'documentation': True, 'homeassistant': '2023.5.4', 'icon': True, 'installed': True, 'logo': True, 'name': 'Matter Server', 'repository': 'core', 'slug': 'core_matter_server', 'stage': 'stable', 'update_available': False, 'url': 'https://github.com/home-assistant/addons/tree/master/matter_server', 'version_latest': '4.9.0', 'version': '4.9.0', 'apparmor': 'default', 'auth_api': False, 'detached': False, 'docker_api': False, 'full_access': False, 'hassio_api': True, 'hassio_role': 'default', 'homeassistant_api': False, 'host_network': True, 'host_pid': False, 'ingress': False, 'long_description': '# Home Assistant Add-on: Matter Server\n\n![Supports aarch64 Architecture][aarch64-shield]\n![Supports amd64 Architecture][amd64-shield]\n\n## About\n\nMatter Python WebSocket Server for Home Assistant Core. Matter (formerly\nknown as Connected Home over IP or CHIP) is an IPv6 based smart home\nstandard. This add-on provides a Matter Controller which allows you to\ncommission and control of Matter devices. The matching Home Assistant Core\nintegration communicates via WebSocket with this server.\n\n[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg\n[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg\n', 'rating': 4, 'signed': False}
2023-07-25 22:47:47.688 DEBUG (MainThread) [homeassistant.components.matter] Setting up entities for node 3
2023-07-25 22:47:47.691 DEBUG (MainThread) [homeassistant.components.matter] Creating switch entity for <class 'chip.clusters.Objects.OnOff.Attributes.OnOff'>

Additional information

The smart plug was previously running 1.0.4 of the firmware. It was originally added to HA via the iOS app. I've read through the Kasa website and I don't see any warning about firmware upgrades requiring everything to be reconnected.

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `matter` 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 matter` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


matter documentation matter source (message by IssueLinks)

jasonmalinowski commented 1 year ago

And to be clear: if the advice here is just to reset and repair, I'm happy to do so. I recognize this is beta and there might be hiccups!

marcelveldt commented 1 year ago

Is the integration loaded at all ? Do you have any other Matter devices connected to confirm ?

Is there anything in the logs from the Matter server (add-on) ? Maybe even try to reboot the whole host to rule out some old route cache or something.

jasonmalinowski commented 1 year ago

Do you have any other Matter devices connected to confirm ?

I don't have any other devices at the moment, but I've got another P125M in a box I can set up if that'd help.

Is there anything in the logs from the Matter server (add-on) ?

Nothing else that I can see other than what I shared in the original issue.

Maybe even try to reboot the whole host to rule out some old route cache or something.

Tried that but no luck.

edwagner commented 1 year ago

I have also had the same problem with Tapo P125M - they recently became "unavailable" in HA, and they currently have firmware 1.0.6. I can't 100% confirm the correlation between the firmware update and them becoming unavailable, but it seems very likely to be the cause.

I also have some Kasa KP125M with firmware 1.1.0 that are continuing to work just fine with HA via matter.

I've tried upgrading HA to 2023.8.1 and the matter server to 3.7.0 to no avail. I did a factory reset on one of my Tapo P125M plugs and was unable to re-pair it (I used to be able to re-pair them after doing a factory reset).

merrickjeff commented 1 year ago

I am having this issue with one of the three Tapo P125m outlets I have. It has firmware 1.0.6. The other two are on 1.0.4 and are still controllable in HA.

Also of note, this particular outlet is showing as "offline" in Google Home. The other two are still working normally in Google Home.

All outlets work fine in the Tapo app.

edwagner commented 1 year ago

P125M firmware 1.0.7 doesn't seem to work any better.

jasonmalinowski commented 1 year ago

@edwagner Were you able to get it working with a reset? After filing this bug I did eventually try a hard reset of the plug and I was able to re-pair and reconnect it to Home Assistant w/ the 1.0.6 firmware. I don't know if it helped but since I was using the Home Assistant iOS app, I went under iOS settings, General, Matter Accessories and removed the device there.

edwagner commented 1 year ago

Thanks @jasonmalinowski - I had done hard resets with no luck, but removing the device from the keychain through Settings -> General -> Matter Accessories (using the MAC address to identify the device) did the trick. Thanks for the tip!

GavinFarrington commented 1 year ago

I'm having the same issue as reported above by others. Same matter smart plugs, same timing, etc. I've got 4 or 5 of them and would prefer to not have to remove and reinstall them, but I'll do it if the wait for a fix will be a while.

marcelveldt commented 1 year ago

The Tapo devices are not available in the EU so I have no way of testing them.

Matter support of these Tapo devices is still pretty much beta, they are working our quirks. Resolution for now is to remove and re-add devices after the firmware update.

In a future version of the Matter integration we'll add some ways to do a re-interview of the device from the UI so you can manually recover from such a situation

jasonmalinowski commented 1 year ago

@marcelveldt Sounds good! Your comment of "they are working our quirks" makes me wonder -- is this something that's a bug on the Tapo side too?

marcelveldt commented 1 year ago

Probably yes, the whole industry is still working out the quirks. No surprise as all this is brand new released and not very mature yet. Just to set some expectations.

jasonmalinowski commented 1 year ago

@marcelveldt Of course, the (beta) tag meant speedbumps are expected! I guess I should have said my follow up question -- if it's possibly on the Tapo side, should I be reaching out them in some way?