Get number of devices in a wifi network?

I am looking for a way to track how many people are connected to my guest network.
I thought I could use the nmap tracker, but that “just” get’s me a device_tracker per device, based on mac addresses.
I need a way to get the total though.

Does anybody have an idea?

SNMP if available or possibly an integration for the router, depends on the router.

You could create a template sensor that counts the number of device_tracker entities created from a network or router source.

something like this…

{{ states.device_tracker
    | selectattr('attributes.source_type', 'defined')
    | selectattr('attributes.source_type', 'in', ['router', 'network'])
    | list
    | count }}

If you take a look in your ‘states’ list in Dev Tools, you’ll see that device_tracker entities can be created by different sources. In my environment i have them coming from my tp_link & pfsense ‘router’ integrations & from ‘gps’ integrations (h-a mobile app & Tile tracker).

My (Ubiquity) Unifi integration provides that number as a sensor. What router do you have?

Thanks all! I am using openwrt 24.10

@Hellis81 , I’d rather not give HA access to machines in my management vlan. Not that I don’t trust HA, I just don’t trust myself to configure it correctly.

@nickh66 That’s an interesting idea, thanks!

I am considering writing something myself in appdaemon.

$ sudo nmap -sn -PR -T4 --min-rate 10 --host-timeout 2s 10.1.100.0/24 -oG -|awk '/Up$/{print $2}'
10.1.100.1
10.1.100.12
10.1.100.115
10.1.100.153
10.1.100.140

That seems like easily grepable output.

SNMP v2c have a pretty simple access control.
It is user name and password and then set if it is read or read/write access.

Typically a public use name with no password and read access is defined per default already.