Custom component: EdgeOS

Ok, just found out a way to view all the messages from Chrome

  1. Access the router login page (pre-login)
  2. Oepn Developer Tools (F12)
  3. Go to Network tab
  4. Login
  5. Search in the list of resource’s name “stat”, click on it
  6. On the right will be opened a control with Headers, Frames and Timing
  7. Click on the frames

Can you send list of the data (unique keys)?

Example from my router:

Thanks

Here’s the screenshot:

It seems like the SUBSCRIBE message contains all the keys you’re looking for.
2019-03-24%2018_51_09--%20ubnt

btw, the eth0 in your example is your internet connection, right? Not your internal network. (not sure if that would matter)

eth0 is internet rest are local.

The weird thing is your export messages are empty, did you yurn it off in the traffic analysis?

I think I found the problem,

Please run the following command in your router’s console:
show ubnt offload

at the end of the response you should have:
Traffic Analysis :
export : enabled
dpi : enabled
version : 1.422

If the export is disabled that’s probably the issue

1 Like

Yup… DPI was turned off.
Didn’t think I needed it the last time I setup my router… :disappointed_relieved:

Thanks for helping!!! :smile:

great! let me know if it solved the problem…

Well both eth0 and my phone data are updating. My phone now shows up as connected and also a device_tracker is added. However now it doesn’t want to disconnect (I’ve disabled both wifi, my VPN and waited at least 5 minutes). :stuck_out_tongue:
I’ve set DPI to both fully enabled and host only, but that doesn’t seem to matter. The device still shows up in Traffic Analysis but rx/tx are both 0, just like in HA now.

Do your devices still show up in Traffic Analysis when they’re disconnected?

As far as I remember, it takes time until it gets the update (export still sends the IP, which causes the component to treat it as connected)

Today I did see that the device connects and disconnects, but the disconnect takes a long time. About an hour.
I will try to search in my router if I can change something to improve that.
Other than that everything seems to be working :slight_smile:

Hi all

I updated the component in GitHub, added new service to log all events in HA log file (DEBUG)

1 Like

I created a centrelized repo for all my custom components with custom_updater support (and versioning)

Hi @bar,

Nice component you’re working on.

I’m trying to get this custom component to work. Sadly I don’t succeed.

I created a user on my Edgerouter Lite 3 and gave it the role as an operator.

I copied the files __init__.py, const.py, device_tracker.py, home_assistant.py, services.yaml, web_api.py, web_login.py, web_socket.py to /config/custom_components/edgeos/

I copied edgeos.json to /config/custom_components/

I added the following to the file configuration.yaml:

edgeos:
  host: !secret edge_os_host
  ssl: false
  username: !secret edge_os_username
  password: !secret edge_os_password
  monitored_interfaces:
    - eth0
  unit: 'M'

I edited secrets.yaml and added:

edge_os_host: 192.168.100.1:443
edge_os_username: ha_user
edge_os_password: SomeSecretPhrase

Next I restarted hassio. After this hassio says: Setup failed for edgeos: Component failed to initialize. With more details in the logfile:

2019-04-07 12:02:31 ERROR (SyncWorker_12) [custom_components.edgeos.web_login] Failed to login, Error: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), Line: 52
2019-04-07 12:02:31 ERROR (MainThread) [homeassistant.setup] Setup failed for edgeos: Component failed to initialize.

What am I doing wrong?

Greetings

In secret - edge_os_host should be just the hostname or the ip

In configuration SSL should be true

If I do so, then I get this error:

2019-04-07 20:15:38 ERROR (SyncWorker_10) [custom_components.edgeos.web_login] Failed to login, Error: HTTPSConnectionPool(host='192.168.2.254', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))), Line: 52
2019-04-07 20:15:38 ERROR (MainThread) [homeassistant.setup] Setup failed for edgeos: Component failed to initialize.

I don’t have an official certificate, only the default self-signed certificate on de Edgerouter 3.

Did you set the ssl flag to true?
You got into line in the code that indicates that the ssl is false

Arghh! Stupid. Tried so many things! I had also made a package of it. That bit each other.

No more errors. Thanx for your time!

wouldn’t it be better if the custom_updater component was part of the edgeos component?

Not sure I understand what you mean,
It uses the custom updater which is different vustom component not developed by me

Understood. My bad :wink:

Can the uptime be measured in days?

2019-04-09%2020_31_48-Home%20Assistant