[Custom Component] TP-Link Router Integration

TP-Link TL-MR105 and Archer VR900v supports are confirmed

I’m trying to use the integration with C80 and get the same response. More detailed specs:

Firmware Version:

1.13.2 Build 230824 Rel.74702n(4555)

Hardware Version:

Archer C80 1.0

Firmware Version:

1.13.2 Build 230824 Rel.74702n(4555)

Hardware Version:

Archer C64 1.0

document.getElementById(“login-password”).value;
Not working, i try to find ID in page code manualy, but there is no ID for this field

Help

Archer C6 4.0, Archer C80 and Archer C64 are not supported yet

You may add support for your router by adding a new class for your router witch extends AbstractRouter

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?