Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TP-Link KS255 'Unknown Error Occurred' #121272

Closed
jonhaber82 opened this issue Jul 5, 2024 · 4 comments
Closed

TP-Link KS255 'Unknown Error Occurred' #121272

jonhaber82 opened this issue Jul 5, 2024 · 4 comments

Comments

@jonhaber82
Copy link

The problem

When attempting to have my KS255 switches added I get an 'Unknown Error Occurred' on the username and password entry screen after attempting to login.

Screenshot_2024-07-04_at_7_20_55 PM

What version of Home Assistant Core has the issue?

core-2024.7.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?

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tplink/config_flow.py", line 276, in async_step_user_auth_confirm
    device = await self._async_try_connect(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tplink/config_flow.py", line 425, in _async_try_connect
    self._discovered_device = await Device.connect(config=config)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device.py", line 233, in connect
    return await connect(host=host, config=config)  # type: ignore[arg-type]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 71, in connect
    return await _connect(config, protocol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 110, in _connect
    await device.update()
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 181, in update
    module._post_update_hook()
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/modules/lightpreset.py", line 39, in _post_update_hook
    if preset_states := self.data.get(state_key):
                        ^^^^^^^^^^^^^
AttributeError: 'SmartErrorCode' object has no attribute 'get'
2024-07-04 19:12:28.663 DEBUG (MainThread) [kasa.smartprotocol] 192.168.1.24 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":1258727192293150720,"request_time_milis":1720145548663,"terminal_uuid":"8AuSlV+LuoRrCXPnkpCVQw=="}'
2024-07-04 19:12:28.668 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.1.24:80/app?token=208B5B13930CD82B94D5502ACD56512E
2024-07-04 19:12:28.858 DEBUG (MainThread) [kasa.smartprotocol] 192.168.1.24 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': 'sound',
                                      'default_states': {'state': {},
                                                         'type': 'last_states'},
                                      'device_id': '803AFFB2503669F826E28997AA5D8A6D21DDECDF',
                                      'device_on': True,
                                      'fw_id': '00000000000000000000000000000000',
                                      'fw_ver': '1.2.2 Build 240305 Rel.095128',
                                      'has_set_location_info': True,
                                      'hw_id': '3F38D2C960F5B2D286B040900623186A',
                                      'hw_ver': '1.0',
                                      'ip': '192.168.1.24',
                                      'lang': 'en_US',
                                      'latitude': 474195,
                                      'longitude': -1223217,
                                      'mac': 'F0-A7-31-04-DA-AC',
                                      'model': 'KP125M',
                                      'nickname': 'QUMgUGx1Zw==',
                                      'oem_id': '919CF44D95D5EB17DB1D00119A3A0093',
                                      'on_time': 543928,
                                      'overcurrent_status': 'normal',
                                      'overheat_status': 'normal',
                                      'power_protection_status': 'normal',
                                      'region': 'America/Los_Angeles',
                                      'rssi': -43,
                                      'signal_level': 3,
                                      'specs': '',
                                      'ssid': 'YWFhaGVsbG8=',
                                      'time_diff': -480,
                                      'type': 'SMART.KASAPLUG'}},
                          {'error_code': 0,
                           'method': 'get_device_usage',
                           'result': {'power_usage': {'past30': 39084,
                                                      'past7': 13329,
                                                      'today': 1781},
                                      'saved_power': {'past30': 0,
                                                      'past7': 0,
                                                      'today': 0},
                                      'time_usage': {'past30': 37574,
                                                     'past7': 9792,
                                                     'today': 1152}}},
                          {'error_code': 0,
                           'method': 'get_energy_usage',
                           'result': {'current_power': 1415,
                                      'electricity_charge': [0, 0, 0],
                                      'local_time': '2024-07-04 19:12:27',
                                      'month_energy': 8044,
                                      'month_runtime': 5472,
                                      'today_energy': 1781,
                                      'today_runtime': 1152}}]}}
2024-07-04 19:12:28.858 DEBUG (MainThread) [kasa.smartprotocol] 192.168.1.24 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":1258727193115234304,"request_time_milis":1720145548859,"terminal_uuid":"8AuSlV+LuoRrCXPnkpCVQw=="}'
2024-07-04 19:12:28.859 DEBUG (MainThread) [kasa.httpclient] Posting to http://192.168.1.24:80/app?token=208B5B13930CD82B94D5502ACD56512E
2024-07-04 19:12:29.028 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Schedule (schedule) for 192.168.1.6>: {'schedule': {'get_rules': None, 'get_next_action': None}}
2024-07-04 19:12:29.029 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Usage (schedule) for 192.168.1.6>: {'schedule': {'get_realtime': None, 'get_daystat': {'year': 2024, 'month': 7}, 'get_monthstat': {'year': 2024}}}
2024-07-04 19:12:29.029 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Antitheft (anti_theft) for 192.168.1.6>: {'anti_theft': {'get_rules': None, 'get_next_action': None}}
2024-07-04 19:12:29.030 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Time (time) for 192.168.1.6>: {'time': {'get_time': None, 'get_timezone': None}}
2024-07-04 19:12:29.030 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Cloud (cnCloud) for 192.168.1.6>: {'cnCloud': {'get_info': None}}
2024-07-04 19:12:29.030 DEBUG (MainThread) [kasa.iot.iotdevice] Adding query for <Module Led (system) for 192.168.1.6>: {}
2024-07-04 19:12:29.031 DEBUG (MainThread) [kasa.xortransport] 192.168.1.6 >> {"system":{"get_sysinfo":null},"schedule":{"get_rules":null,"get_next_action":null,"get_realtime":null,"get_daystat":{"year":2024,"month":7},"get_monthstat":{"year":2024}},"anti_theft":{"get_rules":null,"get_next_action":null},"time":{"get_time":null,"get_timezone":null},"cnCloud":{"get_info":null}}
2024-07-04 19:12:29.044 DEBUG (MainThread) [kasa.smartprotocol] 192.168.1.24 multi-request-batch-6 << {'error_code': 0,
 'result': {'responses': [{'error_code': 0,
                           'method': 'get_current_power',
                           'result': {'current_power': 1}},
                          {'error_code': 0,
                           'method': 'get_latest_fw',
                           'result': {'fw_size': 0,
                                      'fw_ver': '1.2.2 Build 240305 Rel.095128',
                                      'hw_id': '',
                                      'need_to_upgrade': False,
                                      'oem_id': '',
                                      'release_date': '',
                                      'release_note': '',
                                      'type': 0}},
                          {'error_code': 0,
                           'method': 'get_auto_update_info',
                           'result': {'enable': False,
                                      'random_range': 120,
                                      'time': 180}},
                          {'error_code': 0,
                           'method': 'get_led_info',
                           'result': {'bri_config': {'bri_type': 'overall',
                                                     'overall_bri': 50},
                                      'led_rule': 'always',
                                      'led_status': True,
                                      'night_mode': {'end_time': 320,
                                                     'night_mode_type': 'sunrise_sunset',
                                                     'start_time': 1269,
                                                     'sunrise_offset': 0,
                                                     'sunset_offset': 0}}},
                          {'error_code': 0,
                           'method': 'get_device_time',
                           'result': {'region': 'America/Los_Angeles',
                                      'time_diff': -480,
                                      'timestamp': 1720145548}}]}}
2024-07-04 19:12:29.044 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': '803AFFB2503669F826E28997AA5D8A6D21DDECDF', 'fw_ver': '1.2.2 Build 240305 Rel.095128', 'hw_ver': '1.0', 'type': 'SMART.KASAPLUG', 'model': 'KP125M', 'mac': 'F0-A7-31-04-DA-AC', 'hw_id': '3F38D2C960F5B2D286B040900623186A', 'fw_id': '00000000000000000000000000000000', 'oem_id': '919CF44D95D5EB17DB1D00119A3A0093', 'ip': '192.168.1.24', 'time_diff': -480, 'ssid': 'YWFhaGVsbG8=', 'rssi': -43, 'signal_level': 3, 'auto_off_status': 'off', 'auto_off_remain_time': 0, 'longitude': -1223217, 'latitude': 474195, 'lang': 'en_US', 'avatar': 'sound', 'region': 'America/Los_Angeles', 'specs': '', 'nickname': 'QUMgUGx1Zw==', 'has_set_location_info': True, 'device_on': True, 'on_time': 543928, 'default_states': {'type': 'last_states', 'state': {}}, 'overheat_status': 'normal', 'power_protection_status': 'normal', 'overcurrent_status': 'normal'}, 'get_device_usage': {'time_usage': {'today': 1152, 'past7': 9792, 'past30': 37574}, 'power_usage': {'today': 1781, 'past7': 13329, 'past30': 39084}, 'saved_power': {'today': 0, 'past7': 0, 'past30': 0}}, 'get_energy_usage': {'today_runtime': 1152, 'month_runtime': 5472, 'today_energy': 1781, 'month_energy': 8044, 'local_time': '2024-07-04 19:12:27', 'electricity_charge': [0, 0, 0], 'current_power': 1415}, 'get_current_power': {'current_power': 1}, 'get_latest_fw': {'type': 0, 'fw_ver': '1.2.2 Build 240305 Rel.095128', 'release_date': '', 'release_note': '', 'fw_size': 0, 'hw_id': '', 'oem_id': '', 'need_to_upgrade': False}, 'get_auto_update_info': {'enable': False, 'time': 180, 'random_range': 120}, 'get_led_info': {'night_mode': {'night_mode_type': 'sunrise_sunset', 'start_time': 1269, 'end_time': 320, 'sunrise_offset': 0, 'sunset_offset': 0}, 'led_status': True, 'led_rule': 'always', 'bri_config': {'bri_type': 'overall', 'overall_bri': 50}}, 'get_device_time': {'time_diff': -480, 'timestamp': 1720145548, 'region': 'America/Los_Angeles'}}
2024-07-04 19:12:29.045 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.1.24 data in 0.382 seconds (success: True)
2024-07-04 19:12:29.093 DEBUG (MainThread) [kasa.xortransport] 192.168.1.6 << {'anti_theft': {'get_next_action': {'err_code': -2,
                                    'err_msg': 'member not support'},
                'get_rules': {'enable': 0,
                              'err_code': 0,
                              'rule_list': [],
                              'version': 2}},
 'cnCloud': {'get_info': {'binded': 1,
                          'cld_connection': 1,
                          'err_code': 0,
                          'fwDlPage': '',
                          'fwNotifyType': -1,
                          'illegalType': 0,
                          'server': 'n-devs.tplinkcloud.com',
                          'stopConnect': 0,
                          'tcspInfo': '',
                          'tcspStatus': 1,
                          'username': '[email protected]'}},
 'schedule': {'get_daystat': {'day_list': [{'day': 4,
                                            'month': 7,
                                            'time': 0,
                                            'year': 2024}],
                              'err_code': 0},
              'get_monthstat': {'err_code': 0,
                                'month_list': [{'month': 6,
                                                'time': 3694,
                                                'year': 2024},
                                               {'month': 7,
                                                'time': 0,
                                                'year': 2024}]},
              'get_next_action': {'err_code': 0, 'type': -1},
              'get_realtime': {'err_code': -2, 'err_msg': 'member not support'},
              'get_rules': {'enable': 1,
                            'err_code': 0,
                            'rule_list': [],
                            'version': 2}},
 'system': {'get_sysinfo': {'active_mode': 'none',
                            'alias': 'overhead light',
                            'dev_name': 'Smart Wi-Fi Plug Mini',
                            'deviceId': '8006F2B90F113225F3CD94079822E20E1E7A3BFA',
                            'err_code': 0,
                            'feature': 'TIM',
                            'hwId': 'B25CBC5351DD892EA69AB42199F59E41',
                            'hw_ver': '5.0',
                            'icon_hash': '',
                            'latitude_i': -1879048193,
                            'led_off': 1,
                            'longitude_i': -1879048193,
                            'mac': 'C0:06:C3:3D:81:EC',
                            'mic_type': 'IOT.SMARTPLUGSWITCH',
                            'model': 'HS103(US)',
                            'next_action': {'type': -1},
                            'obd_src': 'tplink',
                            'oemId': '211C91F3C6FA93568D818524FE170CEC',
                            'on_time': 0,
                            'relay_state': 0,
                            'rssi': -38,
                            'status': 'new',
                            'sw_ver': '1.0.13 Build 240117 Rel.162355',
                            'updating': 0}},
 'time': {'get_time': {'err_code': 0,
                       'hour': 19,
                       'mday': 4,
                       'min': 12,
                       'month': 7,
                       'sec': 28,
                       'year': 2024},
          'get_timezone': {'err_code': 0, 'index': 6}}}
2024-07-04 19:12:29.093 DEBUG (MainThread) [homeassistant.components.tplink.coordinator] Finished fetching 192.168.1.6 data in 0.065 seconds (success: True)x

Additional information

Was working in the previous version of core.

@home-assistant
Copy link

home-assistant bot commented Jul 5, 2024

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)

@sdb9696
Copy link
Contributor

sdb9696 commented Jul 5, 2024

This is a duplicate of #121119. I'll keep the issue open until the HA patch ships as we keep getting dupes on this.

@sdb9696
Copy link
Contributor

sdb9696 commented Jul 5, 2024

Now fixed in 2024.7.1

@sdb9696
Copy link
Contributor

sdb9696 commented Jul 5, 2024

@home-assistant close

@home-assistant home-assistant bot closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants