Ubiquiti EdgeRouter X as device traker

I am using Ubiquiti EdgeRouter x as my primary router which doesn’t have device tracking in HA so I wrote python application to track the devices/clients getting connected to my router and then update HA!
Best part is this is event based and no polling so it is instantaneous!

Setup is simple and need only one configuration change in EdgeRouter X to enable system log to send data to your configure IP:Port address.

I have more details on my github page.

Please feel free to ask any question/suggestion/bug if you have.
Enjoy!

8 Likes

Great work. Going to check it out when I have installed my Edgerouter.

1 Like

Trying the install via the python command (python3 erx_main.py .) and getting port in use error. Nots sure why - any idea?

20:13:02.048:debug: ErxMonitor: Start Edgemax syslog monitor loop
20:13:02.048:debug: ErxSyslog:monitor(): enter
20:13:02.049:error: ErxSyslog:monitor(): Exception [Errno 98] Address already in use
20:14:02.109:debug: ErxSyslog:monitor(): exit

Edge OS v1.10.5

Most likely the port you have configured in the config.yaml (default is: 514) used by some other application.
You have two options to solve this:

  1. Change the port for erxsyslog to some other port by modifying the config.yaml and obihai syslog port
  2. Change the port of the application which is already using the port you are trying. Depending on which OS you are running you will have to find out the application/process using it.

I am not 100% sure but I remember some other person had to run this with sudo. If you want you can try same command with sudo like:

sudo python3 erx_main.py .

But keep in mind that you are giving root access to the process by running with sudo and this is usually not advisable.

Hope this helps.

Thanks wil investigate further, not sure what other application would be using it. Had to enable it on Ubuntu 18, so not making sense. This was run as Sudo, permission denied otherwise.

Will it work with Hass.io or (if not) is there any alternative? I’m interested in devices tracker and maybe some statts (dl/ul bandwitch).

Yes, it should work!

FYI…As I was looking for a device tracker component for HASSIO, I just came across this:

I just installed it and it works just like my previous netgear router.
Any benefits of using your solution instead?

Thanks!

Is this still working?

It should, I am using it!

Just read that this may only do connection detection and not disconnect. Is that right?

If so, it is not what I am after.