I recently set up dual WAN on my ASUS AC68 router, and I wanted a way to be notified if it switched over, especially since I’m on a limited data plan. Here’s how I did it:
First, I configured the router to output system logs to a remote log server. I used Node-RED with the node-red-contrib-syslog-input node to receive these logs. It was crucial to point the router’s remote log server settings to the same IP as my Home Assistant installation.
Next, I set up a Node-RED flow to parse the syslog messages. The key topics I monitored were payload.hostname for both WAN(0) and WAN(1). When the router detects a WAN connection change, it sends a message like “WAN was restored.”
To make this actionable, I created two MQTT binary sensors: one for WAN(0) and another for WAN(1). This allowed me to integrate the status into my Home Assistant dashboard. I also added email and device notifications through Node-RED flows, ensuring I’m always informed of any WAN changes.
For a visual cue, I added a conditional banner in Lovelace that updates based on the WAN status. This setup has been incredibly helpful in managing my internet usage and ensuring uninterrupted connectivity.
If you’re looking to enhance your network monitoring, I highly recommend exploring Node-RED and Home Assistant integration. It’s a powerful combination for custom automation solutions!