zachcheatham / ha-omada

Home Assistant TP-Link Omada Integration
189 stars 26 forks source link

No Support for Controller Version 5.0.0 #9

Closed bigluisje closed 2 years ago

bigluisje commented 2 years ago

The plugin was working before but lost connection since the omada software upgrade to software controller 5.0.15. i have reinstalled the plugin but no luck.

this is a copy of the log.

Logger: aiohttp.server Source: custom_components/omada/api/controller.py:87 Integration: TP-Link Omada (documentation) First occurred: 17:02:54 (1 occurrences) Last logged: 17:02:54

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 246, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/omada/config_flow.py", line 62, in async_step_user controller = await get_api_controller( File "/config/custom_components/omada/controller.py", line 160, in get_api_controller await controller.login() File "/config/custom_components/omada/api/controller.py", line 41, in login response = await self._public_request("post", "/login", json=auth) File "/config/custom_components/omada/api/controller.py", line 73, in _public_request return await self._request(method, url, json=json) File "/config/custom_components/omada/api/controller.py", line 87, in _request raise OmadaApiException(f"Call to {url} received status code {res.status}.") custom_components.omada.api.errors.OmadaApiException: Call to https://192.168.0.15:8043/api/v2/login received status code 404.

cbuxton5200 commented 2 years ago

I'm starting a new Omada install at version 5.0.15 and I cannot get it to connect while adding the integration to HA

zachcheatham commented 2 years ago

I'll have to wait until I have time to find a new docker image for my personal controller or when the image I'm using now updates from 4.4 to troubleshoot.

peternash commented 2 years ago

It looks like the 5.0.15 release is only available for the Windows platform at present https://www.tp-link.com/us/support/download/omada-software-controller/ Also, looks like there is an API change for the 5.0.15 release https://www.tp-link.com/uk/support/faq/3231/

jsimonetti commented 2 years ago

Since omada controller was also vulnerable to the log4j2 exploit, pretty much all software was updated, including their docker container. See here: https://community.tp-link.com/en/business/forum/topic/514452

edit: hmm, unfortunately the linux controller is still at 4.4.8, whereas the windows and hardware OC controllers are at 5.0.29. That will complicate things. (I use an OC200)

for now that means this integration only works with the linux controller software. The windows software and hardware controllers already use the new API

zachcheatham commented 2 years ago

Made a change to support the latest Linux version's changes around the SSID endpoint so that this can support anyone moving to the exploit-patched version. Still looking into what all needs to change to support the changes in 5.0.

FaBRiK74 commented 2 years ago

OC200 harware controller also got V5 (5.0.29)

jsimonetti commented 2 years ago

I did some digging, and it turns out, all url's are now prefixed with your omadacId (Customer ID? Cloud ID?). The omadacId can be obtained by querying /api/info, this will return a json object:

{
  "errorCode":0,
  "msg":"Success.",
  "result":{
    "controllerVer":"5.0.29",
    "apiVer":"3",
    "configured":true,
    "type":10,
    "supportApp":true,
    "omadacId":"xxx_omitted_xxx"
  }
}

Subjequently, all api urls are prefixed: /xxx_omitted_xxx/api/info /xxx_omitted_xxx/api/v2/app/anon/initialization /xxx_omitted_xxx/api/v2/login

Hopefully this helps a bit in getting this integration working again. What is most curious, the /api/info object mentions apiVer: 3. Version 4.4 controllers have apiVer: 2. However, url's still use v2.

zachcheatham commented 2 years ago

I've added (theoretical) support for v5 in the latest release b0188e1. However, I do not have a production version (with APs) of the controllers to test with, so please let me know if any issues I didn't discover with my device-less, test instance of the v5 controller come up.

FaBRiK74 commented 2 years ago

Hello,

It works great! Thank you!

Br, Gábor

jsimonetti commented 2 years ago

I can also confirm the device_tracker is working with this latest release.

cbuxton5200 commented 2 years ago

I missing something, I got it working too on 5.0.29, but I don’t understand what this is tracking. Anybody?

On Dec 27, 2021, at 9:03 AM, Jeroen Simonetti @.***> wrote:

 I can also confirm the device_tracker is working with this latest release.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.