[Custom Component] TP-Link Router Integration

My apologies, Alexandr, I missed a step (but, to be fair, it wasn’t documented this way in the instructions).
My understanding of your instructions suggest that, after I add the repository to HACS (step 2) and then download the integration (step 6) and reboot (step 7), I can proceed to the next steps.

In my case, however, I had to THEN go to Settings>Devices & Services, click “Add Integration”, then search for and add “TP-Link Router”. (Step 8+)

Okay, so I’m at the “Configuration” stage.
In your configuration screen, there’s a spot only for the password, not username/email:

This screen-bite shows mine, which requires both:
Screenshot 2024-09-19 194450
(sorry it’s so big - that’s how the dialogue uploaded it!)

The next issue I encounter is after entering the password (only) into your configuration screen. I have tried both http:// and https://, and checking and unchecking “Verify ssl for https connection”, and when it’s unchecked I do get the “…encrypted password…” error, so I follow your instructions here.

What I get, depending on the browser (I have tried several - Firefox, Edge, Chrome), is either get my UNencrypted password in double quotes, or JUST a pair of single quotes, with nothing inside. The latter is pictured below (I munged my username/email):

I’m stuck here…
Suggestions?

Thanks for any help you can give!

P.S.: What encryption does your integration expect? MD5, Base64, etc.? I could potentially encrypt my password offline with a utility and try that (I know there are online utilities, but I’d never enter such sensitive data there)

You have to use Local Password which is for Log In with Local Password
Not Log In with TP-LINK ID

Is there any relevant logs from Settings->System->Logs?

“Local Password”… Of my router? Of my PC?

The username/password I use to log into my router (in the screen-bite) is the only one I know of. Also, this router will only accept an email address for a ‘username’.

Logging into my PC involves biometrics and 2FA. And anyway, I would never enter that password into an app.

Perhaps you mean the password for my Home Assistant?.. Again, this is a username/password combo, and again, this is too sensitive to enter anywhere but the main app.

Sorry for not understanding…

Small update:
Reviewing my router’s documentation, there are two ways to configure it for the first time, either “Via TP-Link Tether App”, which is what I think I did, as this is the one requiring an email address; also, I do have the Tether App installed on my phone (it was years ago, so my memory is foggy on this), or “Via a Web Browser” (these terms per their Quick Setup doc), in which it appears that only a password is required. I’m not sure what happens after you continue with the setup from there.

There does not appear to be a way to go back to the password-only setup, at least not without doing a full reset and start over again (and I really don’t want to do that). I’m still looking through the docs, and will search the web for related articles.

That said, I’m not sure I’d want a password-only setup; the username is another level of security, and it would be a shame to lose that.

More to come… I hope!

P.S.: All docs for the Archer C5400X V1 are here:
https://www.tp-link.com/ca/support/download/archer-c5400x/

You can just log in locally via the web browser, you have to use http://tplinkwifi.net/, that is password only. You can also log in via the tether app, but that is for when you are outside your network. You can switch at any time and you do not have to reset anything for that, all settings remain the same with both login methods.

By the way, you can also log in with this http://tplinkwifi.net/ method via your TP Link ID in the web browser, but then the integration does not work well

SUCCESS!!!
The problem was indeed because the router had been set up for “Cloud”, which only means that I can “manage” it from outside of my network. THIS, to me, is a security RISK, so I’m happy to be rid of it! (But, as it’s password only, I’ve changed the password to something much more robust)
N.B. The TP-Link App still works from “within” my network, and if I want to use it from outside of my network, I use my VPN. Much more secure.

To “resolve” the issue, all I did was to “unbind” the Cloud account, whereupon I was logged out, and had to log in again. CAUTION: this “Local Password” is different from the “Cloud” one. Make sure you have it before doing this. Make a backup of your config, first, just in case.

So, back in “password-only” mode, I followed your instructions, @AlexandrErohin, and they worked perfectly! I’m so pleased, I came back immediately to write this reply, so that no further time was wasted on it.
You can add the Archer C5400 to your “Supported” list (unless you’d rather wait until I’ve tested it further; DM me if you’d like me to test anything specific)
Thanks so much for your support!

I haven’t had a chance to play with it, but here is a screenshot of what I have so far:

Thanks, @Braakie , for your input, but it’s a bit more complicated than that. I’ve always used the tpinkwifi.net URL, for convenience, but it’s equivalent to the actual IP. This address is how it “advertises” itself to the network, and this has nothing to do with “Local” versus “Cloud”.
Please see my next reply for more details, and how I finally resolved the issue:
[Custom Component] TP-Link Router Integration - #182 by Assisted

Thank you for this integration!!
I needed to have a button for rebooting the router for in case I’m not available and the family needs to do it. One question though, Its added only the main deco I think, so when I hit reboot, it would only reboot the main deco or would it reboot all?

I guess I should try it when the family isn’t home xD

Also, is there a way to turn off the device tracking, I had to do this for each individual device added to the integration which was a long process heh

xe75 pro 2.0

Can confirm, it reboots all decos on the network

Yes - very keen to get parental controls if anyone has had any success with this!?

v1.16.0 Released

Changelog

1 Like

TP-link AX6600 Tri-Band WiFi6 Router (hardware version AX90 V1.20) Seems to work.

For logging, it works fine I guess, but I still need to regularly log into the Router to add or remove users.

This would be SO usefull IF the API would allow at least 2 concurrent logins.
The people at TP-Link say it would be dangerous if two users attempt to change settings at the same time.
Perhaps they should allow one admin user with all persmissions, and one other user for just checking status.
It would only limit the functionality of your HA integration a very little bit.

2 Likes

Tested it with Archer A9 V6 And it seems to be working correctly

1 Like

I would add a pause button - so the integration stop scan for 5 minutes

An additional feature I would like is to turn off the tracking ability so have it as a toggle option, not sure if this is able to be accomplished.

good evening, I still have a configuration error with my Deco XE75pro.
I enter the IP address and the password, the addition is done normally but at the end I get an error. Here’s what’s in the log

TplinkRouter - TPLinkDecoClient - An unknown response - Expecting value: line 1 column 1 (char 0); Request admin/client?form=client_list - Response <h1>Bad Gateway</h1>The process did not produce any response
Error setting up entry http://192.168.1.4 for tplink_router
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, 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 570, in get_status
    data = self.request('admin/client?form=client_list', dumps(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tplinkrouterc6u/client.py", line 111, in request
    raise ClientError(error)
tplinkrouterc6u.exception.ClientError: TplinkRouter - TPLinkDecoClient - An unknown response - Expecting value: line 1 column 1 (char 0); Request admin/client?form=client_list - Response <h1>Bad Gateway</h1>The process did not produce any response

Where does this come from?
Thanks

Fixed after update of the firmware.
Sorry

v1.18.0 Released

Changelog

1 Like

Many thanks for this amazing Project keep up a good work! :smiling_face_with_three_hearts:
I have 5x TP-Link Routers / 2x SW / 3x Powerline Adapter, 2x Repeater :nerd_face:
AX73 / C80 / C3150 / C7 / MR600
For sure i will try it out, especially on C80 looks like NOT supported, but i’m pretty sure it will work! :star_struck:

You can try just
document.getElementById(“password”).value;

its worked me on AX73

v1.19.0 Released

Changelog

1 Like