OpenWrt (luci)
The OpenWrt (luci) integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] tracks the devices connected to a router that runs OpenWrt with the LuCI web interface. Home Assistant polls the router locally, so you can use the presence of a phone or another device to tell who is home and trigger automations based on that.
Supported devices
This integration works with routers running OpenWrt that have the LuCI web interface and its RPC package installed. It has been used with a wide range of OpenWrt-supported hardware.
Prerequisites
Before you add the integration, prepare your router:
-
Install the LuCI RPC package on your OpenWrt router. Connect to the router over SSH and run:
apk update apk add luci-mod-rpcOn OpenWrt versions that use the older package manager, use
opkg updateandopkg install luci-mod-rpcinstead. -
Have the credentials of a user with administrative privileges ready. This is usually the
adminaccount.
Configuration
To add the OpenWrt (luci) hub to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select OpenWrt (luci).
-
Follow the instructions on screen to complete the setup.
Connect to the router over HTTPS. Enabled by default. Turn this off if your router only serves the LuCI interface over HTTP.
If the credentials for your router change later, Home Assistant asks you to enter the new username and password so it can reconnect. You don’t need to remove and add the integration again.
Supported functionality
For each device it finds on the router, the integration creates a device trackerDevice trackers are used to track the presence, or location, of a device. [Learn more] entity that shows whether the device is home or away. Each entity also exposes the device’s IP address, hostname, and MAC address.
To choose which devices to track and how they are shown, see the device tracker integration page.
Known limitations
Some OpenWrt installations are affected by a small bug where the timeout for LuCI RPC calls is not set, which makes the calls fail. To fix this on your router, you can apply the change manually to the /usr/lib/lua/luci/controller/rpc.lua file, or set a fixed timeout. The default is 3600.
Removing the integration
This integration follows standard integration removal. No extra steps are required.
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.