Unifi - Number of devices connected

I’m using Unifi to track presence of guests so I can keep some parts of the house alive whenever there is somebody watching my kids when I’m away. This all works fine until they activate private wifi in IOS and get a random MAC address

Since all guests use the same wifi network I would like to use a simple count of clients to know if a guest is home and base presence on that

Would it be easy to add a number of connected clients to the unifi integration?

You could use a template sensor (found on this forum):

{{ expand(integration_entities('unifi'))
|selectattr( 'domain', 'eq', 'device_tracker')
|rejectattr( 'state', 'eq', 'not_home')
|list 
|count
}}

I believe this already exists in the form you would need. There is a sensor on the wifi entity that displays connected clients. My wifi is called Mushball

image

Edit - Now noticing older post. Well i’m sure you figured this out by now :slight_smile: