[RELEASE] UniFi Presence Drivers for Hubitat

Which version of Network and UnFiOS do you have?

image

From my understanding, hotspot devices don't have to be added in the driver configuration page like other devices, as they should populate under the single "guest" device?

I have 4.3.9

  • Network 9.4.19 on RPI device.

Correct:

That Guest child device registers as present/no present if there are any guests. It also keeps track of how many guests there are as an attribute.

You shared the debug logs for the controller, can you do the same for the Guest device? It has its own debug logging setting.

The 2nd photo was the debug log from the guest child, nothing showing other than the refresh

I tried deleting and re-creating my guest (hotspot) network, Guest WiFi SSID, and the driver. Same results, all normal devices populate as expected, guest devices not showing up at all, no errors in logging.

Just closing the loop on @halfrican.ak's guest device issue... Turns out if the hotspot landing page is turned off, active guests aren't reported via the API.

That's not a behavior I had seen before, since my landing page was always on. I've tried searching for a way to check that from the API calls but, so far nothing. If anyone that's worked on the UniFi gear has any idea, I'm all ears.

I'll have to make note of this in the troubleshooting in the README.md :wink:

In any event, kudos to @halfrican.ak for figuring this one out.

2 Likes

@MHedish hey Marc, curious if you have a pov on your driver vs. the new-ish in-built app. In your op, you mention some of the nfeatures beyond presence you’ve added — those all make sense. And you also make it clear you’re not trying to be perhaps as attribute heavy as other community options.

But from a pure presence standpoint, do you feel like the built-in app has advantages/disadvantages to this one?

I’m not asking out of judgement, but purely looking to make an informed decision about which one to adopt and use. Thx.

Get. Out. Of. My. Head. :laughing: :laughing: :laughing:

I kid you not, I literally started working on an update to 1.8.x.x today.

Without getting too deep until I finish the next pass, I'll just compare it to my last public release (1.7.5.1).

There are two significant differences:

  1. The built-in only polls.

The UniFi Network application/console does not report data to Hubitat in real time, i.e., with every change. Hubitat must poll UniFi Network for data. After any poll, Hubitat will compare the data returned with devices you have added to the hub and generate events (updating "Current States") as necessary.

My driver accepts push notifications from the controller. That makes it more responsive. You can also do a polled refresh as a backup, but I rely 100% on the push notifications. It's snappy. :wink:

  1. The built-in does not support hotspot clients (guests).

This is a non-starter for me. Not only do I know when guests are connected, I also get the count. Why is this a non-starter?

I have a presence detection piston; when everyone leaves the house, the hub goes into away mode (AC/Heat changes, recirc pump goes off, shades close, lighting changes, etc.). If we have a guest at the house and need to leave (out to dinner, run to the store), the guest is left in a house that thinks no one is home.

There are a few smaller differences (adjustable timeouts, bounce detection, tracking which SSID the wireless device is connected to as well as the AP connection, automatic child device creation, being able to manually force present/not-present (helps stuck devices and rule/piston testing, et al.).

## :sparkles: Features

Parent Driver: UniFi Presence Controller

  • Connects to UniFi Controller / UniFi OS to track presence.
  • Supports optional Hotspot Child for guest monitoring.
  • Automatically creates child devices for wireless clients.
  • Provides summaries:
    • Child Devices → “X of Y Present”
    • Guest Devices → “X of Y Present”
  • Bulk management buttons:
    • Refresh All Children
    • Reconnect All Children
  • Exposes UniFi sysinfo:
    • deviceType, hostName, UniFiOS, Network
  • Resilient design: cookie refresh, event filtering (wireless only), disconnect recovery.
  • Logging options (debug & raw events, auto-disable after 30 minutes).

Child Driver: UniFi Presence Device

  • Works as a Presence Sensor in Hubitat.
  • Buttons:
    • Arrived
    • Departed
  • Tracks:
    • accessPoint, accessPointName
    • ssid
    • presenceChanged (last change timestamp)
    • hotspotGuests, totalHotspotClients
    • hotspotGuestList, hotspotGuestListRaw
  • Syncs name/label with parent device automatically.
  • Normalizes MAC formatting (dashes → colons, lowercase).

Like every other app/driver here, YMMV, pick the one that works best for you (I know I have my favorite :stuck_out_tongue_winking_eye: ).

2 Likes

We have had this exact problem F O R E V E R. I created various half baked ways to count number of guests in the house based on beds slept in, but that was obviously never that reliable. Your solution is wayyyy better.

1 Like

“Guest” is considered a single device. If any device is connected to the hotspot, that becomes present. This make it easy to set rules and pistons without having to know who is actually on the hotspot. No one on the hotspot, Guest becomes 'not present'

One Guest:
image

Multiple Guests:
image

Yeah, that whole counting beds thing gets really messed up when Goldilocks is over. She sleeps in all of them. :wink:

I know you're an RM person, but here's an anonymized copy of my very anthropomorphic piston for reference:

webCoRE piston

I'm almost done with the 1.8.x update.

  • Lots of code cleanup
  • Version checking between the parent and child drivers
  • Parent UI cleanup
  • Limited the number of auto-generated child devices to 50 (configurable).
  • Added a REST call to get the child IP address to go with the MAC (it's not in the WSS payload, so I have to go get it.)
  • Hardened debouncing
1 Like

Just pushed the update to HPM and Git.

v1.8.5.0 (2026-02-15) – Stable Release

Parent Driver

  • Finalized roaming event handling — roaming no longer emits false presence changes.
  • REST-backed IP reconciliation:
    • Added ipAddress attribute to child devices.
    • IP cleared on disconnect.
    • IP hydrated for previously connected devices on refresh.
  • Refined event telemetry:
    • Connect / Disconnect / Roaming classification in eventStream.
    • Improved child creation and duplicate detection logging.
  • Added preference to filter non-managed device events.
  • Added descriptive text for guest/child summary attribute updates.
  • Eliminated redundant wrapper methods (queryActiveClients(), queryKnownClients()).
  • Removed recursive summary updates; stabilized summary emission logic.
  • Performance tightening and dead-code sweep completed.
  • Structural cleanup prior to stable tagging.

Child Driver

  • Added ipAddress attribute.
  • Restored setVersion() method.
  • Improved telemetry and lifecycle cleanup.
  • Disconnect now clears SSID, AP, and IP attributes.
  • Stable alignment with parent v1.8.5.0.
1 Like

Thank you for creating these drivers.

May I delete this device?

Would you please consider adding the 'Block' and 'Unblock' functions (as buttons) that are built into the UniFi UI?

These are useful for disabling kid's devices when they are supposed to be sleeping.

Thanks!

Hi.

You could delete it but the right way to turn off guest support is to simply disable “Monitor Hotspot Clients.”

The driver will delete the “Guest” device by itself and stop monitoring hotspot activity.

1 Like

Perfect, thank you.

I did not depart at 11:34 PM last night...

Appears my wife's phone had the same issue at the same time:

Logs:

Also, can you please not log passwords?

You have a lot to unpack here.

I see one error I need to look into (the NPE).

These logs are only part of what I need to know to help you.

  • What are the controller and network versions?
  • What do you have the refresh interval set to?
  • What do you have debounce set to?

The logs you shared don't show logInfo, they are everything else. What change happened between 10:01:58 and 11:03:26? I see the timeout and then forbidden. All those 429s are the controller locking the driver out for too many 403s.

Update --

I just added a few “backoff” timing methods to stop the auth storm. I've not seen that here before. From the logs you did share, it looks like there was an auth issue, and then the driver got stuck in a self-escalating storm, which led to you being locked out.

As for your remark about logging passwords, I don't log passwords. The password that was exposed was from a JSON payload directly from the UniFi controller. They didn't obfuscate the password in their error message. The error payload is only shown at the logDebug level, not as part of the regular info or warn level. None of the auth messages I generate expose the username or password. UniFi is happily sharing both with us in the JSON. :wink:

That being said, I added a regex cleaner to obfuscate the payloads:

private sanitizePayload(msg)

when dumping the error messages into the debug logs.

I've been trying to get this to work, to no avail. My setup:

Hubitat C-8 Pro v2.4.4.132
UDM-Pro v8.0.12

It appears to connect to my UDM-Pro by looking at the Events tab:

But the logs are showing nothing (except an error):

I tried the "Auto Create Clients" and it did nothing. I tried adding my MAC address manually (all lowercase, with colon separators), and ensured that "Private Wi-Fi Address" is off on my iPhone, I tried manually setting my child device for my iPhone to "present" and it soon thereafter went to not present. Also enabled the guest mode, and hooked an old, unused iPhone to the guest network, and nothing.

One thing is that I do have a number of VLANs set up. One, the main network, is the same as my UDM-Pro name, but most things connect on my IoT Devices VLAN. Should this matter?