I am using Asus router with Asuswrt-Merlin custom firmware. Other than using it as device tracker, I hope it can also report these as sensor value to HA…
Which WAN connection is active for those who is using dual WAN setup.
WAN upload/download speed. Speedtest.net component is not accurate if other devices are downloading something from the Internet.
WAN connection status as binary sensor. On if connected. Off if disconnected.
VPN users connection status as binary sensor.
Other data like temperatures, CPU load, RAM usage, storage usage and uptime.
I came across this post when looking for a solution myself, to see if there was a way to detect if i was on the Secondary WAN (which has a limited data plan).
After couple of hours I worked out i can use Syslog.
Pretty sure you could fetch the “new firmware available” flag somewhere in nvram or files inside your Asus router using command_line sensor with SSH access.
Heres mine. Just got it working “again” last night. I struggled badly with HA & Asus SSH Auth keys for quite a while. btw… a VPN switch ON-OFF (or many of them) is also doable.
Sorry for my ignorance. I assume I need to generate SSH Auth Key from my Asus router and save it in /config/ssh/openssh3 which is in the same server as HA?
This is what I tried…
Launch PuTTYgen from my PC and generate a public key and a private key. I selected SSH-2 RSA as the key type and number of bits is 2048. The private key file is named as “asuswrt.ppk”. HA is in another computer.
I copied the public key and paste it into the Asus router setting (Advanced Settings > Administration > Authorized Keys)
I uploaded the asuswrt.ppk file in the root of my HA config folder.
lol. Turns out I didn’t quite have my Asus Hassio Putty SSH Issues sussed out just yet 3 days back.
I think I do now after umpteen times trying. That and I “rebuilt” my Asus-Merlin router in the mean time.
Here are two of the pages/walkthroughs I just used to get all my SSH keys figured out.
For now anyways.
Heres another start Ben. This is in my configuration.yaml btw.
Not switches.yaml. Not sure why but otherwise wont pass config check.
And… service start_vpnclient2 and service start_vpnclient3
service start_vpnclient4 etc etc
Thanks! Do you know how to store this part; ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/ssh/key5publicopenssh [email protected] -p 44 as a variable and then keep on reusing the variable in all the the command_line sensors and switches?
That’s a good question. It would be nifty if you could.
I have no actual true clue but… HA keeps secrets! aka usernames and passwords etc. I wonder if that same theory could be used for that SSH snippet.
Save them in a .yaml file and call them up when needed with just a few letters instead of all that type.
Would save a slew of typing/copying/pasting wouldn’t it?
Maybe you will be interested in the custom AsusRouter integration I am developing (available in HACS). With the latest release, there was control of OpenVPN Clients added.
Also, it just has lots of sensors, which will probably never make their way to the core AsusWRT integration.