I have seen a few other Unifi ubiquiti api drivers but they required additional systems to run code on and I really wanted a driver that only ran on the hubitat. Now that the new ignore ssl feature is available it is possible. So you need to be running 2.1.8.117+.
This is very early stages just been using it on two cell phones for now.
Just wanted to see if others were interested in a hubitat only option?
Working on adding a block function. Want to be able to block the kids devices, really my main reason for getting the API going but the presense was a little easier to start with.
Update: Added another child driver for managing blocking and unblocking a device. If unifi is not blocking it will match a switch on if its blocked it will match a switch off. Thought this would be best to relate to the client. That way with your assitant you can ask it to turn off a device. Which would then block the device from joining wifi.
There is a function that every hour will check to see if the device is blocked or not to update the status just in case it gets out of sync. For that to work you have to put the device id info in the Preferences Client ID box. To get the ID click GetClientID. Will show up as _id.
Note: It does not currently work with UDM-Pro that runs the new UniFi OS.
Update 7/2/2020: Added driver to Hubitat Package Manager, so that you can install and update it easier.
I am interested.. I have one under development myself, but nothing working yet. I have too many other projects going so I would much rather someone else do it..
Very interested. Didn't realize ignore ssl was needed to solve this one. I've installed the 2 drivers, it works nicely so far. What's on the Todo list, where do you need help? Refresh is needed. And they should become apps instead of drivers.
Awesome! I'd been looking at their API before, but really couldnt get much "good" documentation on it. I'll be adding this, thank you!!
Update
Added my cell, and working great! Could I ask that the port used be a pref?
I'm not using 8443 here, so had to update that in the code, but once I did and logged in, all was great!!
And feel free to tell me to "do one" here, but number of seconds would be another good Pref to add in the Child driver, so you can vary between a cell or other network device, then you could raise an alert based on "not present" for anything which may "drop off" the network.
This would mean I could extend its use for ANYTHING which may drop off my network, other Hubs (Hue, Harmony etc) or my Sonoff temp sensor (for the aqaurium), then raise the alert. I think that would be a very nice addition! I'm currently using Homeseer and Pushover for alerting me on my hubs, but would mean that I could do away with Homeseer with this
This is an awesome driver, many thanks for creating!!
One thing I have noticed is, I cant seem to delete a child, no errors, it just doesnt delete.
Scratch that. just tried using the dni, and its gone
Presence on a network is not stateful. So I would bet that Unifi does a periodic check, then marks the devices as on or off network. So we have sort of a dual timeout period (one on Unifi and one on the HE). Just the nature of the integration.
I am. Unifi in docker changes the default name/site behind the scenes. Now that you mentioned it, I did need to change something in Node-Red as well. The Docker name of my site is nnrtpaqs
Edit: I changed /default/ in the driver to /nnrtpaqs/, and it worked. Thanks for the tip off above.
I'm really curious if this is any more reliable than the iPhone WiFi presence app? Not due to a fault of either app but due to the fact that phones tend to shutdown WiFi to conserve battery between email checks or push notifications.
I would try this however I'm not running firmware 2.1.8 since I have had issues with things slowing down on firmware updates so I've stayed at 2.1.5 for a while now, although since the new year things are intermittently slow on that firmware now as well so I will likely update soon.