Home Assistant device tracker which uses OpenWRT's ubus.
- Install HACS - HACS Setup.
- Add
https://github.com/teddybeermaniac/HomeAssistant.UbusAdvanced
repository to HACS - HACS Custom Repositories. - Install the integration using HACS.
- Create a
/usr/share/rpcd/acl.d/homeassistant.json
file. Adapt/tmp/dhcp.leases
according toleasefile
options in your/etc/config/dhcp
configuration file (you can use wildcards here):See OpenWRT Wiki ubus/ACLs for more details.{ "homeassistant": { "description": "HomeAssistant Ubus Advanced integration", "read": { "file": { "/tmp/dhcp.leases": [ "read" ] }, "ubus": { "file": [ "read" ], "hostapd.*": [ "get_clients", "get_status" ], "uci": [ "get" ] }, "uci": [ "dhcp" ] } } }
- Add
/usr/share/rpcd/acl.d/homeassistant.json
to/etc/sysupgrade.conf
file to prevent it from being deleted during upgrade. - Add a section to
/etc/config/rpcd
. The password can be generated usinguhttpd -m password
:See OpenWRT Wiki ubus/Authentication for more details.config login option username 'homeassistant' option password '$1$$I2o9Z7NcvQAKp7wyCTlia0' list read 'homeassistant' list write 'homeassistant'
- Restart rpcd
/etc/init.d/rpcd restart
.
- Add device tracker to
configuration.yaml
. Use your router's IP, or hostname and username, and plaintext version of password that you added to/etc/config/rpcd
:See Home Assistant device_tracker for more details.device_tracker: - platform: ubus_advanced host: http://192.168.0.1 username: homeassistant password: password # Example options ssid_blacklist: - Guest WiFi
Name | Required | Default | Description |
---|---|---|---|
host | ✅ | IP/Hostname of your router | |
username | ✅ | username from /etc/config/rpcd section |
|
password | ✅ | Plaintext password from /etc/config/rpcd section |
|
mac_blacklist | [] |
Device MAC address blacklist | |
mac_whitelist | [] |
Device MAC address whitelist | |
name_blacklist | [] |
Device DHCP name blacklist (supports wildcards) | |
name_whitelist | [] |
Device DHCP name whitelist (supports wildcards) | |
ssid_blacklist | [] |
SSID blacklist | |
ssid_whitelist | [] |
SSID whitelist | |
device_provider | hostapd |
How to acquire device list. One of: hostapd |
|
name_provider | dnsmasq |
How to acquire device name mapping. One of: dnsmasq |
Other common options can be found in Home Assistant device_tracker.