I'm afraid I've only used the ubiquiti wireless stuff, not their routers.
I'm a Mikrotik router guy I'm afraid, and getting those set up right can be a slow process if you have a moderately complex network.
Be aware that the Zero Handoff stuff on unifi sounds like a great idea, but can have problems in use. The behaviour can be a bit strange - my phone would regularly roam to the living room AP from the bedroom, despite being 4 feet from the bedroom AP. There's a lot more to it, but I'd advise reading the ubiquiti forums, where the Ubiquiti staff seem to spend their time telling people not to use the zero handoff!
Anyway, my quick hack looks like this:
- Code: Select all
from unifi.controller import Controller
uc = Controller('192.168.1.12’, 'admin', ‘password’, '8443', 'v4')
clients = uc.get_clients()
edFound = False
lisaFound = False
for client in clients:
#indigo.server.log(client['mac'])
if client['mac'] == 'c1:ee:f1:50:4d:11':
edFound = True
if client['mac'] == 'd1:21:be:ed:1e:11':
lisaFound = True
newVar = indigo.variables["EdPhoneHome"]
if edFound:
indigo.variable.updateValue(newVar, "true")
#indigo.server.log('Ed found')
else:
indigo.variable.updateValue(newVar, "false")
#indigo.server.log('Ed NOT found')
newVar = indigo.variables["LisaPhoneHome"]
if lisaFound:
indigo.variable.updateValue(newVar, "true")
#indigo.server.log('Lisa found')
else:
indigo.variable.updateValue(newVar, "false")
#indigo.server.log('Lisa NOT found')
You'll need this:
https://github.com/calmh/unifi-apiI just run it on a scheduled task and know whose phone is home.
It was a quick hack/proof of concept which I was thinking of turning into a plugin, but not got around to yet.
Hope it's helpful to someone.
Ed.