Toggle guest mode via wireless network clients?

I saw somewhere that somebody was enabling guest mode for their home based on the presence of clients on a specific SSID/guest wireless network. Pretty sure they were using Unifi equipment, but I cannot find where I got this idea from. I’ve looked at Unifi presence detection, but I don’t want to track Home/Away states for guests, just that they are present.

Does anybody have any ideas about how to accomplish this or where I may have seen it? My google-fu is failing me.

There are some sensors for detecting devices on the local network, but I’ve found they don’t work very well with cell phones. Cell phones have this nasty habit of trying to conserve power, and in the process not responding to network pings, etc. very consistently.

I don’t know if this would work for you, but I’ve found that using IFTTT with a Location trigger and a Webhooks recipe works fairly well. The downsides are since HA doesn’t have users yet, you have to use HA’s one and only HTTP password to make this work. Then a simple automation updating an input_boolean can determine if that device has entered or left the defined area and record it as such.

Anyway, if that sounds at all interesting to you I can share more details. Or if I completely missed what you’re trying to do, or if other people have better ideas, then “never mind”. :slight_smile:

I’d been looking into this by extending the Unifi component so that you could get a numeric value of the number of wireless clients connected to a specific SSID. I never got around to implementing it though. Does anyone here know who the main contributor for that component is, so we may request a feature?

@pnbruckner I’m trying to setup network detection in addition to location tracking. Also, I’m cloud averse and avoid things like IFTTT. Thanks for the suggestion though.

@keatontaylor I ended up getting this done via Node Red using the Unifi module. The module makes a call into the Unifi API to fetch all current clients. Each client has an is_guest flag that is determined by the guest policy configuration on the Unifi controller. In my case, the guest policies are applied to a specific SSID.

It would be pretty easy to add a binary_sensor to the HA Unifi component that is triggered when any clients have this flag. I’ll look into making that update. No need to wait on the main contributor for the component. Don’t you love open source?

Works for me, a binary sensor would work perfectly in this case if any client has the is_guest flag. Thank you

Gotcha. FWIW, like I said, detecting devices on the local network can be done several ways. The problem seems to be knowing when the devices are actually no longer present. Just because they don’t respond anymore doesn’t mean they’re gone. And there doesn’t seem to be any consistency, so I’ve found it’s kind of hard to tell how long to wait to conclude they are indeed gone. It would seem some sort of active application is required on the phone to get it to reliably update HA.

Yep, understand. One of the reasons I moved from ST to HA. I haven’t personally tried it, but I’ve seen reference to an app called Tasker. I wonder if that (or something like it) would help.

Multiple approaches combined via bayesian binary sensor is my end goal. Should smooth out the short comings of each approach (once I get it tuned).

1 Like