Openwrt/ubus: Any way to not use root-password?

Hi,

I am following the configuration for Openwrt (ubus) from here.

I created the user hass and changed its password using passwd hass.

I then added these lines into my configuration.yaml:

device_tracker:
  - platform: ubus
    host: 10.1.10.1
    username: hass
    password: !secret openwrt_hass_password

but I am getting these lines in the HA log when restarting:

2025-11-07 21:50:32.159 ERROR (SyncWorker_1) [openwrt.ubus.interface] api_call exception: HTTPConnectionPool(host='10.1.10.1', port=80): Max retries exceeded with url: /ubus (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7e357a3ab8c0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Do I really need to give the integration root-access to my router? I’d rather not do that for ovious reasons, but my attempt at using the hass user has failed…

Any help is appreciated, thanks! :slight_smile:

OpenWrt allows rather fine-grained access to individual features via ACL definitions, it’s possible - but depending on what you want to get access to not necessarily sensible (as you’d effectively just create a root user under another name).

I just want to see who is connected to my network at the moment.

Why do we need to create Hass user at all if the integration needs root anyway?

That errors rather points to a network issue than a permission one.
Did you actually try with the roor user and that worked?

You are right, it was a firewall issue. Sorry and thank you!

Unfortunately it turns out I can’t use the ubus or luci integration since this is also the case for me

In my environment I don’t use the AP on the router, and so it was correctly returning no data. Armed with this information, I know that I cannot use this integration for device tracking or presence.

:confused:

In my environment, I don’t use the main router as access point, but it is still the DHCP provider for my whole network, so I can use luci for device tracking…

Hmm, that’s weird, because no devices show up in Home Assistant when I connect using luci:

According to the doc the devices should show up there, or is that not the case anymore?