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

P100 loosing connection since 2024.07.01 #121384

Closed Clutch57 closed 2 months ago

Clutch57 commented 3 months ago

The problem

All three TP-Link P100 plugs failing since 2024.07.0 and not better with 2024.07.1. 2024.6.4 worked fine.
Each plug eventually looses connection to network and the manual button quits working. Stays on or off in what ever state it was when it quit responding.

What version of Home Assistant Core has the issue?

2024.7.1

What was the last working version of Home Assistant Core?

core-2024.6.4

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

config_entry-tplink-a6c81c484ea386702d510f93bb213b88 (2).json

p100_128_tcpdump.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

p100_tcpdump.txt was monitoring one of my plugs just before it quit working.

home-assistant[bot] commented 3 months 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!

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. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

Eisbaer2 commented 3 months ago

Same here

millenniumy2k commented 3 months ago

Same here...

sdb9696 commented 3 months ago

Hi @Clutch57, could you include some debug logs from core. You may need to enable debug logging for kasa in configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.tplink: debug
    kasa: debug
Rogger commented 3 months ago

Hi, I noticed the same error, debug logs:


2024-07-07 12:40:52.816 DEBUG (MainThread) [kasa.smartprotocol] 192.168.0.89 multi-request-batch-1 << {'error_code': 0,
 'result': {'responses': [{'error_code': 0,
                           'method': 'component_nego',
                           'result': {'component_list': [{'id': 'device',
                                                          'ver_code': 2},
                                                         {'id': 'firmware',
                                                          'ver_code': 1},
                                                         {'id': 'quick_setup',
                                                          'ver_code': 3},
                                                         {'id': 'time',
                                                          'ver_code': 1},
                                                         {'id': 'wireless',
                                                          'ver_code': 1},
                                                         {'id': 'schedule',
                                                          'ver_code': 2},
                                                         {'id': 'countdown',
                                                          'ver_code': 2},
                                                         {'id': 'antitheft',
                                                          'ver_code': 1},
                                                         {'id': 'account',
                                                          'ver_code': 1},
                                                         {'id': 'synchronize',
                                                          'ver_code': 1},
                                                         {'id': 'sunrise_sunset',
                                                          'ver_code': 1},
                                                         {'id': 'led',
                                                          'ver_code': 1},
                                                         {'id': 'cloud_connect',
                                                          'ver_code': 1},
                                                         {'id': 'iot_cloud',
                                                          'ver_code': 1},
                                                         {'id': 'default_states',
                                                          'ver_code': 1}]}},
                          {'error_code': -1004, 'method': 'get_device_info'},
                          {'error_code': 0,
                           'method': 'get_connect_cloud_state',
                           'result': {'status': 0}}]}}
2024-07-07 12:40:52.817 DEBUG (MainThread) [kasa.smart.smartdevice] Error JSON_ENCODE_FAIL_ERROR(-1004) getting request get_device_info for device 192.168.0.89`
saxmanio85 commented 3 months ago

I am seeing this also. When reloading the integration I see the following:

Failed setup, will retry: Error querying device: 192.168.X.XXX: JSON_ENCODE_FAIL_ERROR(-1004) for method: multi-request-batch-1 (error_code=JSON_ENCODE_FAIL_ERROR)

Clutch57 commented 3 months ago

Hi @Clutch57, could you include some debug logs from core. You may need to enable debug logging for kasa in configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.tplink: debug
    kasa: debug

How do I download the debug info after that? Earlier I posted my logs but I realized that there was way too much info in that.

Eisbaer2 commented 2 months ago

Here's my TP-Link integration debug log: 2024-07-07 22:49:21.042 DEBUG (MainThread) [kasa.aestransport] Will perform handshaking... 2024-07-07 22:49:21.042 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:21.050 DEBUG (MainThread) [kasa.aestransport] Generating keypair 2024-07-07 22:49:21.127 DEBUG (MainThread) [kasa.aestransport] Handshake params: {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGqlqHuW6AOzwcMb64t9hJ3s+mqgkFlraYxufiKs8DE/kDbAzzwjTzHBq/BlI7gMydxzR/B6Jsh7ssY/gPFZyaJDf2DkDKWxfBMrx3frvBx7I9BSQtxQmawc9ChK9Ezn5TdHrfAfk1m/r5wlE56SJPCXQ1Dq2gFqyrYdSZvhL47wIDAQAB\n-----END PUBLIC KEY-----\n'} 2024-07-07 22:49:21.127 DEBUG (MainThread) [kasa.aestransport] Request {'method': 'handshake', 'params': {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGqlqHuW6AOzwcMb64t9hJ3s+mqgkFlraYxufiKs8DE/kDbAzzwjTzHBq/BlI7gMydxzR/B6Jsh7ssY/gPFZyaJDf2DkDKWxfBMrx3frvBx7I9BSQtxQmawc9ChK9Ezn5TdHrfAfk1m/r5wlE56SJPCXQ1Dq2gFqyrYdSZvhL47wIDAQAB\n-----END PUBLIC KEY-----\n'}} 2024-07-07 22:49:21.145 DEBUG (MainThread) [kasa.aestransport] Device responded with: {'error_code': 0, 'result': {'key': 'stGIAOquGX7mvHH7DoXR0k+uO1l5Q0AZvhV8C289t0gyeX9qj4GpZqXjJSDVMRCCmnedRHlMKVgrVwloKkOKf4GYecbmWOp0RDmwxYnUMZoOjs2ZlXWkH49/GLJIBfuuVHaJ8pk6Ia//pZnVH84J3Z2J7tuBsBg0ke9lhEdHjAc='}} 2024-07-07 22:49:21.199 DEBUG (MainThread) [kasa.aestransport] Handshake with 192.168.178.107 complete 2024-07-07 22:49:21.399 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:21.678 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=3C474B7438450B543A442B443344B344 2024-07-07 22:49:21.948 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=3C474B7438450B543A442B443344B344 2024-07-07 22:49:21.996 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=3C474B7438450B543A442B443344B344 2024-07-07 22:49:22.263 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=3C474B7438450B543A442B443344B344 2024-07-07 22:49:22.300 DEBUG (MainThread) [kasa.smartprotocol] Giving up on 192.168.178.107 after 3 retries 2024-07-07 22:49:24.842 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733054251995136,"request_time_milis":1720385364842,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:24.847 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:24.971 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066536, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733054251995136,"request_time_milis":1720385364842,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:24.979 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177193, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -68, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:24', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:24.987 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177193, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -68, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:24', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:24.988 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733054864363520,"request_time_milis":1720385364988,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:24.989 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:25.140 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066535, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733054864363520,"request_time_milis":1720385364988,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:25.148 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385365}}]}} 2024-07-07 22:49:25.154 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385365}}]}} 2024-07-07 22:49:25.155 DEBUG (MainThread) [kasa.smart.smartdevice] Got an update: {'get_auto_off_config': {'enable': False, 'delay_min': 120}, 'get_connect_cloud_state': {'status': 0}, 'get_device_info': {'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_ver': '1.0', 'type': 'SMART.TAPOPLUG', 'model': 'P110', 'mac': 'E4-FA-C4-19-41-15', 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'fw_id': '00000000000000000000000000000000', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'ip': '192.168.178.108', 'time_diff': 60, 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'rssi': -68, 'signal_level': 2, 'auto_off_status': 'off', 'auto_off_remain_time': 0, 'latitude': 491824, 'longitude': 91218, 'lang': 'de_DE', 'avatar': 'plug', 'region': 'Europe/Berlin', 'specs': '', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'has_set_location_info': True, 'device_on': True, 'on_time': 6177193, 'default_states': {'type': 'last_states', 'state': {}}, 'overheated': False, 'power_protection_status': 'normal', 'overcurrent_status': 'normal'}, 'get_device_usage': {'time_usage': {'today': 1369, 'past7': 10009, 'past30': 43129}, 'power_usage': {'today': 310, 'past7': 2961, 'past30': 11573}, 'saved_power': {'today': 1059, 'past7': 7048, 'past30': 31556}}, 'get_energy_usage': {'today_runtime': 1369, 'month_runtime': 10009, 'today_energy': 310, 'month_energy': 2961, 'local_time': '2024-07-07 22:49:24', 'electricity_charge': [0, 0, 0], 'current_power': 0}, 'get_current_power': {'current_power': 0}, 'get_latest_fw': {'type': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'release_date': '', 'release_note': '', 'fw_size': 0, 'hw_id': '', 'oem_id': '', 'need_to_upgrade': False}, 'get_auto_update_info': {'enable': True, 'time': 180, 'random_range': 120}, 'get_led_info': {'night_mode': {'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'end_time': 329, 'sunrise_offset': 0, 'sunset_offset': 0}, 'led_status': True, 'led_rule': 'always'}, 'get_device_time': {'time_diff': 60, 'timestamp': 1720385365, 'region': 'Europe/Berlin'}} 2024-07-07 22:49:25.156 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.178.108 data in 0.314 seconds (success: True) 2024-07-07 22:49:29.852 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733075265458176,"request_time_milis":1720385369852,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:29.867 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:29.993 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066534, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733075265458176,"request_time_milis":1720385369852,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:30.002 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177198, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -67, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:29', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:30.011 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177198, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -67, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:29', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:30.012 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733075936546816,"request_time_milis":1720385370012,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:30.018 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:30.250 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066533, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733075936546816,"request_time_milis":1720385370012,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:30.257 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385370}}]}} 2024-07-07 22:49:30.262 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385370}}]}} 2024-07-07 22:49:30.262 DEBUG (MainThread) [kasa.smart.smartdevice] Got an update: {'get_auto_off_config': {'enable': False, 'delay_min': 120}, 'get_connect_cloud_state': {'status': 0}, 'get_device_info': {'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_ver': '1.0', 'type': 'SMART.TAPOPLUG', 'model': 'P110', 'mac': 'E4-FA-C4-19-41-15', 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'fw_id': '00000000000000000000000000000000', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'ip': '192.168.178.108', 'time_diff': 60, 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'rssi': -67, 'signal_level': 2, 'auto_off_status': 'off', 'auto_off_remain_time': 0, 'latitude': 491824, 'longitude': 91218, 'lang': 'de_DE', 'avatar': 'plug', 'region': 'Europe/Berlin', 'specs': '', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'has_set_location_info': True, 'device_on': True, 'on_time': 6177198, 'default_states': {'type': 'last_states', 'state': {}}, 'overheated': False, 'power_protection_status': 'normal', 'overcurrent_status': 'normal'}, 'get_device_usage': {'time_usage': {'today': 1369, 'past7': 10009, 'past30': 43129}, 'power_usage': {'today': 310, 'past7': 2961, 'past30': 11573}, 'saved_power': {'today': 1059, 'past7': 7048, 'past30': 31556}}, 'get_energy_usage': {'today_runtime': 1369, 'month_runtime': 10009, 'today_energy': 310, 'month_energy': 2961, 'local_time': '2024-07-07 22:49:29', 'electricity_charge': [0, 0, 0], 'current_power': 0}, 'get_current_power': {'current_power': 0}, 'get_latest_fw': {'type': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'release_date': '', 'release_note': '', 'fw_size': 0, 'hw_id': '', 'oem_id': '', 'need_to_upgrade': False}, 'get_auto_update_info': {'enable': True, 'time': 180, 'random_range': 120}, 'get_led_info': {'night_mode': {'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'end_time': 329, 'sunrise_offset': 0, 'sunset_offset': 0}, 'led_status': True, 'led_rule': 'always'}, 'get_device_time': {'time_diff': 60, 'timestamp': 1720385370, 'region': 'Europe/Berlin'}} 2024-07-07 22:49:30.262 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.178.108 data in 0.411 seconds (success: True) 2024-07-07 22:49:32.804 DEBUG (MainThread) [kasa.aestransport] Created AES transport for 192.168.178.107 2024-07-07 22:49:32.805 DEBUG (MainThread) [kasa.device] Initializing 192.168.178.107 of type <class 'kasa.smart.smartdevice.SmartDevice'> 2024-07-07 22:49:32.807 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.107 multi-request-batch-1 >> '{"method":"multipleRequest","params":{"requests":[{"method":"component_nego","params":null},{"method":"get_device_info","params":null},{"method":"get_connect_cloud_state","params":null}]},"requestID":1259733087659626496,"request_time_milis":1720385372807,"terminal_uuid":"qGTIejDneI9rP5kEeME6Zg=="}' 2024-07-07 22:49:32.808 DEBUG (MainThread) [kasa.aestransport] Will perform handshaking... 2024-07-07 22:49:32.808 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:32.816 DEBUG (MainThread) [kasa.aestransport] Generating keypair 2024-07-07 22:49:32.901 DEBUG (MainThread) [kasa.aestransport] Handshake params: {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCx7i5C2DzmNHGj6tEIqL95A+gkm/laMYCjfX/eaxqW+W+oC2vvUJ7MO80DO2SnFq+7+ePyKFL6giEEyqA2lNc5Y2Jgrn9rnMj+x8E55NFbLWMC+etEi3Q7VkMjNKq9+TgumhHqzsoqxbCQPzo6GmwRe9QvCwLcNh+bHiZBj9ywOQIDAQAB\n-----END PUBLIC KEY-----\n'} 2024-07-07 22:49:32.902 DEBUG (MainThread) [kasa.aestransport] Request {'method': 'handshake', 'params': {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCx7i5C2DzmNHGj6tEIqL95A+gkm/laMYCjfX/eaxqW+W+oC2vvUJ7MO80DO2SnFq+7+ePyKFL6giEEyqA2lNc5Y2Jgrn9rnMj+x8E55NFbLWMC+etEi3Q7VkMjNKq9+TgumhHqzsoqxbCQPzo6GmwRe9QvCwLcNh+bHiZBj9ywOQIDAQAB\n-----END PUBLIC KEY-----\n'}} 2024-07-07 22:49:32.920 DEBUG (MainThread) [kasa.aestransport] Device responded with: {'error_code': 0, 'result': {'key': 'i9Btej1af1ft9arXtNiwitvOLB32LXXKK41vyKAuRezgglckA5ay52EReHkArUPCDfKUXft6fVqcJERGVE3X7j9V1aZLXcj/dMyKZ5DTMHZ8mL990gnolQLG0UdIKo/xoQmiT+wEoRac1CoKKsYk6N08Pq5D2wwz3wfYVDkdPWw='}} 2024-07-07 22:49:32.979 DEBUG (MainThread) [kasa.aestransport] Handshake with 192.168.178.107 complete 2024-07-07 22:49:32.979 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:32.997 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=B07FE7789D083E0B033BDA3A4C2A202A 2024-07-07 22:49:33.000 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.107 multi-request-batch-1 >> '{"method":"multipleRequest","params":{"requests":[{"method":"component_nego","params":null},{"method":"get_device_info","params":null},{"method":"get_connect_cloud_state","params":null}]},"requestID":1259733088469127168,"request_time_milis":1720385373000,"terminal_uuid":"qGTIejDneI9rP5kEeME6Zg=="}' 2024-07-07 22:49:33.251 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=B07FE7789D083E0B033BDA3A4C2A202A 2024-07-07 22:49:33.275 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.107 multi-request-batch-1 << {'error_code': -1003} 2024-07-07 22:49:34.277 DEBUG (MainThread) [kasa.aestransport] Will perform handshaking... 2024-07-07 22:49:34.278 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:34.284 DEBUG (MainThread) [kasa.aestransport] Generating keypair 2024-07-07 22:49:34.341 DEBUG (MainThread) [kasa.aestransport] Handshake params: {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM9cEXZhTiNk77Zn+5T4h0PqsRRmZRy+BBtRDftxNrKk6klhWmR2ReKu3we8XfjDISKxW8yDAE9CdOtije0v4TUWWulCwaTDdb92wjbb51vL9auq8Rf77Jk2PotHcDZoJyHwuvy64liW8+sEX8QXUPw06tMfd8YRtZWxXL4hpiZwIDAQAB\n-----END PUBLIC KEY-----\n'} 2024-07-07 22:49:34.341 DEBUG (MainThread) [kasa.aestransport] Request {'method': 'handshake', 'params': {'key': '-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDM9cEXZhTiNk77Zn+5T4h0PqsRRmZRy+BBtRDftxNrKk6klhWmR2ReKu3we8XfjDISKxW8yDAE9CdOtije0v4TUWWulCwaTDdb92wjbb51vL9auq8Rf77Jk2PotHcDZoJyHwuvy64liW8+sEX8QXUPw06tMfd8YRtZWxXL4hpiZwIDAQAB\n-----END PUBLIC KEY-----\n'}} 2024-07-07 22:49:34.359 DEBUG (MainThread) [kasa.aestransport] Device responded with: {'error_code': 0, 'result': {'key': 'leu4+MO4E1xIjHSSIdSGz3KE1cpXYSBd7HCaBiknnMevDAszmfdtKNoGnzedwR2gygSbAIMSC/BPmirAAwQUlyLxDZLW7RhEfmqiTWnhoiQihlh0JYHXq6jIKes9a8dDdkkPXB3dXARWMntDAOpF7VUb0XBZi+Nzts6EyJOiZNA='}} 2024-07-07 22:49:34.414 DEBUG (MainThread) [kasa.aestransport] Handshake with 192.168.178.107 complete 2024-07-07 22:49:34.610 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app 2024-07-07 22:49:34.843 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733096199229440,"request_time_milis":1720385374844,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:34.845 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:34.882 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=80A61EA1F2D135D243E220E31BF3AAF3 2024-07-07 22:49:34.957 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066532, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_auto_off_config","params":{"start_index":0}},{"method":"get_connect_cloud_state","params":null},{"method":"get_device_info","params":null},{"method":"get_device_usage","params":null},{"method":"get_energy_usage","params":null}]},"requestID":1259733096199229440,"request_time_milis":1720385374844,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:34.965 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177203, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -68, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:34', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:34.974 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-1 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_auto_off_config', 'result': {'delay_min': 120, 'enable': False}}, {'error_code': 0, 'method': 'get_connect_cloud_state', 'result': {'status': 0}}, {'error_code': 0, 'method': 'get_device_info', 'result': {'auto_off_remain_time': 0, 'auto_off_status': 'off', 'avatar': 'plug', 'default_states': {'state': {}, 'type': 'last_states'}, 'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'device_on': True, 'fw_id': '00000000000000000000000000000000', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'has_set_location_info': True, 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'hw_ver': '1.0', 'ip': '192.168.178.108', 'lang': 'de_DE', 'latitude': 491824, 'longitude': 91218, 'mac': 'E4-FA-C4-19-41-15', 'model': 'P110', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'on_time': 6177203, 'overcurrent_status': 'normal', 'overheated': False, 'power_protection_status': 'normal', 'region': 'Europe/Berlin', 'rssi': -68, 'signal_level': 2, 'specs': '', 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'time_diff': 60, 'type': 'SMART.TAPOPLUG'}}, {'error_code': 0, 'method': 'get_device_usage', 'result': {'power_usage': {'past30': 11573, 'past7': 2961, 'today': 310}, 'saved_power': {'past30': 31556, 'past7': 7048, 'today': 1059}, 'time_usage': {'past30': 43129, 'past7': 10009, 'today': 1369}}}, {'error_code': 0, 'method': 'get_energy_usage', 'result': {'current_power': 0, 'electricity_charge': [0, 0, 0], 'local_time': '2024-07-07 22:49:34', 'month_energy': 2961, 'month_runtime': 10009, 'today_energy': 310, 'today_runtime': 1369}}]}} 2024-07-07 22:49:34.974 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 >> '{"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733096752877568,"request_time_milis":1720385374975,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="}' 2024-07-07 22:49:34.976 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.108:80/app/request 2024-07-07 22:49:35.151 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=80A61EA1F2D135D243E220E31BF3AAF3 2024-07-07 22:49:35.163 DEBUG (MainThread) [kasa.klaptransport] Query posted Host is 192.168.178.108, Sequence is -1769066531, Response status is 200, Request was {"method":"multipleRequest","params":{"requests":[{"method":"get_current_power","params":null},{"method":"get_latest_fw","params":null},{"method":"get_auto_update_info","params":null},{"method":"get_led_info","params":{"led_rule":null}},{"method":"get_device_time","params":null}]},"requestID":1259733096752877568,"request_time_milis":1720385374975,"terminal_uuid":"+qSo7kWXLAkU5bFFPky8Pw=="} 2024-07-07 22:49:35.168 DEBUG (MainThread) [kasa.klaptransport] 192.168.178.108 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385375}}]}} 2024-07-07 22:49:35.172 DEBUG (MainThread) [kasa.smartprotocol] 192.168.178.108 multi-request-batch-6 << {'error_code': 0, 'result': {'responses': [{'error_code': 0, 'method': 'get_current_power', 'result': {'current_power': 0}}, {'error_code': 0, 'method': 'get_latest_fw', 'result': {'fw_size': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_id': '', 'need_to_upgrade': False, 'oem_id': '', 'release_date': '', 'release_note': '', 'type': 0}}, {'error_code': 0, 'method': 'get_auto_update_info', 'result': {'enable': True, 'random_range': 120, 'time': 180}}, {'error_code': 0, 'method': 'get_led_info', 'result': {'led_rule': 'always', 'led_status': True, 'night_mode': {'end_time': 329, 'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'sunrise_offset': 0, 'sunset_offset': 0}}}, {'error_code': 0, 'method': 'get_device_time', 'result': {'region': 'Europe/Berlin', 'time_diff': 60, 'timestamp': 1720385375}}]}} 2024-07-07 22:49:35.187 DEBUG (MainThread) [kasa.smart.smartdevice] Got an update: {'get_auto_off_config': {'enable': False, 'delay_min': 120}, 'get_connect_cloud_state': {'status': 0}, 'get_device_info': {'device_id': '802255AD15AC842EB0CFFE060DDC4F0C22160711', 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'hw_ver': '1.0', 'type': 'SMART.TAPOPLUG', 'model': 'P110', 'mac': 'E4-FA-C4-19-41-15', 'hw_id': '2FB30EF5BF920C44099401D396C6B55B', 'fw_id': '00000000000000000000000000000000', 'oem_id': '18BDC6C734AF8407B3EF871EACFCECF5', 'ip': '192.168.178.108', 'time_diff': 60, 'ssid': 'RlJJVFohQm94IDU0OTAgWFE=', 'rssi': -68, 'signal_level': 2, 'auto_off_status': 'off', 'auto_off_remain_time': 0, 'latitude': 491824, 'longitude': 91218, 'lang': 'de_DE', 'avatar': 'plug', 'region': 'Europe/Berlin', 'specs': '', 'nickname': 'VGFwbyBQMTEwIFRyb2NrbmVy', 'has_set_location_info': True, 'device_on': True, 'on_time': 6177203, 'default_states': {'type': 'last_states', 'state': {}}, 'overheated': False, 'power_protection_status': 'normal', 'overcurrent_status': 'normal'}, 'get_device_usage': {'time_usage': {'today': 1369, 'past7': 10009, 'past30': 43129}, 'power_usage': {'today': 310, 'past7': 2961, 'past30': 11573}, 'saved_power': {'today': 1059, 'past7': 7048, 'past30': 31556}}, 'get_energy_usage': {'today_runtime': 1369, 'month_runtime': 10009, 'today_energy': 310, 'month_energy': 2961, 'local_time': '2024-07-07 22:49:34', 'electricity_charge': [0, 0, 0], 'current_power': 0}, 'get_current_power': {'current_power': 0}, 'get_latest_fw': {'type': 0, 'fw_ver': '1.3.0 Build 230905 Rel.152200', 'release_date': '', 'release_note': '', 'fw_size': 0, 'hw_id': '', 'oem_id': '', 'need_to_upgrade': False}, 'get_auto_update_info': {'enable': True, 'time': 180, 'random_range': 120}, 'get_led_info': {'night_mode': {'night_mode_type': 'sunrise_sunset', 'start_time': 1289, 'end_time': 329, 'sunrise_offset': 0, 'sunset_offset': 0}, 'led_status': True, 'led_rule': 'always'}, 'get_device_time': {'time_diff': 60, 'timestamp': 1720385375, 'region': 'Europe/Berlin'}} 2024-07-07 22:49:35.188 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.178.108 data in 0.345 seconds (success: True) 2024-07-07 22:49:35.205 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=80A61EA1F2D135D243E220E31BF3AAF3 2024-07-07 22:49:35.484 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.178.107:80/app?token=80A61EA1F2D135D243E220E31BF3AAF3 2024-07-07 22:49:35.521 DEBUG (MainThread) [kasa.smartprotocol] Giving up on 192.168.178.107 after 3 retries

manuelcoders commented 2 months ago

Same here

Darren-GZ commented 2 months ago

My P100s H/W v1.20, and P110s - H/W v1.0, are both exhibiting this behaviour too. I also have P100s H/W v2.0 which are (so far) unaffected.

When the behaviour started I noted that they were also showing a firmware update was available (to 1.5.5 Build 20230927 for the P100s) which I applied in an attempt to fix things. I managed to get this applied to most of the devices; one refuses - I suspect it's crashing and dropping off the network before it has a chance to complete downloading the newer firmware.

Updating the firmware does lead to another problem though - HA shows the upgraded devices are Unable to complete handshake: tapo-2.my.internal.domain: TRANSPORT_UNKNOWN_CREDENTIALS_ERROR(1003) (error_code=TRANSPORT_UNKNOWN_CREDENTIALS_ERROR) which appears to be #121331. Following the advice there of deleting the config for the device and re-adding it looks to have worked.

For people still seeing this issue, I'd recommend trying the following:

This should hopefully be the important steps from everything I tried to get the devices working as expected again, but in a more reliable order.

Devs - I still have a P100 v1.20 in the broken state that I've swapped out for a v2.0, if you'd like any more logs, or any experiments made before I try to fix it...?

sdb9696 commented 2 months ago

Hi @gridzero, thanks for the info and the offer. Can you hmu on discord, username is the same as here?

sdb9696 commented 2 months ago

Here's my TP-Link integration debug log:

@Eisbaer2 which device model is this log for?

Eisbaer2 commented 2 months ago

Here's my TP-Link integration debug log:

@Eisbaer2 which device model is this log for?

Tapo P100 (V1.0)

On the other side my Tapo P110 works without any problems.

Clutch57 commented 2 months ago

Enabled debug logging in the TP-Link Smart Home integration, power cycled my three p100's and waited until they HA lost them. I redacted log/lat. Wonder why bz2 isn't supported on github.

home-assistant_tplink_2024-07-08T17-06-38.417Z-1.log.gz

sdb9696 commented 2 months ago

That's really helpful thanks @Clutch57, I think I can see what's going on here. hmu on discord if you're open to testing a fix sometime tomorrow.

Clutch57 commented 2 months ago

That's really helpful thanks @Clutch57, I think I can see what's going on here. hmu on discord if you're open to testing a fix sometime tomorrow.

I took a chance and sent you a friend request from discord, I really don't know how it works very well. Not the same username but starts with Sz.

I'm willing to test.

sdb9696 commented 2 months ago

So this issue will be fixed in the next HA release scheduled for tomorrow.

One of the underlying causes was due to a bug in the P100 firmware causing it to crash when HA reads the state the Led switch after several times (usually crashes after 40 mins). It seems this particular cause can actually be fixed by simply going into the device in the Tapo app and changing the "Led status" from Auto to Off, then back again, and power cycling.

Many thanks to @Clutch57 for all the help with testing the fix over the last few days! :muscle: :rocket:

Eisbaer2 commented 2 months ago

Works great again with the update 🙂