elad-bar / ha-edgeos

Integration with EdgeOS (Ubiquiti)
133 stars 24 forks source link

CPU Usage not changing #70

Closed poonab closed 1 year ago

poonab commented 1 year ago

Updated to 2.0.1 and finding that the CPU usage is now remaining at one number and not changing

elad-bar commented 1 year ago

saw it, will release soon a version for it, thanks for the update

elad-bar commented 1 year ago

fixed v2.0.5, please check and let me know if it works for you as well

poonab commented 1 year ago

It solved that problem but the whole integration suffered a failure I've never experienced on previous versions and that required a reload in HA. Not sure if you want as a separate issue

Logger: custom_components.edgeos.component.api.websocket
Source: custom_components/edgeos/component/api/websocket.py:133
Integration: Ubiquiti EdgeOS Routers ([documentation](https://github.com/elad-bar/ha-edgeos), [issues](https://github.com/elad-bar/ha-edgeos/issues))
First occurred: 12 October 2022 at 21:18:38 (1 occurrences)
Last logged: 12 October 2022 at 21:18:38

Failed to connect WS, Error: 503, message='Invalid response status', url=URL('wss://192.168.0.1/ws/stats'), Line: 109
elad-bar commented 1 year ago

please check if it happens to you in v2.0.9, that error (503) is when the service is down, not related to the component

poonab commented 1 year ago

Upgraded to v2.0.9 and had it stopped again with this message this time

Logger: homeassistant
Source: custom_components/edgeos/component/managers/home_assistant.py:229
Integration: Ubiquiti EdgeOS Routers ([documentation](https://github.com/elad-bar/ha-edgeos), [issues](https://github.com/elad-bar/ha-edgeos/issues))
First occurred: 07:41:18 (1 occurrences)
Last logged: 07:41:18

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  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/edgeos/core/managers/home_assistant.py", line 251, in _update_entities
    self.load_entities()
  File "/config/custom_components/edgeos/component/managers/home_assistant.py", line 229, in load_entities
    for unique_id in self._devices:
RuntimeError: dictionary changed size during iteration

Can see there has been newer releases so will upgrade and report back

elad-bar commented 1 year ago

Latest is 2.0.11

poonab commented 1 year ago

Upgraded to 2.0.11, lasted a bit longer this time but the following error again stopping all logging in HA. Never saw this on the v1 component

Logger: custom_components.edgeos.component.api.websocket
Source: custom_components/edgeos/component/api/websocket.py:133
Integration: Ubiquiti EdgeOS Routers (documentation, issues)
First occurred: 15 October 2022 at 01:47:08 (2 occurrences)
Last logged: 15 October 2022 at 21:46:36

Failed to store partial message for later processing
Failed to connect WS, Error: 503, message='Invalid response status', url=URL('wss://192.168.0.1/ws/stats'), Line: 109
elad-bar commented 1 year ago

Are you using the same user for v1.x? Can you please post log with debug log level? Can you login with the same user to the router directly?

elad-bar commented 1 year ago

I had the same warning message an hour ago, but it just a warning of failure to connect, after 30 seconds it reconnects again an no additional warnings available and sensors keep updating, so you can ignore it... unless the situation is that every 30 seconds you have that message

poonab commented 1 year ago

I found that mine would stop the sensors updating/recording, have now turned on the debug logging to hopefully provide some insight if it happens again.

MagieMalone commented 1 year ago

I get daily disconnects too, reload integration fixes the issue.

running on v2.0.12

This error originated from a custom integration.

Logger: custom_components.edgeos.component.api.websocket
Source: custom_components/edgeos/component/api/websocket.py:133
Integration: Ubiquiti EdgeOS Routers (documentation, issues)
First occurred: October 18, 2022 at 19:21:02 (1 occurrences)
Last logged: October 18, 2022 at 19:21:02

Failed to connect WS, Error: 503, message='Invalid response status', url=URL('wss://192.168.3.1/ws/stats'), Line: 109

I'll add debug as well to see what causes this.

elad-bar commented 1 year ago

I think that is another issue that should have a dedicated issue for it, this issue opened on CPU usage not changing, As for the issue, it happened once according to the logs you have sent, meaning, could be as the error code presents - the router was not available for a second and then reconnected (otherwise, you would have error every 30 seconds).

this is not releated to the component, the reason why you didn't see it before, it was I didn't log from the first disconnection but the 3rd one, which is wrong.