[Custom Component] TP-Link Router Integration

v1.11.0 Released

Changelog

  • Added Deco M4 support
  • Added Archer VR900v and TL-MR105 support

Deco M4 support allows to support other similar Deco routers. If you have any of them please try the integration and let me know

1 Like

Please try the new version. It should support your Deco XE75

Agree - would be great to see support for enabling parental controls for users configured in the ‘Parental Controls’ section as per here: How to Setup Parental Controls using the TP-Link Tether App

1 Like

Archer AXE75 v1.0 user here and your integration was working great! But it made the tether app and web admin useless because every time the integration polled the router it kicked me from those interfaces. Is it possible to use the integration without that happening, somehow?

Unfortunately, Tp-Link only supports upto 1 user logged in at a time (for security reasons, apparently).

If your router supports creating manager account. Create it for using in app and web. But leave main account for the integration

Thanks a lot for enhancing the integration for the DECO’s - mine is the Deco XE75 mesh system.
I tried the new version, and the good news is that the sensors seem to work, and the switches’s state representation seems to be accurate. Operating the switches however always fails, with error messages like :
2024-03-25 15:56:16.548 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139708276823360] TplinkRouter - TPLinkDecoClient - An unknown response - Expecting value: line 1 column 1 (char 0); Request admin/wireless?form=wlan - Response rFN9Gn0FqLzi3TXU+OlsufbCDn3IGhPzdHttFyFnmSjezEH2KkvkZLqjRMfI8/UsAaUF4SOxifA7zjZF2/+dXCGwXGNcHvK20hXQz9hiHh4i3Cam/x8p5pSh/CfxEMU2tAQtF/hxCjLjo/xagiGnCkmOu322VHHGyKU+hpxydJ9sADBT5PJUvJPFLQpF03xCwiThqxN0D5b5/fGR9GWNgwuByGPmo8Ea2R6QgXjrxy9mbMqzIIn+bHm1UcOce6Lkurv2C2oWNbL85O8aPVj6fmcfcZL0/iZrHEvcRHk5d95XEtVluW/u2cfb2P2sJXYoU8rwM8HB0y+na+MG5raeINahvNiliFRTKfPfKZoKHETj27DRoCZNOdiNwLml4WIdw93OB0GyNhj9MeldT/N2S8djxPszu9c5Hj/DE/rlZ5P7EgXzXOQhndy5xgIhQMAIiiEYO4Ip80G+vDLATCzFF9EonAAdCsJ1lwljutzvvMz3M+gBw0SCaxKgcFKS1Ep2lbdjBrBl6hGadxKGxvRnF4Nz1h/ebaWUHJnKpqGaC4A=

On startup I also get :
2024-03-25 15:58:52.058 ERROR (MainThread) [custom_components.tplink_router] Error requesting tplink_router data: HTTPConnectionPool(host=‘192.168.1.1’, port=80): Read timed out.

Thank you for your work. I don’t plan to use it but I’ll leave you my tests in case they are useful.

My Deco’s I only use as access points, the main one is connected to my router and the others are connected to the main one with ethernet cable.

I can’t get the main Deco connected. In the log below you can see the error. And on the slaves it does not load the IoT wifi network as I show in the picture.
No traffic or client statistics either, only CPU and memory (second image). With TP-Link Deco integration I do get clients and traffic.


I tested with:

Deco XE75 Pro [FW 1.2.9] - Main - 192.168.0.2
Deco XE75 Pro [FW 1.2.9] - Slave via Ethernet - 192.168.0.3
Deco X50-PoE [FW 1.2.5] - Slave via PoE. 192.168.0.4

Log:


[homeassistant.config_entries] Error setting up entry http://192.168.0.2 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 47, in async_setup_entry
    firmware, status = await hass.async_add_executor_job(TPLinkRouterCoordinator.request, client, callback)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/coordinator.py", line 56, in request
    data = callback()
           ^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 43, in callback
    stat = client.get_status()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tplinkrouterc6u/client.py", line 521, in get_status
    ipaddress.IPv4Address(item['ip']),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/ipaddress.py", line 1315, in __init__
    self._ip = self._ip_int_from_string(addr_str)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/ipaddress.py", line 1198, in _ip_int_from_string
    raise AddressValueError('Address cannot be empty')
ipaddress.AddressValueError: Address cannot be empty

Log from the other two Deco:


tplinkrouterc6u.exception.ClientError: TplinkRouter - TPLinkDecoClient - An unknown response - ord() expected a character, but string of length 0 found; Request admin/wireless?form=wlan - Response {'data': ''}

[homeassistant.config_entries] Error setting up entry http://192.168.0.3 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 47, in async_setup_entry
    firmware, status = await hass.async_add_executor_job(TPLinkRouterCoordinator.request, client, callback)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

————————

data = self.request('admin/wireless?form=wlan', json.dumps({'operation': 'read'}))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tplinkrouterc6u/client.py", line 110, in request
    raise ClientError(error)
tplinkrouterc6u.exception.ClientError: TplinkRouter - TPLinkDecoClient - An unknown response - ord() expected a character, but string of length 0 found; Request admin/wireless?form=wlan - Response {'data': ''}

[homeassistant.config_entries] Error setting up entry http://192.168.0.4 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 47, in async_setup_entry
    firmware, status = await hass.async_add_executor_job(TPLinkRouterCoordinator.request, client, callback)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

@pav Could you logout from TP-Link App and try again the switches ?

@jmrplens The integration works only with the main Deco. Could you logout from TP-Link App and try again?

Also there is a strange response from you router - to fix the integration could you download the client GitHub - AlexandrErohin/TP-Link-Archer-C6U: Python package for API access and management for TP-Link Routers. See supported routers list and run this code for me and post here the result?

from tplinkrouterc6u import TPLinkDecoClient
from logging import Logger
import json

client = TPLinkDecoClient('192.168.0.1', 'your_password', logger=Logger('test'))
client.authorize()

result = client.request('admin/client?form=client_list', json.dumps(
            {"operation": "read", "params": {"device_mac": "default"}}))
print(result)

Thank you for help!

It is still not working. I have logged out and reconfigured the integration but it does not work.

With the script that you have passed me if I get the information but I have noticed that the JSON is not correctly created, the keys should be in double quotes and not in single quotes.

The JSON produced (Main Deco XE75), formatted and changed the quotes is the following:

{
    "client_list":[
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band5",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":true,
            "remain_time":-1,
            "owner_id":"",
            "client_type":"phone",
            "interface":"main"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":4,
            "down_speed":3,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":1,
            "down_speed":2,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":1,
            "down_speed":2,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":2,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":3,
            "down_speed":2,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":2,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band5",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":true,
            "remain_time":-1,
            "owner_id":"",
            "client_type":"laptop",
            "interface":"main"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":3,
            "down_speed":2,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":52,
            "down_speed":1241,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":true,
            "remain_time":-1,
            "owner_id":"",
            "client_type":"pc",
            "interface":"main"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":3,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"UNKNOWN",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":2,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":2,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"other",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":1,
            "down_speed":1,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band2_4",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"iot_device",
            "interface":"iot"
        },
        {
            "mac":"FF-FF-FF-FF-FF-FF",
            "up_speed":0,
            "down_speed":0,
            "wire_type":"wireless",
            "access_host":"1",
            "connection_type":"band5",
            "space_id":"1",
            "ip":"192.168.0.X",
            "client_mesh":true,
            "online":true,
            "name":"TheName",
            "enable_priority":false,
            "remain_time":0,
            "owner_id":"",
            "client_type":"phone",
            "interface":"main"
        }
    ]
}

@jmrplens What was the error then you tried last time?

no, how do I do that?

Sorry, i forgot.

This is the same error. It doesn’t seem to be getting a string.
If the integration is based on the Python script I tested, the error is likely to come from the single quotes, although it’s rare if it works for others.

The JSON standard only allows string (like IP address) between double quotes: JSON

Log:


2024-03-26 20:23:10.295 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry http://192.168.0.2 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 47, in async_setup_entry
    firmware, status = await hass.async_add_executor_job(TPLinkRouterCoordinator.request, client, callback)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/coordinator.py", line 56, in request
    data = callback()
           ^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 43, in callback
    stat = client.get_status()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tplinkrouterc6u/client.py", line 521, in get_status
    ipaddress.IPv4Address(item['ip']),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/ipaddress.py", line 1315, in __init__
    self._ip = self._ip_int_from_string(addr_str)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/ipaddress.py", line 1198, in _ip_int_from_string
    raise AddressValueError('Address cannot be empty')
ipaddress.AddressValueError: Address cannot be empty

Firmware Version:

1.13.2 Build 230824 Rel.74702n(4555)

Hardware Version:

Archer C64 1.0

Are u working on it support ?

@michN1 As I dont have this router - I cannot test it by my own. You may add support for your router by adding a new class for your router witch extends AbstractRouter

@hermannh Is there any errors in logs?

@jmrplens
Could you try this code please?

from tplinkrouterc6u import TPLinkDecoClient
from logging import Logger
import json

client = TPLinkDecoClient('192.168.0.2', 'your_password', logger=Logger('test'))
client.authorize()

result = client.get_status()

for item in result.devices:
    print('{} - {}'.format(item.hostname, item.ipaddr))

Error located, with the script now I get the same error I read in the HA log:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/root/test.py", line 10, in <module>
    for item in result.devices:
                ^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'devices'
root@jmrp:~# nano test.py
root@jmrp:~# python3 -m test
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/root/test.py", line 8, in <module>
    result = client.get_status()
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/tplinkrouterc6u/client.py", line 521, in get_status
    ipaddress.IPv4Address(item['ip']),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ipaddress.py", line 1315, in __init__
    self._ip = self._ip_int_from_string(addr_str)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ipaddress.py", line 1198, in _ip_int_from_string
    raise AddressValueError('Address cannot be empty')
ipaddress.AddressValueError: Address cannot be empty

Traceback detailed (with rich console):

python3 -m test
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in _run_module_as_main:198                                                                       │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │   alter_argv = True                                                                          │ │
│ │         code = <code object <module> at 0x7f79fc228dc0, file "/root/test.py", line 1>        │ │
│ │ main_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at      │ │
│ │                0x7f79fc299dd0>,                                                              │ │
│ │                │   '__spec__': ModuleSpec(name='test',                                       │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x7f79fc299dd0>, origin='/root/test.py'),                                     │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__': '/root/test.py',                                              │ │
│ │                │   '__cached__': '/root/__pycache__/test.cpython-311.pyc',                   │ │
│ │                │   'TPLinkDecoClient': <class 'tplinkrouterc6u.client.TPLinkDecoClient'>,    │ │
│ │                │   ... +4                                                                    │ │
│ │                }                                                                             │ │
│ │     mod_name = 'test'                                                                        │ │
│ │     mod_spec = ModuleSpec(name='test', loader=<_frozen_importlib_external.SourceFileLoader   │ │
│ │                object at 0x7f79fc299dd0>, origin='/root/test.py')                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in _run_code:88                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │       cached = '/root/__pycache__/test.cpython-311.pyc'                                      │ │
│ │         code = <code object <module> at 0x7f79fc228dc0, file "/root/test.py", line 1>        │ │
│ │        fname = '/root/test.py'                                                               │ │
│ │ init_globals = None                                                                          │ │
│ │       loader = <_frozen_importlib_external.SourceFileLoader object at 0x7f79fc299dd0>        │ │
│ │     mod_name = '__main__'                                                                    │ │
│ │     mod_spec = ModuleSpec(name='test', loader=<_frozen_importlib_external.SourceFileLoader   │ │
│ │                object at 0x7f79fc299dd0>, origin='/root/test.py')                            │ │
│ │     pkg_name = ''                                                                            │ │
│ │  run_globals = {                                                                             │ │
│ │                │   '__name__': '__main__',                                                   │ │
│ │                │   '__doc__': None,                                                          │ │
│ │                │   '__package__': '',                                                        │ │
│ │                │   '__loader__': <_frozen_importlib_external.SourceFileLoader object at      │ │
│ │                0x7f79fc299dd0>,                                                              │ │
│ │                │   '__spec__': ModuleSpec(name='test',                                       │ │
│ │                loader=<_frozen_importlib_external.SourceFileLoader object at                 │ │
│ │                0x7f79fc299dd0>, origin='/root/test.py'),                                     │ │
│ │                │   '__annotations__': {},                                                    │ │
│ │                │   '__builtins__': <module 'builtins' (built-in)>,                           │ │
│ │                │   '__file__': '/root/test.py',                                              │ │
│ │                │   '__cached__': '/root/__pycache__/test.cpython-311.pyc',                   │ │
│ │                │   'TPLinkDecoClient': <class 'tplinkrouterc6u.client.TPLinkDecoClient'>,    │ │
│ │                │   ... +4                                                                    │ │
│ │                }                                                                             │ │
│ │  script_name = None                                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /root/test.py:10 in <module>                                                                     │
│                                                                                                  │
│    7 client = TPLinkDecoClient('192.168.0.2', 'MyPassWord', logger=Logger('    │
│    8 client.authorize()                                                                          │
│    9                                                                                             │
│ ❱ 10 result = client.get_status()                                                                │
│   11                                                                                             │
│   12 for item in result.devices:                                                                 │
│   13 │   print('{} - {}'.format(item.hostname, item.ipaddr))                                     │
│                                                                                                  │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮        │
│ │           client = <tplinkrouterc6u.client.TPLinkDecoClient object at 0x7f79faa92f50> │        │
│ │          install = <function install at 0x7f79faa8aa20>                               │        │
│ │             json = <module 'json' from '/usr/lib/python3.11/json/__init__.py'>        │        │
│ │           Logger = <class 'logging.Logger'>                                           │        │
│ │ TPLinkDecoClient = <class 'tplinkrouterc6u.client.TPLinkDecoClient'>                  │        │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯        │
│                                                                                                  │
│ /usr/local/lib/python3.11/dist-packages/tplinkrouterc6u/client.py:521 in get_status              │
│                                                                                                  │
│    518 │   │   │   │   status.guest_clients_total += 1                                           │
│    519 │   │   │   devices.append(Device(self._map_wire_type(item),                              │
│    520 │   │   │   │   │   │   │   │     macaddress.EUI48(item['mac']),                          │
│ ❱  521 │   │   │   │   │   │   │   │     ipaddress.IPv4Address(item['ip']),                      │
│    522 │   │   │   │   │   │   │   │     base64.b64decode(item['name']).decode()))               │
│    523 │   │                                                                                     │
│    524 │   │   status.clients_total = status.wired_total + status.wifi_clients_total + status.g  │
│                                                                                                  │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮                 │
│ │    data = [                                                                  │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                     │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                       │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 1,                                             │                 │
│ │           │   │   'down_speed': 1,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                      │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   {                                                              │                 │
│ │           │   │   'mac': 'FF-FF-FF-FF-FF-FF',                                │                 │
│ │           │   │   'up_speed': 0,                                             │                 │
│ │           │   │   'down_speed': 0,                                           │                 │
│ │           │   │   'wire_type': 'wireless',                                   │                 │
│ │           │   │   'access_host': '1',                                        │                 │
│ │           │   │   'connection_type': 'band2_4',                              │                 │
│ │           │   │   'space_id': '1',                                           │                 │
│ │           │   │   'ip': '100.100.100.100',                                                  │                 │
│ │           │   │   'client_mesh': True,                                       │                 │
│ │           │   │   'online': True,                                            │                 │
│ │           │   │   ... +6                                                     │                 │
│ │           │   },                                                             │                 │
│ │           │   ... +28                                                        │                 │
│ │           ]                                                                  │                 │
│ │ devices = [                                                                  │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device(),                                                      │                 │
│ │           │   Device()                                                       │                 │
│ │           ]                                                                  │                 │
│ │ element = ''                                                                 │                 │
│ │    item = {                                                                  │                 │
│ │           │   'mac': 'FF-FF-FF-FF-FF-FF',                                    │                 │
│ │           │   'up_speed': 0,                                                 │                 │
│ │           │   'down_speed': 0,                                               │                 │
│ │           │   'wire_type': 'wireless',                                       │                 │
│ │           │   'access_host': '1',                                            │                 │
│ │           │   'connection_type': 'band2_4',                                  │                 │
│ │           │   'space_id': '1',                                               │                 │
│ │           │   'ip': '100.100.100.100',                                                      │                 │
│ │           │   'client_mesh': True,                                           │                 │
│ │           │   'online': True,                                                │                 │
│ │           │   ... +6                                                         │                 │
│ │           }                                                                  │                 │
│ │    self = <tplinkrouterc6u.client.TPLinkDecoClient object at 0x7f79faa92f50> │                 │
│ │  status = Status()                                                           │                 │
│ ╰──────────────────────────────────────────────────────────────────────────────╯                 │
│                                                                                                  │
│ /usr/lib/python3.11/ipaddress.py:1315 in __init__                                                │
│                                                                                                  │
│   1312 │   │   addr_str = str(address)                                                           │
│   1313 │   │   if '/' in addr_str:                                                               │
│   1314 │   │   │   raise AddressValueError(f"Unexpected '/' in {address!r}")                     │
│ ❱ 1315 │   │   self._ip = self._ip_int_from_string(addr_str)                                     │
│   1316 │                                                                                         │
│   1317 │   @property                                                                             │
│   1318 │   def packed(self):                                                                     │
│                                                                                                  │
│ ╭─────────────────────────────── locals ────────────────────────────────╮                        │
│ │ addr_str = ''                                                         │                        │
│ │  address = ''                                                         │                        │
│ │     self = <repr-error "'IPv4Address' object has no attribute '_ip'"> │                        │
│ ╰───────────────────────────────────────────────────────────────────────╯                        │
│                                                                                                  │
│ /usr/lib/python3.11/ipaddress.py:1198 in _ip_int_from_string                                     │
│                                                                                                  │
│   1195 │   │                                                                                     │
│   1196 │   │   """                                                                               │
│   1197 │   │   if not ip_str:                                                                    │
│ ❱ 1198 │   │   │   raise AddressValueError('Address cannot be empty')                            │
│   1199 │   │                                                                                     │
│   1200 │   │   octets = ip_str.split('.')                                                        │
│   1201 │   │   if len(octets) != 4:                                                              │
│                                                                                                  │
│ ╭───────────────── locals ─────────────────╮                                                     │
│ │    cls = <class 'ipaddress.IPv4Address'> │                                                     │
│ │ ip_str = ''                              │                                                     │
│ ╰──────────────────────────────────────────╯                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AddressValueError: Address cannot be empty

@jmrplens I have made a fix for this. Could you try v1.11.4 of the integration and let me know?

With the new version we are close, it doesn’t break anymore, but now it recognises the IoT network as the guest network, I don’t have the guest network activated but the IoT network, the integration recognises it the other way round:


Some logs I have seen:


2024-03-29 10:08:18.743 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry http://192.168.0.2 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/__init__.py", line 53, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in async_config_entry_first_refresh
    await self._async_refresh(
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/coordinator.py", line 72, in _async_update_data
    self.status = await self.hass.async_add_executor_job(TPLinkRouterCoordinator.request, self.router,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/coordinator.py", line 72, in _async_update_data
    self.status = await self.hass.async_add_executor_job(TPLinkRouterCoordinator.request, self.router,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tplink_router/coordinator.py", line 72, in _async_update_data
    self.status = await self.hass.async_add_executor_job(TPLinkRouterCoordinator.request, self.router,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError