[Custom Component] Integration with OpenWrt devices

Any OpenWrt device owners here? Thought you could be interested in testing the custom integration I’m working on now: https://github.com/kvj/hass_openwrt

It uses ubus over HTTP.

Features:

  • Sensors:
    • Wireless clients counters
    • Number of connected mesh peers
    • Signal strength of mesh links
    • mwan3 interface online ratio
  • Switches:
    • Control WPS status
  • Binary sensors:
    • mwan3 connectivity status
  • Services:
    • Reboot device
3 Likes

just to be sure that you meant OpenWrt in Router/Modem, right?

I have an OpenWrt installed device but it is not a router, it is Zigbee Coordinator with minimal linux components. More info here: https://github.com/openlumi/openlumi.github.io

Hmm, I primarily meant Router/Modem, but from what I see on Github, this should also work with openlumi, if all necessary packages are installed

I might be interested if it could do iptables / reroute traffic (eg for dns hijacking)? Not sure what is possible with ubus

1 Like

You can execute arbitrary commands and scripts using ubus. Using it, you can do whatever with your OpenWrt device. I could add such feature as a service

3 Likes

Well it look prerry cool already!

I am already using ubus for presence detection. To me it was weird not having an openwrt integration. I would have though lots of people use openwrt…

Lots of possibilities with this component indeed :slight_smile:
Currently i am using Ubus for prencense detection in nodered

Edit:
I just removed and reinstalled the integration in Luci, adding my device names. Any tips on how to convert these into utility meters such as “daily upload” or “monthly download” on each interface?


Original post:
Thanks for this integration! I’m trying to get some OpenWRT stats into my HA and this looks really good (and easy compared with the SNMP path that would probably solve the same problem but require more configuration).

So I’ve set it up according to the README, everything is fine. The only issue now is that I forgot to add my lan/wan device names and now I can’t figure out how to get back to the nice initial setup dialog in Luci. Clicking on “Settings” for the integration does not bring that dialog back. Is there any other way I can insert the comma-separated list of devices or do I have to remove and reinstall the integration?!

Can you explain how?

Yes, ubus installed on openwrt an connect to it from nodered.

Edit: i looked it up, i think i followed this guide OpenWRT (ubus) - Home Assistant 中文网

But it is changed since then so YMMV.

Its been years though, now i dont have openwrt anymore

It was the connect to OpenWRT with Node-RED that piqued my interest. :slight_smile:

Ahh, i used http like this:

But like i said i switched away

1 Like