Giter Site home page Giter Site logo

ha-omada's People

Contributors

fplanque avatar h3llrais3r avatar kevstark avatar ping-localhost avatar sogood007 avatar zachcheatham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-omada's Issues

Invalid Repository?

Please advise:

Invalid Respository

How do I install this in Home Assistant (I have an OC300 on the same network segment as a Rapberry PI 4running HA Supervised)...? What is the url for the custom repository? What code needs to be installed manually and where, and what files - in GitHub there are a bunch of them and no instructions for which ones - ? Sorry for what must seem like dump questions, I cannot even get the custom repository added because do not know which URL to use....?

Originally posted by @KruseLuds in #12 (comment)

Guest SSID control

Hi Zach. Thanks for the great work.

I've been using the integration and I love it.

Would it be any possibility to add a HA switch to turn on and off the Guest SSID? That would be the icing on the cake...

Thanks a lot in advance!

Using deprecated method

Getting this in my log after setting up the integration:

Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom integration author for omada using this method at custom_components/omada/device_tracker.py, line 66: entity_registry = await hass.helpers.entity_registry.async_get_registry()

Also, I saw in code that the line with refresh interval (30 sec) that you added a comment that it should be removed after websockets. It doesn't look like you're using websockets right now, is that something you're actively working on? Or just a roadmap thingy?

View Only account permissions

An account with View Only privileges on the controller is not able to be used with this integration. Previously with v4 controller software, this worked.

Home Assistant - Failed to Setup

Running Home Assistant 2022.6.7. Running 0.3.0 of this integration.

Lately, after a restart of Home Assistant, I get a "Failed to Setup" on the integration page for Omada. The associated log is below.

I have wiped out the integration, restarted, re-added, and all was well for a day, then after a restart it happened again.


This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/omada/controller.py:147
Integration: TP-Link Omada (documentation)
First occurred: 8:34:18 AM (1 occurrences)
Last logged: 8:34:18 AM

Error setting up entry Home: Home for omada
Traceback (most recent call last):
  File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
    await controller.login()
  File "/config/custom_components/omada/api/controller.py", line 48, in login
    await self._update_api_info()
  File "/config/custom_components/omada/api/controller.py", line 65, in _update_api_info
    response = await self._request("get", f"{self.url}/api/info")
  File "/config/custom_components/omada/api/controller.py", line 180, in _request
    async with self._session.request(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/omada/__init__.py", line 32, in async_setup_entry
    await omada_controller.async_setup()
  File "/config/custom_components/omada/controller.py", line 74, in async_setup
    self.api = await get_api_controller(
  File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
    await controller.login()
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 116, in __exit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Omada reload integration.

I run into this condition where I have the home assistant running on docker, and the Omada controller running in Ubuntu, but when I boot HA always shows it has errors, but when I realized the integration the error goes away. My guess is that the Omada controller initializes later and since the integration does not check more than one time, that Omada has started. Is there a way that someone could update this to include a delay and number of retries?

Error in System Log

In the system log there are errors concerning the Omada integration:

Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom component author for omada using this method at custom_components/omada/device_tracker.py, line 66: entity_registry = await hass.helpers.entity_registry.async_get_registry()

5.0.29 API error

I've just upgraded my OC200 to firmware 5.0.29
When I try to add and set up the integration it gives: An API error occurred. Please see logs for more information.

In the logs I found 2 errors:
1.
This error originated from a custom integration.

Logger: custom_components.omada.controller
Source: custom_components/omada/controller.py:174
Integration: TP-Link Omada (documentation)
First occurred: 10:39:44 PM (1 occurrences)
Last logged: 10:39:44 PM

Unable to connect to Omada at https://192.168.10.2: Call to https://192.168.10.2/api/v2/login received status code 404:

This error originated from a custom integration.

Logger: custom_components.omada.api.controller
Source: custom_components/omada/api/controller.py:103
Integration: TP-Link Omada (documentation)
First occurred: 10:39:44 PM (1 occurrences)
Last logged: 10:39:44 PM

Error connecting to https://192.168.10.2/api/v2/login: API returned HTTP 404.

Integration setup (login timeout)

I see many similar issues, but did not find the exact problem.

Tried to set up the integration in HA 2022.11, but the version does not matter now. Got the following error message:

An API error occurred. Please see logs for more information.

Checked the logs and see the next error:

Call to https://192.168.10.2:8043/42...47/api/v2/login timed out.

I run my Omada Controller 5.7.x on a (not very powerful) RPI 2. Tried to login in Postman and the login takes ~20 secs. As I understand all requests fail after 10 secs, so I think I am unable to set up the integration until I change the controller hardware. Is there any possible alternate fix for this?

If I restart HA, ha-omada fails.

Hello.

If I restart HA, ha-omada fails.

normal running at Reload on 'Settings - Device & Services - TP-Link Omada'

Problems occur only occasionally when HA is restarted, can it be improved?

Thank you.

Verify SSL - Can't verify SSL error (Omada v5.0.30)

Hello,

Yesterday I installed Omada v5.0.30 using my private certificates. That works great.

Today I added this add-on but ran into 1 issue. If I enable "Verify SSL" , it complains that my certificate is invalid. Firefox, Safari are all happy with my cert. I am not sure how to troubleshot this one for you and where to get logs. Please let me know how I could help so this can get fixed.

[edit] fyi the installation works w/ "verify ssl" disable but I'd rather have SSL validation into place.

Thank you for providing this add-on.

Exceptions repeating in latest new release - not working (EntityRegistry can't be used in 'await' expression)

This is from the syslog,

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: #33[31m2022-08-17 18:22:31.833 ERROR (MainThread) [homeassistant.util.logging] Exception in async_update when dispatching 'omada-update-6fdc5898c2e1160fc84843132266b6f4': ()

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: Traceback (most recent call last):

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:   File "/config/custom_components/omada/device_tracker.py", line 187, in async_update

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:     await self.remove()

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:   File "/config/custom_components/omada/device_tracker.py", line 176, in remove

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:     entity_registry = await self.hass.helpers.entity_registry.async_get(self.hass)

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: TypeError: object EntityRegistry can't be used in 'await' expression

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: #33[0m

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: #33[31m2022-08-17 18:22:31.863 ERROR (MainThread) [homeassistant.util.logging] Exception in async_update when dispatching 'omada-update-6fdc5898c2e1160fc84843132266b6f4': ()

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: Traceback (most recent call last):

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:   File "/config/custom_components/omada/device_tracker.py", line 187, in async_update

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:     await self.remove()

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:   File "/config/custom_components/omada/device_tracker.py", line 176, in remove

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]:     entity_registry = await self.hass.helpers.entity_registry.async_get(self.hass)

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: TypeError: object EntityRegistry can't be used in 'await' expression

Aug 17 18:22:31 kruse-pi 924cc5103eb5[874]: #33[0m

Can't connect to Controller

I've double checked issue #23.
Also I've rebooted my entire HA system and the Omada Controller.

But when I fill in all data and push the Submit button it always gives me this:
image

Error setting up entry OC200: Default for omada

Hi, unfortantley this fails to load now with the below error, any idea? Thanks.

2022-06-04 21:15:24 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry OC200: Default for omada
Traceback (most recent call last):
File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
await controller.login()
File "/config/custom_components/omada/api/controller.py", line 51, in login
response = await self._controller_request("post", "/login", json=auth)
File "/config/custom_components/omada/api/controller.py", line 155, in _controller_request
return await self._request(
File "/config/custom_components/omada/api/controller.py", line 180, in _request
async with self._session.request(
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 559, in _request
await resp.start(conn)
File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 898, in start
message, payload = await protocol.read() # type: ignore[union-attr]
File "/usr/local/lib/python3.9/site-packages/aiohttp/streams.py", line 616, in read
await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/omada/init.py", line 32, in async_setup_entry
await omada_controller.async_setup()
File "/config/custom_components/omada/controller.py", line 74, in async_setup
self.api = await get_api_controller(
File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
await controller.login()
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 116, in exit
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Unsupported Omada controller version - OC200

Hi,

I have an OC200 hardware controller. When I try to set up the Integration it gives "Unsupported Omada controller version."
I've checked and have the latest version:

Controller Version:4.4.6
Model:OC200 1.0
Firmware Version:1.9.3 Build 20210914 Rel.39903

Country code prevents HACS installation

When I had difficulty installing the integration in HACS (as a novice user), I could not find the integration in the list.

After a lot of head scratching and snuffling about, I noticed that the hacs.json contained the county code for Norway "NO".

If I set the country in HACS to NO it will then display and I can install it.

I dont know if the NO code you used was to express Norway or if you meant that there was "no" specific country requirement....

As I said - I am a novice user and I may have completely the wrong end of the stick, but this may also prevent others from using your good work from lack of being able to install the integration correctly.

Since version 0.31 the devices in my omada controller are not working in home assistant

Hello,
Until version 0.30 any device that appears in my devices page in Omada controller appeared as a device in my home assistant. When I installed the new version those devices stopped working. I removed the integration and added it again and the page asking me to set a location for each device is not appearing any more.

I used those devices generate a uptime dashboard. Here is the example of the dashboard yaml I have.

type: vertical-stack
title: Devices
cards:
  - type: custom:uptime-card
    entity: device_tracker.maia_closet_gateway
    title_template: Gateway
    icon: mdi:wan
    ok: home
    ko: away
    alias:
      ok: Connected
      ko: Disconected

image

No Support for Controller Version 5.0.0

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.

async_get_registry Deprecated

Getting this error in the logs:

Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom component author for omada using this method at custom_components/omada/device_tracker.py, line 66: entity_registry = await hass.helpers.entity_registry.async_get_registry()

Add device tracker for wired connections

Currently, only device trackers are created for wireless clients. It could be useful to also add a device tracker for wired clients.
For instance, to check if a desktop computer is turned on or certain UTP sockets are in use.

Maybe an extra option could be added to the configuration to enable/disable this feature.

Voucher List

Hello,

it is possible to take out the Voucher List from Voucher Manager?

Errors Loading

Note the below from my HA log. I shouldn't have to go reload it every day after my router or HA is restarted:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/omada/controller.py:147
Integration: TP-Link Omada (documentation)
First occurred: 6:53:21 AM (1 occurrences)
Last logged: 6:53:21 AM

Error setting up entry Master_Controller: Ridgewood Estate for omada
Traceback (most recent call last):
File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
await controller.login()
File "/config/custom_components/omada/api/controller.py", line 48, in login
await self._update_api_info()
File "/config/custom_components/omada/api/controller.py", line 65, in _update_api_info
response = await self._request("get", f"{self.url}/api/info")
File "/config/custom_components/omada/api/controller.py", line 180, in _request
async with self._session.request(
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1090, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1120, in _create_connection_transport
await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/omada/init.py", line 32, in async_setup_entry
await omada_controller.async_setup()
File "/config/custom_components/omada/controller.py", line 74, in async_setup
self.api = await get_api_controller(
File "/config/custom_components/omada/controller.py", line 147, in get_api_controller
await controller.login()
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 116, in exit
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

AP Name?

Hi, thanks for the awesome addon. Is there a possibility of listing "ap_name" as a state attribute for clients? Looks like it might be supported in the Omada API.

Unable to find the integration to configure in Home Assistant UI

Hello Following this steps:

Installation
Add repository to HACS
Install

image

Add integration via UI

I have successfully install the integration in the hacks as costume repository But after this I'm unable to find or configure the next

image

Can you please let me know how to procede ?

Thank you

When connecting to multiple sites

Hello.

When one device connects to multiple sites, there is a duplicate problem with unique_id.

---------------- [ LOG ] -------------------
2022-06-18 22:54:51 ERROR (MainThread) [homeassistant.components.device_tracker] Platform omada does not generate unique IDs. ID 64-C2-DE-52-C1-A4 already exists - ignoring device_tracker.mom_v50_thinq
2022-06-18 22:55:20 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
---------------- [ LOG ] -------------------

The device(64-C2-DE-52-C1-A4) of the above LOG is my mother's
It was used by connecting to the wifi of 'site A' in a remote location. And recently, she visited my house and connected to the wifi of 'site B'.

I think it would be better to include site name when creating unique_id for each device.

To prevent collisions with previous devices that have already been registered, I think the problem will be solved if only devices registered with the same unique_id are handled exceptionally.

Thank you.

Unable to connect

Im seeing this error when connecting to omada.

This error originated from a custom integration.
Logger: aiohttp.server
Source: custom_components/omada/api/errors.py:23
Integration: TP-Link Omada (documentation)
First occurred: 8:34:13 PM (9 occurrences)
Last logged: 8:44:06 PM

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 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, 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 111, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 198, 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 256, 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 166, in get_api_controller
await controller.update_ssids()
File "/config/custom_components/omada/api/controller.py", line 52, in update_ssids
response = await self._site_request("get", "/setting/ssids")
File "/config/custom_components/omada/api/controller.py", line 62, in _site_request
return await self._request(method, url, params=tokened_params, json=json)
File "/config/custom_components/omada/api/controller.py", line 91, in _request
self._raiseOnResponseError(response)
File "/config/custom_components/omada/api/controller.py", line 107, in _raiseOnResponseError
raise_response_error(response)
File "/config/custom_components/omada/api/errors.py", line 23, in raise_response_error
raise OmadaApiException("API Error Code {}: {}".format(response["errorCode"], response["msg"]))
custom_components.omada.api.errors.OmadaApiException: API Error Code -1005: Operation forbidden.

Entity disappears after disconnected

If i, for example disconnect a wireless device from the wifi, the plugin seems to remove the device completely from entities. is this expected behaviour? This causes the device to be classified as 'unavailable' rather than 'away' which i'd expect.
Is there a way to tell the plugin to leave the entity existing should it be disconnected from the network as the chances are it'll reconnect at some point.

Not working with soft controller v5.5.6 - unable to connect during setup

snap003261

I can log in just fine with that same URL in my browser.

https://192.168.3.10:8043/api/info gives this info:

// 20221009074102
// https://192.168.3.10:8043/api/info

{
  "errorCode": 0,
  "msg": "Success.",
  "result": {
    "controllerVer": "5.5.6",
    "apiVer": "3",
    "configured": true,
    "type": 1,
    "supportApp": true,
    "omadacId": "9cdcbd005327f124fd37a81ed33e8d00"
  }
}

In HA it just logs this:
2022-10-09 07:25:40.249 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at https://192.168.3.10:8043/: Call to https://192.168.3.10:8043//api/info received status code 404:

Do take note of the double forward slashes after the port number. I think that is the issue, from a browser that URL just gives me a "Sorry, the browser is not compatible." error message.

Please help with this, thanks!

Problems after controller update omada 5.0.30

Good evening and sorry for the inconvenience,
I am recently having problems with the integration after updating the Omada controller to version 5.0.30.
I have already tried modification # 17 but sadly it didn't work.

In the logs I get the following error:

Logger: homeassistant.config_entries
Source: custom_components/omada/__init__.py:32
First occurred: 19:50:59 (1 occurrences)
Last logged: 19:50:59

Error setting up entry Home Controller: Casa for omada
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 248, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/omada/__init__.py", line 32, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

Can anyone help me?
Thanks in advance

../api/info not available

Hello everyone,

I would like to use this integration with my EAP245 access point, but I cannot access http://ip/api/info. It just returns error 404.

Do I need to enable something inside the EAP245's WebUI?

I could not find any information on this topic.

Thank you for your support
Alex

Cannot connect to service

I have the hardware controller I am trying to setup the integration but having no luck
i have tried the following URLS
https://192.168.*.*:8043
with SSL checked
2022-07-06 12:39:04 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at https://192.168.*.*:8043: Error connecting to https://192.168.*.*:8043/api/info: Cannot connect to host 192.168..:8043 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')]
2022-07-06 12:39:21 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at https://192.168.*.*:8043: Error connecting to https://192.168.0.5:8043/api/info: Cannot connect to host 192.168..:8043 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)')]

without SSL checked
2022-07-06 12:41:51 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at https://192.168.*.*:8043: Unknown site 'Default'

then using http://
SSL checked
2022-07-06 12:44:10 WARNING (MainThread) [custom_components.omada.api.controller] Error connecting to http://192.168.*.*:8043/api/info: API returned HTTP 400.
2022-07-06 12:44:10 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at http://192.168.*.*:8043: Call to http://192.168.0.5:8043/api/info received status code 400:

Then using http://
SSL unchecked
2022-07-06 12:45:30 WARNING (MainThread) [custom_components.omada.api.controller] Error connecting to http://192.168.*.*:8043/api/info: API returned HTTP 400.
2022-07-06 12:45:30 WARNING (MainThread) [custom_components.omada.controller] Unable to connect to Omada at http://192.168.*.*:8043: Call to http://192.168.*.*:8043/api/info received status code 400:

Any assistance would be appreciated

asyncio.exceptions.TimeoutError after HA restart

I get the below error every time I restart HA and the Omada integration fails to work. I have to manually call the homeassistant.reload_config_entry service and specify both my access point devices and then it starts to work.

I am using a fairly low spec. raspberry pi to run HA/HAOS - is this a timeout in the integration itself? Is it just that this timeout is set too low? Could this be increased?

Regards,

Stephen

Logger: homeassistant.config_entries
Source: custom_components/omada/controller.py:160
Integration: TP-Link Omada (documentation)
First occurred: 14:44:22 (1 occurrences)
Last logged: 14:44:22

Error setting up entry Omada Controller_50PoW: Default for omada
Traceback (most recent call last):
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 79, in _request
async with self._session.request(method, url, params=params, json=json, ssl=self._ssl_context) as res:
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
transport, protocol = await self._create_connection_transport(
File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/omada/init.py", line 30, in async_setup_entry
await controller.async_setup()
File "/config/custom_components/omada/controller.py", line 91, in async_setup
self.api = await get_api_controller(self.hass, self.url, self.username, self.password, self.site, self.verify_ssl)
File "/config/custom_components/omada/controller.py", line 160, in get_api_controller
await controller.login()
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 45, in exit
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/site-packages/async_timeout/init.py", line 92, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Errors with latest home Assistant update

This is the error

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/omada/config_flow.py:92
Integration: TP-Link Omada (documentation)
First occurred: 16:43:11 (1 occurrences)
Last logged: 16:43:11

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 192, in post
return await super().post(request)
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 71, in post
result = await self._flow_mgr.async_init(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 197, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 224, in _async_init
result = await self._async_handle_step(flow, flow.init_step, data, init_done)
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 92, in async_step_init
self.controller: OmadaController = self.hass.data[OMADA_DOMAIN][self.config_entry.entry_id][DATA_OMADA]
KeyError: 'omada'

Unable to connect to service

Dear all,
I'm trying to enable integration in HA, but when I configure it I get the error 'Unable to connect to service.'
As URL I'm using my controller, HTTPS, link .... like https://192.168.0.200, SIte in the one configured in the controller, like Home, and Verify SSL is checked.

Is there something of wrong in the above configuration, or I get an issue?

Thanks in advance
Stefano

KeyError: 'omada'

Omada intergration works first time around to load it but if I restart Hassio im getting the following error. Note Im not using the default site im using HOME

2022-03-14 09:51:40 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration omada which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-03-14 09:52:07 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home_Controler: HOME for omada
File "/config/custom_components/omada/controller.py", line 164, in get_api_controller
File "/config/custom_components/omada/api/controller.py", line 57, in login
File "/config/custom_components/omada/api/controller.py", line 75, in _update_api_info
File "/config/custom_components/omada/api/controller.py", line 190, in _request
File "/config/custom_components/omada/init.py", line 30, in async_setup_entry
File "/config/custom_components/omada/controller.py", line 89, in async_setup
File "/config/custom_components/omada/controller.py", line 164, in get_api_controller
File "/config/custom_components/omada/config_flow.py", line 102, in async_step_init
self.controller: OmadaController = self.hass.data[OMADA_DOMAIN][self.config_entry.entry_id][DATA_OMADA]
KeyError: 'omada'

Unable to setup intergration with Omada 4.4.4

Hi,

love the idea of this so far, would love to get it working, steps to repeat

    • add the repository to Hass ( this is a relatively clean build)
    • reboot
    • add new integration
    • enter the details shown below

receive Unable to connect to service,

image

The log output below, puls the compose file for Omada are below
Hass is running on a separate device in the same subnet.
I can log into and use the Hass and Omada controller normally. Hass can see and connect to other devices including other Hass boxes

services:
  omada-controller:
    container_name: omada-controller
    image: mbentley/omada-controller:4.4
    restart: unless-stopped
    network_mode: host
    volumes:
      - omada-data:/opt/tplink/EAPController/data
      - omada-work:/opt/tplink/EAPController/work
      - omada-logs:/opt/tplink/EAPController/logs
    environment:
      - TZ=Etc/UTC
      - MANAGE_HTTP_PORT=8088
      - MANAGE_HTTPS_PORT=8043
      - PORTAL_HTTP_PORT=8088
      - PORTAL_HTTPS_PORT=8043
      - SHOW_SERVER_LOGS=true
      - SHOW_MONGODB_LOGS=false
      - SSL_CERT_NAME="tls.crt"
      - SSL_KEY_NAME="tls.key"

volumes:
  omada-data:
  omada-work:
  omada-logs:

Home Assistant info

Version | core-2021.8.7
-- | --
Installation Type | Home Assistant Container
Development | false
Supervisor | false
Docker | true
user | root
Virtual Environment | false
Python Version | 3.9.6
Operating System Family | Linux
Operating System Version | 5.11.0-1016-raspi
CPU Architecture | aarch64
Timezone | Europe/London

Error, seen in Home Assistant

Logger: aiohttp.server
Source: custom_components/omada/api/errors.py:23
Integration: TP-Link Omada (documentation)
First occurred: 11:58:35 AM (1 occurrences)
Last logged: 11:58:35 AM

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 89, 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/auth.py", line 144, 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 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, 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 260, 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 166, in get_api_controller
    await controller.update_ssids()
  File "/config/custom_components/omada/api/controller.py", line 52, in update_ssids
    response = await self._site_request("get", "/setting/ssids")
  File "/config/custom_components/omada/api/controller.py", line 62, in _site_request
    return await self._request(method, url, params=tokened_params, json=json)
  File "/config/custom_components/omada/api/controller.py", line 91, in _request
    self._raiseOnResponseError(response)
  File "/config/custom_components/omada/api/controller.py", line 107, in _raiseOnResponseError
    raise_response_error(response)
  File "/config/custom_components/omada/api/errors.py", line 23, in raise_response_error
    raise OmadaApiException("API Error Code {}: {}".format(response["errorCode"], response["msg"]))
custom_components.omada.api.errors.OmadaApiException: API Error Code -1005: Operation forbidden.

How do I see the Device and client attributes and sensors ?

I have installed 2 x TP-Link EAP225 APs and 1 x Omada OC200. I also upgraded their firmware to the latest versions. Under Omada HA Controller I can see 2 devices (one for each AP) and 1 entity for my mobile phone.
Up to now perfect !

Can you please help me on how do I see the rest device and client attributes and sensors ?

Thank you in advance.

Integration Not Ready yet

I installed via HACs but get the following error in logs on reboot and can't find the integration in Devices & Services

2022-01-31 14:13:24 WARNING (MainThread) [homeassistant.config_entries] Config entry 'TP-Link SMB ER605' for upnp integration not ready yet; Retrying in background

Integration fails after Home Assistant reboot

Integration fails after every reboot, needs to be removed and re added to enable again.

Omada Software Controller 5.0.29,
Home Assistant 2021.12.10
Home Assistant TP-Link Omada Integration 0.2.0

2022-01-27 14:37:27 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Omada: Default for omada
Traceback (most recent call last):
File "/config/custom_components/omada/controller.py", line 157, in get_api_controller
await controller.login()
File "/config/custom_components/omada/api/controller.py", line 60, in login
response = await self._controller_request("post", "/login", json=auth)
File "/config/custom_components/omada/api/controller.py", line 165, in _controller_request
return await self._request(
File "/config/custom_components/omada/api/controller.py", line 190, in _request
async with self._session.request(
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1138, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 559, in _request
await resp.start(conn)
File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 898, in start
message, payload = await protocol.read() # type: ignore[union-attr]
File "/usr/local/lib/python3.9/site-packages/aiohttp/streams.py", line 616, in read
await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/omada/__init__.py", line 30, in async_setup_entry
await controller.async_setup()
File "/config/custom_components/omada/controller.py", line 87, in async_setup
self.api = await get_api_controller(self.hass, self.url, self.username, self.password, self.site, self.verify_ssl)
File "/config/custom_components/omada/controller.py", line 157, in get_api_controller
await controller.login()
File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 115, in __exit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 203, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Cannot Connect when setup

i can't setup the controller in the intergration:
y0FIcjWyuh

When i check the logs and the api:
HA Logs:
Unable to connect to Omada at https://xxx.xxx.xxx.xxx:8043: Operation forbidden.

Ofcourse the xxx must be replaced with my ip.

Api check:
{"errorCode":0,"msg":"Success.","result": "controllerVer":"5.0.29","apiVer":"3","configured":true,"type":1,"supportApp":true,"omadacId":"SomeText"}}

What am i doing wrong?

TP-Link Cloud Support

I installed via hacs and am at the stage where i install under integrations. It pops up a form and I'm confused to what I put in. I couldn't find very good instructions.

What do I put for the URL?
Do I need to put something under site?
The username and password I assume is what I used to log into the cloud controller?

Thanks

Unable to install integration with version 0.3

I installed the repository (selected version 0.3) in HACS but was unable to install the integration as there were no results when I searched for Omada in integrations. I uninstalled and reinstalled version 0.3 restarting HA after each change but nothing changed. I uninstalled 0.3 and installed 0.2.1 and it worked right away. I was able to install the integration and configure for my controller. It picked up my 2 EAP225 units and my ER605 as well. Entities were created and the integration is working so far. I have not upgraded to version 0.3 to see whether the settings remain.
HA version: 2022.3.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.