Custom component: EdgeOS

There might be warning messages of:

  • websocket disconnection, the new mechnism restores it without issues (as long as the router is working)
  • timeouts from time to time, while accessing heartbeat to the API

I’m about to release new version that will change those warning messages to info since the component is self healing now

2020-05-17

Fixed bugs:

  • Fix incorrect error message displayed when WebSocket or API request failed
  • Fix retry mechanism of API requests
  • Fix integration’s options error when device or interface list is empty

@bar upgraded to the latest version, reliability is really good still - will let you know of any observations

Hi @bar it could be just me, but I’ve noticed large database growth since installing the edgeos addon. Any tips on how to manage this?

Hi guys, how can I show the interface speed on Mbps like the EdgeOS web UI?

image

Not sure I understand your question,
Did you set the monitored interfaces to include the desired interface?
How do you present it? HA / Grafana?

I just want to see the units in Mbps, but the custom component has Bytesm KBytes or MBytes, I´ve added a template to make the conversion, I´m not getting the same values as the edge os router webpage

edge_eth0_20_in:
        friendly_name: "Edgerouter EthO In"
        unit_of_measurement: 'Mbps'
        value_template: "{{ (state_attr('binary_sensor.edgeos_interface_eth0_20', 'MBytes/ps (Received)') *8) | round(1) }}"
    edge_eth0_20_out:
        friendly_name: "Edgerouter EthO Out"
        unit_of_measurement: 'Mbps'
        value_template: "{{ (state_attr('binary_sensor.edgeos_interface_eth0_20', 'MBytes/ps (Sent)') *8) | round(1) }}"

Hi, I just started using the integration and it’s working pretty well except for one thing. My ‘monitored devices’ dropdown is empty. Is there anything I need to set in EdgeOS for devices to appear here? Thanks

Typical, within an hour of posting I figured it out. If anybody else has the same issue - you have to set a static ip within EdgeOS, then it will appear on the ‘monitored device’ list in home assistant

1 Like

Did some of you tried to update to beta 0.113? I got this error like 200 times and actually let the update fail and HA rolled back. By removing the integration HA did update. Now I’m wondering if this is an HA problem or an integration problem.

2020-07-18 08:54:45 ERROR (MainThread) [custom_components.edgeos.managers.entity_manager] Failed to update, step: Start updating domain sensor, Error: 'sensor', Line: 145

checked with Home Assistant 0.113.0b3, it works without that error,
are you on using that beta version?

thanks

Yes, I’m on that beta now. I added the integration again and restarted. The error appears again and HA doesn’t restart totally. Once I delete the integration HA directly says it has started.

In an issue on github bdraco mentioned it might has something to do with this.

Not sure why you think a fix I performed 3 weeks ago before 113b was available is the cause for the issue, for me it works,
Set up a clean HA for testing purposes, installed the component and it works.

Can you please share the details about the machine running the HA?
CPU, RAM, number of integrations in HA and overall load during startup of HA

Thanks

2020-07-23

Implemented enhancements:

  • Moved encryption key of component to .storage directory
  • Removed support for non encrypted password (Breaking Change)

Fixed bugs:

  • Better handling of password parsing

Is the MBytes/ps a calculated value or is it retrieved directly from the EdgeOS device?

I was wondering because I want to graph this value but having the HA Recorder save the value every 1 second seems to kill my hard drive. So I increased the Update Entities Interval value from 1 to 60 seconds. Though after I changed to 60 seconds it seems this value is just grabbing the current MBytes/ps value and not a calculated value of what has been transferred over the interface in the last 60 seconds.

I am getting following error in log when trying to setup edgeos,

I have 8443 as my https port instead of default 443. not sure if that is issue here.

2020-08-16 01:04:15 ERROR (MainThread) [custom_components.edgeos.clients.web_api] Failed to login, Error: Cannot connect to host https:443 ssl:False [Try again], Line: 109
2020-08-16 01:04:15 WARNING (MainThread) [custom_components.edgeos.managers.config_flow_manager] Failed to login EdgeOS EdgeOS due to HTTP Status Code: 404
2020-08-16 01:04:15 WARNING (MainThread) [custom_components.edgeos.config_flow] Cannot complete login
2020-08-16 01:04:15 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/cryptography/fernet.py", line 87, in _get_unverified_token_data
    data = base64.urlsafe_b64decode(token)
  File "/usr/local/lib/python3.8/base64.py", line 133, in urlsafe_b64decode
    return b64decode(s)
  File "/usr/local/lib/python3.8/base64.py", line 87, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 145, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, 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 201, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/edgeos/config_flow.py", line 62, in async_step_user
    schema = await self._config_flow.get_default_data(new_user_input)
  File "/config/custom_components/edgeos/managers/config_flow_manager.py", line 157, in get_default_data
    config_data = await self._config_manager.get_basic_data(user_input)
  File "/config/custom_components/edgeos/managers/configuration_manager.py", line 59, in get_basic_data
    result.password_clear_text = await self.password_manager.decrypt(
  File "/config/custom_components/edgeos/managers/password_manager.py", line 56, in decrypt
    decrypted = self.crypto.decrypt(data.encode()).decode()
  File "/usr/local/lib/python3.8/site-packages/cryptography/fernet.py", line 74, in decrypt
    timestamp, data = Fernet._get_unverified_token_data(token)
  File "/usr/local/lib/python3.8/site-packages/cryptography/fernet.py", line 89, in _get_unverified_token_data
    raise InvalidToken
cryptography.fernet.InvalidToken

Hi, why this Integrations are not found in my home assistant? EdgeOS

Install the component in the Community Store first and then you can find it in Integrations

Installed it using HACS,
I can see files in \config\custom_components\edgeos
But still nothing in Integrations.
What i’m doing wrong?

1 Like

Here’s the answer: