Unifi router vs WAP configuration

I have configured presence using the unifi platform using my controller and it works but I do have a couple questions.

  1. Can I limit the range of IPs that it tracks? I have a lot of devices with new ones coming in weekly so I’d rather not constantly be editing my known devices to ignore these. I have the devices I want to track in a narrow IP range. I could do the same with MAC addresses too.

  2. I’d like to use my various AP to track presence at room level while using the controller to track general home/away. How do I configure this?

Here’s my current working config with the IP of my cloud controller. Do I setup the WAP the same way? I can’t get to a login page using the IP of any of my APs like I can with my controller.

  - platform: unifi
    host: 192.168.1.xxx
    port: 8443
    username: !secret unifi_user
    password: !secret unifi_password
    verify_ssl: False

I haven’t used it myself but i think this property does what you want:

In WAP:

ssid_filter
(list of strings)(Optional)Filter the SSIDs that tracking will occur on.

Default value: None

I’m not sure how unifi creates the ssids. I believe if you populate that filter list, only those devices will appear in HA.

Use below in unifi config and then manually enter the devices you want tracked into the known_devices.yaml File

new_device_defaults:
      track_new_devices: 
      hide_if_away: False

Can I manually add new devices to known_devices.yaml? I thought it auto-populated and I could changed values but not add or delete.

Oh, I assumed the SSID was my wifi network SSID and not the AP name. What’s weird is my known_devices.yaml auto-populated every device on my network but none of my unifi devices were auto-discovered.

I’m thinking I need to do something with ping to actually track back to my connected AP. I need to do more research.

Pretty sure you can add.

Other config options here

Ok. I see that. I guess my biggest question is - will this give me room presence or just home presence? I have a bunch of APs that I’d like to use to track users’ location. I don’t see any state information that could be used. Am I missing something?

Home presence…there like a 5-15min delay for away/home. This also required person to have device to be detected.

Motion detectors are better for room presence

Also look at FIND for room based presence using wifi. I set that up in 15 minutes and yes…it works amazingly well. I dindnt actually use with HA but it has great potential for (tracking guests in home or customer in store to specific area/room)

FIND looks interesting. Sadly, we are an IOS house. Someone really needs to be a switch/outlet with a beacon built into it. That would make for interesting possibilities.

I’ve been kicking around the idea of room/area presence in my head. The more context that is known, the better the potential automation. I agree that using a phone is somewhat limited since it relies on having a device but in my household that device is rarely more than an arms length away. I thought about motion sensors but my wife and I have vastly different patterns, habits, and needs and motion is so ambiguous. I’m also not sure how it does with directionality, which is actually pretty important. I need some combination of mode/context, person, room/area/location, and direction of movement. Automating intent based on rules and conditions is never going to get me all the way there. I wonder if I would be better off doing this with Google/Alexa.

Wired beam PIR on both sides of door with PIR covering interior room would cover both room presence and direction.
Beam 1 inside door room 1(room entry)
Beam 2 outside door room 1(hall entry)
Motion 1 inside room (room presence)
motion 2 outside room 1(hall presence)

So if they are tripped in this pattern
Motion2 ON>>Beam2 ON/Motion2 OFF>>beam1 ON>>Motion1 ON/Beam2 OFF>>Motion1 ON/Beam1 OFF
You know a person has entered the room

Beam provide ability to count person’s entering room vs just knowing they are there. Problem is Limit there is still possibility of people entering/exiting side by side or in manner that throws of count. Then you must reset count some how

Honestly I found wired PIR provided enough context on presence when I used them in previous home with HA.

When I was away I could tell if family in bed by looking at motions “last on” time. This paired with TV and lights ON provided enough to know in bedrooms or not and guess if sleep.

Zwave PIR are not good for this as they have delay before trip again. They can provide info to low use area or when accuracy is not important but I find they have limit. Accuracy here is down to 4minute maybe less if you sacrifice battery life.

Wired PIR we’re instant and very accurate for me. I could see movement down to second and could basically tell direction of movement with 2 or less person’s in 1200sqft home with 5motions place in main rooms. Adding motions covering smaller areas could increase this and possibly provide all info you need for presence.

I previously used a laser beam with a relay outside to fire off my first generation Arlo cameras to avoid the lag. It was rock solid but expensive and would be tough to implement inside in a way my wife would find acceptable. The PIR is interesting. Assuming wired means connected to house electricity vs battery?

Looking at the state of devices to determine context is an interesting idea. I’ve been thinking of it more as, “it’s late so I want to turn off the tv, turn on pathway lighting, turn off main lighting, etc and go to bed,” but I could also think of it as, “it’s late and the state of the TV has changed and pathway lighting was turned on, so it’s probably time for bed so automate the rest.” There would be false positives but the idea of using pieces of a routine as triggers/conditions is one I hadn’t really considered.