OpenWrt (luci)

This is a presence detection scanner for OpenWrt using luci.

Before this scanner can be used you have to install the luci RPC package on OpenWrt:

# opkg update
# opkg install luci-mod-rpc

To use this device tracker in your installation, add the following to your configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file. 在更改了configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件后,重启 Home Assistant 以应用更改。 该集成现在显示在集成页面的 设置 > 设备与服务 下。其实体在集成卡片上以及实体标签上列出。

# Example configuration.yaml entry
device_tracker:
  - platform: luci
    host: ROUTER_IP_ADDRESS
    username: YOUR_ADMIN_USERNAME
    password: YOUR_ADMIN_PASSWORD

Configuration Variables

host string Required

The hostname or IP address of your router, e.g., 192.168.1.1.

username string Required

The username of a user with administrative privileges, usually admin.

password string Required

The password for your given admin account.

ssl boolean (Optional, default: false)

If your router enforces SSL connections, set to true.

verify_ssl boolean (Optional, default: true)

If SSL/TLS verification for HTTPS resources needs to be turned off (for self-signed certs, etc.)

See the device tracker integration page for instructions how to configure the people to be tracked.

This device tracker provides a number of additional attributes for each tracked device (if it is at home): flags, ip, device, and host. The first three attributes are taken from the ARP table returned by the luci RPC. The host attribute is taken from the platform configuration and can be used to distinguish in which router a device is logged in, if you are using multiple OpenWrt routers.

Note

Some installations have a small bug. The timeout for luci RPC calls is not set and this makes the call fail. If you want to locally fix your OpenWrt installation, you can apply the change manually to /usr/lib/lua/luci/controller/rpc.lua, or simply set a fixed timeout. The default is 3600.