AlexandrErohin / home-assistant-tplink-router

Home Assistant component for TP-Link router administration with sensors, button reboot, switches and device tracking.
https://community.home-assistant.io/t/custom-component-tp-link-router-integration
MIT License
85 stars 7 forks source link

Archer C60 v2.0 and TL-WA1201 3.0 - any chance of adding support? #9

Open snigehere opened 8 months ago

snigehere commented 8 months ago

Hi - thanks for the integration - I have an Archer C60 v2.0 Firmware 2.0.0 Build 20161206 rel.60287 and a TL-WA1201 3.0 Firmware 1.10.32 Build 221020 Rel.61052n(4555)

I am looking for some kind of integration that I could use to access them for device tracking - is it possible to add this to the integration? Can I provide any information / detail to help?

I tried to connect both and got errors so guess there is no supported so far....

This is the error from the Archer C60

2023-12-13 23:55:42.549 ERROR (SyncWorker_2) [custom_components.tplink_router.config_flow] can only concatenate str (not "dict") to str 2023-12-13 23:55:42.656 ERROR (SyncWorker_3) [custom_components.tplink_router] can only concatenate str (not "dict") to str 2023-12-13 23:55:42.658 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry http://192.168.1.254 for tplink_router Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tplink_router/init.py", line 40, in async_setup_entry coord = TPLinkRouterCoordinator(hass, device, config_entry.data[CONF_SCAN_INTERVAL], info, _LOGGER) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tplink_router/coordinator.py", line 19, in init self.firmware = info[0]



And this the error detail for the TL-WA1201 3.0

2023-12-14 00:08:17.668 ERROR (SyncWorker_5) [custom_components.tplink_router.config_flow] Extra data: line 1 column 2 (char 1)
2023-12-14 00:08:17.677 ERROR (SyncWorker_4) [custom_components.tplink_router] Extra data: line 1 column 2 (char 1)
2023-12-14 00:08:17.678 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry http://192.168.1.2 for tplink_router
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tplink_router/__init__.py", line 40, in async_setup_entry
coord = TPLinkRouterCoordinator(hass, device, config_entry.data[CONF_SCAN_INTERVAL], info, _LOGGER)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tplink_router/coordinator.py", line 19, in __init__
self.firmware = info[0]
~~~~^^^
TypeError: 'NoneType' object is not subscriptable
TypeError: 'NoneType' object is not subscriptable

Thanks
AlexandrErohin commented 8 months ago

Since I don’t have the opportunity to test on this version of the router, you can download the client and check which requests are incorrect for this router.

AlexandrErohin commented 8 months ago

I have added more logs for errors. @snigehere Could you reinstall it and check the logs again?

snigehere commented 8 months ago

Hi - Thanks - I deleted my integration components and redownloaded from hacs - version shows as 1.2.3

I re-added the integration and entered the detail for logon but can't get past the configuration page now - I get the below error and the configuration page resets to default

2023-12-14 23:50:18.616 ERROR (MainThread) [custom_components.tplink_router.config_flow] TplinkRouter Integration Exception - Unkown error for pwd: {"errorcode":"no such callback","success":false}

Snap14 Snap15

AlexandrErohin commented 8 months ago

Your router has different api. Since I don’t have the opportunity to test on this version of the router, you can download the client and check which requests are incorrect for this router.

snigehere commented 8 months ago

Thanks - That will take me a while as I will need to do some learning first .. I will get back when I find out any answers

AlexandrErohin commented 6 months ago

@snigehere Please try new version - As TP-link Archer C1200 v2.0 support with different login process was added - your router may also be supported now

snigehere commented 6 months ago

Hi - Thanks for your action .. unfortunately neither work

Previously the Archer C60 had to be rebooted after trying the integration as I could not log back on manually .. This time I got the message "You need to use web encrypted password instead. Check the documentation!" so went to try logging on the get the key however the router interface was in a messs again - this time the router seemed to think it did not have a password set so prompted for a new one (like if it was a new setup) but hung on trying to set one so I guess its interface is in a mess again. As I could not follow the encrypted password steps I need to reboot it at the end of the day.

The WA1201 gave the same "You need to use web encrypted password instead. Check the documentation!" message so I followed the steps
document.getElementById("login-password").value; responded with VM219:1 Uncaught TypeError: Cannot read properties of null (reading 'value') at :1:42

StLukesLivestream commented 6 months ago

Ok - archer c60 rebooted ... Ahead of integration setup I was able to get the web encrypted password from the console ... I used this and this time got the error ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

I tried again with the standard password just to make sure and still got the "You need to use web encrypted password instead. Check the documentation!" message ... I guess its progress as no lockup on the interface this time.

AlexandrErohin commented 6 months ago

Thats mean your router has different API

Would be great if you could add support for your router by creating PR with new class that extends https://github.com/AlexandrErohin/TP-Link-Archer-C6U/blob/main/tplinkrouterc6u/client.py#L16