petretiandrea / home-assistant-tapo-p100

A custom integration to control Tapo devices from home assistant.
MIT License
804 stars 100 forks source link

Constantly have to reload devices manually for them to work after a restart of HA #648

Open SBRK opened 9 months ago

SBRK commented 9 months ago

Version of the integration

2.12.0

Configuration

P115 (x10)

Describe the bug

Sometimes (almost all the time when restarting Home Assistant), my Tapo plugs entities become unavailable. To make them work, I have to "reload" each device on the Tapo integration page manually: image

Might be related, almost all plugs have the "TP-Link Tapo" integration listed multiple times: image

Debug log

This is the log after a restart. I think my issue has to do with the unique ids errors

2023-12-13 11:54:29.659 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration tapo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-12-13 11:54:56.461 INFO (MainThread) [homeassistant.setup] Setting up tapo
2023-12-13 11:54:56.461 INFO (MainThread) [homeassistant.setup] Setup of domain tapo took 0.0 seconds
2023-12-13 11:54:56.482 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-4A-7D-7D, last known ip is 10.0.0.111
2023-12-13 11:54:56.487 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-9F-5C, last known ip is 10.0.0.118
2023-12-13 11:54:56.488 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-6E-1F-C9, last known ip is 10.0.0.110
2023-12-13 11:54:56.490 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-A7-C0, last known ip is 10.0.0.112
2023-12-13 11:54:56.492 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-E4-0E-76, last known ip is 10.0.0.115
2023-12-13 11:54:56.493 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-A8, last known ip is 10.0.0.117
2023-12-13 11:54:56.496 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-99, last known ip is 10.0.0.116
2023-12-13 11:54:56.498 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-2B-1B-9F, last known ip is 10.0.0.114
2023-12-13 11:54:56.500 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-75-7C-A3, last known ip is 10.0.0.119
2023-12-13 11:54:56.501 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AD-FA, last known ip is 10.0.0.113
2023-12-13 11:55:07.093 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80225588A96E3D76092A0DA692A1303E210E58FD
2023-12-13 11:55:07.094 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022E57905F93962DB0504C7547A7EEA211415EB
2023-12-13 11:55:07.381 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 802222A6852B8487411704019717C90A21145430
2023-12-13 11:55:07.382 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022F811C6A280291886B568975496E220D7503B
2023-12-13 11:55:07.475 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022DDACB205695C121BBA1BC9F351D920C79C48
2023-12-13 11:55:07.476 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80229B72DF6FB0C3CE0BADDC8BE47A382114E433
2023-12-13 11:55:07.476 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022FB1C8A41E280117CB957D62A4FD32114E4E1
2023-12-13 11:55:07.523 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80228F6B81F351689D760D314C337E9D2114AF9E
2023-12-13 11:55:07.524 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80223D57EFF822B3AE8A81D540A0610720F888CC
2023-12-13 11:55:07.524 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022936A7E925BC55660A82747EB8E3720FE689F
2023-12-13 11:55:46.104 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-E4-0E-76, last known ip is 10.0.0.115
2023-12-13 11:55:46.106 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-A8, last known ip is 10.0.0.117
2023-12-13 11:55:46.108 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AD-FA, last known ip is 10.0.0.113
2023-12-13 11:55:46.124 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-75-7C-A3, last known ip is 10.0.0.119
2023-12-13 11:55:46.126 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-2B-1B-9F, last known ip is 10.0.0.114
2023-12-13 11:55:46.128 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-99, last known ip is 10.0.0.116
2023-12-13 11:55:46.143 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-A7-C0, last known ip is 10.0.0.112
2023-12-13 11:55:46.144 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-9F-5C, last known ip is 10.0.0.118
2023-12-13 11:55:46.146 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-4A-7D-7D, last known ip is 10.0.0.111
2023-12-13 11:55:46.163 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-6E-1F-C9, last known ip is 10.0.0.110
2023-12-13 11:56:01.182 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022FB1C8A41E280117CB957D62A4FD32114E4E1
2023-12-13 11:56:01.182 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022DDACB205695C121BBA1BC9F351D920C79C48
2023-12-13 11:56:01.183 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 802222A6852B8487411704019717C90A21145430
2023-12-13 11:56:01.183 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80223D57EFF822B3AE8A81D540A0610720F888CC
2023-12-13 11:56:01.184 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022F811C6A280291886B568975496E220D7503B
2023-12-13 11:56:01.184 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80229B72DF6FB0C3CE0BADDC8BE47A382114E433
2023-12-13 11:56:01.185 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022936A7E925BC55660A82747EB8E3720FE689F
2023-12-13 11:56:01.186 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80225588A96E3D76092A0DA692A1303E210E58FD
2023-12-13 11:56:01.187 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022E57905F93962DB0504C7547A7EEA211415EB
2023-12-13 11:56:01.188 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80228F6B81F351689D760D314C337E9D2114AF9E
2023-12-13 11:56:11.305 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-99, last known ip is 10.0.0.116
2023-12-13 11:56:11.383 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-6E-1F-C9, last known ip is 10.0.0.110
2023-12-13 11:56:11.395 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-2B-1B-9F, last known ip is 10.0.0.114
2023-12-13 11:56:11.405 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-4A-7D-7D, last known ip is 10.0.0.111
2023-12-13 11:56:11.462 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-A7-C0, last known ip is 10.0.0.112
2023-12-13 11:56:11.527 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-A8, last known ip is 10.0.0.117
2023-12-13 11:56:11.596 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AD-FA, last known ip is 10.0.0.113
2023-12-13 11:56:11.631 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-E4-0E-76, last known ip is 10.0.0.115
2023-12-13 11:56:11.694 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-9F-5C, last known ip is 10.0.0.118
2023-12-13 11:56:11.697 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-75-7C-A3, last known ip is 10.0.0.119
2023-12-13 11:56:35.747 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022DDACB205695C121BBA1BC9F351D920C79C48
2023-12-13 11:56:35.855 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022936A7E925BC55660A82747EB8E3720FE689F
2023-12-13 11:56:36.510 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022F811C6A280291886B568975496E220D7503B
2023-12-13 11:56:36.774 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80225588A96E3D76092A0DA692A1303E210E58FD
2023-12-13 11:56:36.860 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022E57905F93962DB0504C7547A7EEA211415EB
2023-12-13 11:56:36.860 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80229B72DF6FB0C3CE0BADDC8BE47A382114E433
2023-12-13 11:56:37.158 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022FB1C8A41E280117CB957D62A4FD32114E4E1
2023-12-13 11:56:37.275 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 802222A6852B8487411704019717C90A21145430
2023-12-13 11:56:37.369 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80228F6B81F351689D760D314C337E9D2114AF9E
2023-12-13 11:56:37.591 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80223D57EFF822B3AE8A81D540A0610720F888CC
2023-12-13 11:56:56.003 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-6E-1F-C9, last known ip is 10.0.0.110
2023-12-13 11:56:56.026 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-2B-1B-9F, last known ip is 10.0.0.114
2023-12-13 11:56:56.934 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-75-7C-A3, last known ip is 10.0.0.119
2023-12-13 11:56:57.157 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-A8, last known ip is 10.0.0.117
2023-12-13 11:56:57.171 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-E4-0E-76, last known ip is 10.0.0.115
2023-12-13 11:56:57.187 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-99, last known ip is 10.0.0.116
2023-12-13 11:57:02.695 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022DDACB205695C121BBA1BC9F351D920C79C48
2023-12-13 11:57:02.770 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022936A7E925BC55660A82747EB8E3720FE689F
2023-12-13 11:57:03.430 INFO (MainThread) [custom_components.tapo.coordinators] Detected model of 10.0.0.114: p115
2023-12-13 11:57:03.509 INFO (MainThread) [custom_components.tapo.coordinators] Detected model of 10.0.0.110: p115
2023-12-13 11:57:03.897 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.467 seconds (success: True)
2023-12-13 11:57:03.940 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tapo
2023-12-13 11:57:03.996 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tapo
2023-12-13 11:57:04.003 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tapo
2023-12-13 11:57:04.009 INFO (MainThread) [homeassistant.components.light] Setting up light.tapo
2023-12-13 11:57:04.047 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.537 seconds (success: True)
2023-12-13 11:57:04.089 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tapo
2023-12-13 11:57:04.090 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tapo
2023-12-13 11:57:04.090 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tapo
2023-12-13 11:57:04.091 INFO (MainThread) [homeassistant.components.light] Setting up light.tapo
2023-12-13 11:57:04.146 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_signal_level already exists - ignoring sensor.subwoofer_signal_level
2023-12-13 11:57:04.147 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_current_power already exists - ignoring sensor.subwoofer_current_power
2023-12-13 11:57:04.147 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_today_energy already exists - ignoring sensor.subwoofer_today_energy
2023-12-13 11:57:04.147 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_month_energy already exists - ignoring sensor.subwoofer_month_energy
2023-12-13 11:57:04.148 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_today_runtime already exists - ignoring sensor.subwoofer_today_runtime
2023-12-13 11:57:04.148 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_month_runtime already exists - ignoring sensor.subwoofer_month_runtime
2023-12-13 11:57:04.148 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_Overheat already exists - ignoring binary_sensor.subwoofer_overheat
2023-12-13 11:57:04.573 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.526 seconds (success: True)
2023-12-13 11:57:04.621 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.471 seconds (success: True)
2023-12-13 11:57:04.674 ERROR (MainThread) [homeassistant.components.switch] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B already exists - ignoring switch.subwoofer
2023-12-13 11:57:05.780 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022F811C6A280291886B568975496E220D7503B
2023-12-13 11:57:05.996 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80225588A96E3D76092A0DA692A1303E210E58FD
2023-12-13 11:57:06.275 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80229B72DF6FB0C3CE0BADDC8BE47A382114E433
2023-12-13 11:57:06.299 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022E57905F93962DB0504C7547A7EEA211415EB
2023-12-13 11:57:33.941 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.161 seconds (success: True)
2023-12-13 11:57:45.875 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 9C-53-22-75-7C-A3, last known ip is 10.0.0.119
2023-12-13 11:57:46.373 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-E4-0E-76, last known ip is 10.0.0.115
2023-12-13 11:57:46.460 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-A8, last known ip is 10.0.0.117
2023-12-13 11:57:46.715 INFO (MainThread) [custom_components.tapo.setup_helpers] Trying to track ip address of 48-22-54-FD-AA-99, last known ip is 10.0.0.116
2023-12-13 11:57:51.416 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022F811C6A280291886B568975496E220D7503B
2023-12-13 11:57:51.947 INFO (MainThread) [custom_components.tapo.coordinators] Detected model of 10.0.0.119: p115
2023-12-13 11:57:52.181 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.234 seconds (success: True)
2023-12-13 11:57:52.183 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tapo
2023-12-13 11:57:52.184 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tapo
2023-12-13 11:57:52.184 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tapo
2023-12-13 11:57:52.185 INFO (MainThread) [homeassistant.components.light] Setting up light.tapo
2023-12-13 11:57:52.194 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_signal_level already exists - ignoring sensor.subwoofer_signal_level
2023-12-13 11:57:52.195 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_current_power already exists - ignoring sensor.subwoofer_current_power
2023-12-13 11:57:52.195 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_today_energy already exists - ignoring sensor.subwoofer_today_energy
2023-12-13 11:57:52.195 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_month_energy already exists - ignoring sensor.subwoofer_month_energy
2023-12-13 11:57:52.196 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_today_runtime already exists - ignoring sensor.subwoofer_today_runtime
2023-12-13 11:57:52.196 ERROR (MainThread) [homeassistant.components.sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_month_runtime already exists - ignoring sensor.subwoofer_month_runtime
2023-12-13 11:57:52.196 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B_Overheat already exists - ignoring binary_sensor.subwoofer_overheat
2023-12-13 11:57:52.425 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.229 seconds (success: True)
2023-12-13 11:57:52.426 ERROR (MainThread) [homeassistant.components.switch] Platform tapo does not generate unique IDs. ID 8022F811C6A280291886B568975496E220D7503B already exists - ignoring switch.subwoofer
2023-12-13 11:57:53.045 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80225588A96E3D76092A0DA692A1303E210E58FD
2023-12-13 11:57:53.351 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 8022E57905F93962DB0504C7547A7EEA211415EB
2023-12-13 11:57:53.435 DEBUG (MainThread) [custom_components.tapo.setup_helpers] Creating new API to create a coordinator for 80229B72DF6FB0C3CE0BADDC8BE47A382114E433
2023-12-13 11:57:53.770 INFO (MainThread) [custom_components.tapo.coordinators] Detected model of 10.0.0.116: p115
2023-12-13 11:57:53.921 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.150 seconds (success: True)
2023-12-13 11:57:53.922 INFO (MainThread) [homeassistant.components.switch] Setting up switch.tapo
2023-12-13 11:57:53.923 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tapo
2023-12-13 11:57:53.924 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tapo
2023-12-13 11:57:53.925 INFO (MainThread) [homeassistant.components.light] Setting up light.tapo
2023-12-13 11:57:54.114 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.170 seconds (success: True)
2023-12-13 11:58:03.918 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.138 seconds (success: True)
2023-12-13 11:58:23.884 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.155 seconds (success: True)
2023-12-13 11:58:33.941 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.163 seconds (success: True)
2023-12-13 11:58:53.879 DEBUG (MainThread) [custom_components.tapo.coordinators] Finished fetching tapo data in 0.151 seconds (success: True)
Bodfrey commented 9 months ago

I'm having this issue with all my Tapo devices for a while now, certainly not just with the last version of the integration - multiple duplicate entries listed under all devices, and often going "unavailable". I've had to set up an automation that detects when the device has changed to unavailable and reloads. Also, devices seem to merge within each other.

For example, I have a P110 used for my son's heated blanket, and a P100 for his guitar amp. image

Clicking on "2 devices" then shows the following - note that the devices appear to have become nested, and the integration is listed twice alongside one device.

image

P110, P100, L530 bulbs - all are affected. Integration version 2.12.1 home-assistant_tapo_2023-12-13T18-17-17.548Z.log

jaward916 commented 9 months ago

I have both of these issues too, I love HA, and this Tapo plugin is fantastic, but a couple of usability issues around how the devices look on my system, especially post-reboot means I'm spending a lot of time "managing" this when it should "just work". I don't add devices very often, it's a fairly static system now.

Here's how my devices look after a reboot this morning: image This is actually after 2 of them needed reloads as per the original post above.

From the Second post on the multiple devices, I have 5 devices total, but showing as multiple devices against the headers, 2 of them are not working at all and will require further reconfiguration to work properly, this is my Tapo Hub H100 which also controls "Office Sensor" the T315 - IP addresses are fine, so I have turned on Debug Logging to review later.

But my reason for posting is to say, that I have both issues raised above, so I'm joining the thread to make sure I get the updates because I've been impressed with all the updates and fixes so far on this, you've solved many issues I've experienced in the last few releases, so looking forward to this stabilising a little more!

SBRK commented 9 months ago

@Bodfrey I didn't even think about that workaround. Care to share the automation you did ?

Bodfrey commented 9 months ago

Sure. I also added a notification so I could see how often it had to reload.

alias: "Blanket Watcher "
description: ""
trigger:
  - platform: state
    entity_id:
      - switch.oscar_electric_blanket
    to: unavailable
    for:
      hours: 0
      minutes: 10
      seconds: 0
condition: []
action:
  - service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: switch.oscar_electric_blanket
  - service: notify.mobile_app_pixel_7_pro
    data:
      message: Blanket Integration Reloaded
mode: single
Bodfrey commented 9 months ago

@jaward916 I'm the same - it's the only aspect of HA that's needed attention and everything's pretty static in terms of devices. I'm having to delete and add devices back in all the time to resolve problems. All devices have static IPs and the MAC address tracking switched on. I've even made sure that the devices are locked to the closest mesh node on my wifi network to rule out connectivity issues.

alexskynet commented 9 months ago

+1

SBRK commented 9 months ago

Sure. I also added a notification so I could see how often it had to reload.

@Bodfrey Does it happen other than when rebooting HA?

Bodfrey commented 9 months ago

Sure. I also added a notification so I could see how often it had to reload.

@Bodfrey Does it happen other than when rebooting HA?

Yes, it does. It'll be fine for a while, but then will happen a few times an hour. Of course, it could just be a device issue - not ruling that out.

BettySwallocks commented 9 months ago

Not sure if same underlying cause but a few of my Tapo bulbs need reinstalling on a regular basis (since 2023.12 I think). Log messages:

2023-12-14 22:34:54.421 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546812326720] The length of the provided data is not a multiple of the block length.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2067, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2104, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 903, in entity_service_call
raise result from None
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1233, in async_request_call
return await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 591, in async_handle_light_off_service
await light.async_turn_off(**filter_turn_off_params(light, params))
File "/config/custom_components/tapo/light.py", line 167, in async_turn_off
await self._set_state(on=False)
File "/config/custom_components/tapo/light.py", line 180, in _set_state
return (await self.coordinator.device.off()).get_or_raise()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/api/light_device.py", line 41, in off
return await self._api.set_device_info(SetPlugInfoParams(False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 135, in set_device_info
return await self._set_device_info(dataclass_encode_json(device_info))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/api/tapo_client.py", line 236, in _set_device_info
response = await self._protocol.send_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 49, in send_request
response = await self._send_request(request, retry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 91, in _send_request
self._klap_session.chiper.decrypt(response_data)
File "/usr/local/lib/python3.11/site-packages/plugp100/protocol/klap_protocol.py", line 327, in decrypt
dp = decryptor.update(msg[32:]) + decryptor.finalize()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 186, in finalize
data = self._ctx.finalize()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 222, in finalize
raise ValueError(
ValueError: The length of the provided data is not a multiple of the block length.
SBRK commented 9 months ago

Sure. I also added a notification so I could see how often it had to reload.

@Bodfrey Does it happen other than when rebooting HA?

Yes, it does. It'll be fine for a while, but then will happen a few times an hour. Of course, it could just be a device issue - not ruling that out.

I gave it a go, and I think reloading one plug sometimes screws up another one.

SBRK commented 9 months ago

Not sure if same underlying cause but a few of my Tapo bulbs need reinstalling on a regular basis (since 2023.12 I think).

I did not specify it, but I've been having these issues since at least 2023.10

robcsi commented 9 months ago

I'm having the same two types of issues, but my IP's are not static. But if it reproduces with static IP devices too, then that's not the problem, I guess. I thought it was just because of having dynamic IP's, and a router restarting because of a power outage.

Where does the integration store its config? I have added all the devices through the UI, not configuration.xml. I'd like to check how it stores the settings.

robcsi commented 9 months ago

The documentation says "manually change ip address. Now you can change the ip address of a tapo device wihtout removing and re-adding it." is a feature. How do I change the IP of a device without removing and re-adding it?

SBRK commented 9 months ago

I'm having the same two types of issues, but my IP's are not static. But if it reproduces with static IP devices too, then that's not the problem, I guess. I thought it was just because of having dynamic IP's, and a router restarting because of a power outage.

Where does the integration store its config? I have added all the devices through the UI, not configuration.xml. I'd like to check how it stores the settings.

Not the issue I guess, because I have static IPs. I did however enabled the feature to automatically change the device ip based on its mac adress. I should disable it to see if it changes anything.

EDIT: After disabling MAC following and a restard, all plugs seem to work fine. @Bodfrey @jaward916 @BettySwallocks do you have dynamic ips and mac following enabled ?

robcsi commented 9 months ago

I'm having the same two types of issues, but my IP's are not static. But if it reproduces with static IP devices too, then that's not the problem, I guess. I thought it was just because of having dynamic IP's, and a router restarting because of a power outage. Where does the integration store its config? I have added all the devices through the UI, not configuration.xml. I'd like to check how it stores the settings.

Not the issue I guess, because I have static IPs. I did however enabled the feature to automatically change the device ip based on its mac adress. I should disable it to see if it changes anything.

EDIT: After disabling MAC following and a restard, all plugs seem to work fine. @Bodfrey @jaward916 @BettySwallocks do you have dynamic ips and mac following enabled ?

I have that enabled, too. I've removed the devices and added them back manually, so they don't get grouped again. There was an update of the integration, introducing KLAP protocol from Tapo. Maybe migrating to that messed things up...

jaward916 commented 9 months ago

I'm having the same two types of issues, but my IP's are not static. But if it reproduces with static IP devices too, then that's not the problem, I guess. I thought it was just because of having dynamic IP's, and a router restarting because of a power outage. Where does the integration store its config? I have added all the devices through the UI, not configuration.xml. I'd like to check how it stores the settings.

Not the issue I guess, because I have static IPs. I did however enabled the feature to automatically change the device ip based on its mac adress. I should disable it to see if it changes anything.

EDIT: After disabling MAC following and a restard, all plugs seem to work fine. @Bodfrey @jaward916 @BettySwallocks do you have dynamic ips and mac following enabled ?

I have removed and readded at the weekend, and it seems more stable, I do have dynamic IPs and Mac Following, but IPs only change if router reboots, if device is powered off and on it gets the same IP 9/10 times. This is much better: image

robcsi commented 9 months ago

Same here, for now.

Organizer21 commented 8 months ago

Just ran into this issue as well, not figuring out why a device/bulb would stop responding and I'm seeing most my devices multi-linked many times like others in this thread (I do have EERO router with dynamic IPs and I have also enabled the MAC tracking in HA's Tapo intergration).

I am thinking I'll assign each bulb an fixed IP adress via my EERO app then re-add them all to get this fixed I guess or is static addresses not required for a fix as well as turning off MAC tracking? Not sure I fully understand if this has been fixed already and is just a one off removal and re-add to resolve or something else?

jajera commented 8 months ago

Most of the time, if your router is not that busy, even you use DHCP, it will try to assign the same IP address if that is still available for use. For me, I would use DHCP but once the IP is assigned, I will set that as permanent to avoid this kind of issues. How you configure would depend on what router you use.

petretiandrea commented 8 months ago

Please upgrade to 2.13.0 its more stable

Eambo commented 7 months ago

I have this regularly with the latest version, the tapo module unfortunately seems very unstable. I have to reload at least once a day.

Is there anything I can provide log wise etc. that might help to narrow down what's happening?

Thank you for your help!

whoisthedaddy commented 7 months ago

Like many of you I've had a similar issue and tried a number of fixes (ensuring DNS was mapped to 8.8.8.8 which I read on another post) - none of these worked until I disabled the 'Try to track device dynamic ip using MAC address' as soon as I disabled this all devices came back online. I have a Ubiquiti Dream Machine and all these are on their own IOT VLAN (and were accessible on the app and via pinging) and will now assign them all static IP addresses to see if that helps...