Home-Assistant-TP-Link-Router icon indicating copy to clipboard operation
Home-Assistant-TP-Link-Router copied to clipboard

issue with latest HA 2022.3.6

Open moshriq opened this issue 3 years ago • 5 comments

the config checker gives 'Platform error switch.tplink_router - Integration 'tplink_router' not found.'

moshriq avatar Mar 26 '22 12:03 moshriq

I have same error. What's the solution. I have Tplink Archer C64 AC1200 router. Please help.

theshop35 avatar May 21 '22 10:05 theshop35

@moshriq @theshop35 So the when I used HACS with the GitHub link, it didn't work because it didn't clone the latest version on main. It used the most recent tagged released from September, which didn't have the version in the manifest json file yet.

So I got it to work by cloning it instead, and then mv Home-Assistant-TP-Link-Router/custom_components/tplink_router/ tplink_router while at /config/custom_components to move just the custom components code. You can then do rm -r Home-Assistant-TP-Link-Router. Restart, It should then work.

Hopefully @menahishayan sees this and gets an updated version released. I think the code is all right, just not released.

madeline-scyphers avatar Jul 25 '22 23:07 madeline-scyphers

I lied, I think there might be other things wrong too.

2022-07-25 19:20:31 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy tplink_router
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 248, in async_setup_legacy
scanner = await hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tplink_router/device_tracker.py", line 57, in get_scanner
scanner = cls(config[DOMAIN])
File "/config/custom_components/tplink_router/device_tracker.py", line 84, in __init__
self.success_init = self._update_info()
File "/config/custom_components/tplink_router/device_tracker.py", line 468, in _update_info
session.get(base_url, headers=header)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 369, in prepare
self.prepare_headers(headers)
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 491, in prepare_headers
check_header_validity(header)
File "/usr/local/lib/python3.10/site-packages/requests/utils.py", line 1037, in check_header_validity
raise InvalidHeader(
requests.exceptions.InvalidHeader: Header part ('User-Agent') from {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0'} must be of type str or bytes, not <class 'multidict._multidict.istr'>

madeline-scyphers avatar Jul 25 '22 23:07 madeline-scyphers

Am I missing something? Can't find integration in HACS at all?

jhalak1984 avatar Nov 25 '22 19:11 jhalak1984

You might want to try this different fork of tplink_router which mentions:

This fork has been updated to work with Home Assistant version 2022.7+

prullmann avatar Jan 05 '23 17:01 prullmann