OpenWRT WAN-Connection Monitor

thanks for this work, its great.
in which folder do you add the script?
I copied it into every folder, only if I restart homeassistant does it take days until the script is executed once

pls put the script under “/etc/hotplug.d/iface” directory on your openwrt router.

is not executed for me when the internet is down, only if I manually go to restart

chmod +x ?

Yes i have make the script executable

maybe the names of the interfaces are diffrent.
to make sure, you could add env > /tmp/iface.log to the begainning of the script, and check the log later

We should make a feature request for a full fledged OpenWRT integration with Sensors, switches, etc

A lot of open-source enthusiasts use both HA and OpenWRT, so it makes sense to have one.

5 Likes

This would be great, just switched my complete network infrastructure over to openwrt and I’m a bit baffled that it gives much less metrics than my old (commercial) solution.

Also I wouldn’t resurrect the dead (turned off mqtt 2 years ago) to get information from openwrt to ha.

1 Like

For OpenWRT there’s vnstat, bandwidthmonitor/nlbwmon, and statistics/collectd, all with a gui.

Can I get any of feeding it’s data into ha? :eyes:

Not that I know of. For HA I use the upnp/igd integration. It shows WAN KiB/s and packets both ways.

1 Like

Anything special I need to set up on the openwrt side for that?

image

I also searched the openwrt site and can’t find anything particular helpful about this :thinking:

Do you have upnp installed and enabled? miniupnpd or luci-app-upnp.

installed both.
Now it should show up in HA?

If you have enabled upnp in openwrt, I think it should show up in HA

My current setting, but no mention of Openwrt in HA. I can see Fresbtomato and Huwaei but not OPENWRT.

Maybe also tick the ”start upnp/pmp” box?

same result. no UPNP device was found even though Freshtomato and Huwaei are working fine.

So after 2 days, it is working. For uptime, template check my other post

Hello,

i don’t understand how can I monitor my openwrt router in home assistant… do you have a link that explain how to integrate it?

for me it’s enough to have the information above like “uptime”, “current usage bandwidth”, “device connected”…

could you help me?