Page 1 of 1

Using Unifi for home states

PostPosted: Thu Aug 03, 2017 10:00 am
by Sharek326
Last night I setup both my wife and I IPhones into a group in unifi and setup the away trigger to change the state of the house away when both leave the AP. I only use one AP since my house isn't to large 2000 SQ feet. But now when my wife walks to the side yard it seems to go away even though she's still on the network. Is there a setting I am missing or should I add a second AP

Re: Using Unifi for home states

PostPosted: Thu Aug 03, 2017 4:48 pm
by kw123
Check the expiration times.
Also do you use just the ap or also the gw or switch.
If you use one of these it will use the first one that finds the device to set the parameters.


Sent from my iPhone using Tapatalk

Re: Using Unifi for home states

PostPosted: Thu Aug 03, 2017 4:50 pm
by Sharek326
I use a 24 port Unifi Switch and Gateway as well. I assumed because its a iPhone it would go off the AP. I set them to 5 min now it was set to the default setting

Using Unifi for home states

PostPosted: Thu Aug 03, 2017 5:32 pm
by kw123
the expiration times ( AP, GW, SW) on the unifi devices vary quit a bit. the longest time is the switch or GW = DHCP if you use that.
the AP has the shortest "forget time" .

The plugin offers many options for AP, GW, SW. If it is wifi I suggest to use AP/ optimized option.:
Screen Shot 2017-08-03 at 18.24.29.png
Screen Shot 2017-08-03 at 18.24.29.png (46.53 KiB) Viewed 3455 times


the plugin uses 2 channels to get info:
1. get the unifi database every xx seconds (30-90) from the UG/SW/AP
2. listen to the log files on the unifi devices for any relevant changes.

For wifi the AP-logfile offers the fastest info. When connecting the log file -> indigo plugin sees newly attached device within 0.5-1 secs.
Also when actively detaching (not just leaving range) = switching wifi on on your icon. it goes fast as well. when walking out of range there is no message in the log file. then we need to look at the database

the database info (dict) get requested by the plugin every xx seconds. Then the plugin reads the dict and determines if the device
- is listed at all
- or has changed parameters ( e.g. uptime, idle time ...)
then depending on the settings it determines if the device its still there or not..
Those are the parameters shown in the screen shot. You can also see these states in the device state list.
==> optimized tries to use all info available.


hope that helps

Karl

Re: Using Unifi for home states

PostPosted: Sat Sep 09, 2017 10:03 am
by Different Computers
On a related note, could you explain the difference between the expired and down statuses when detected by the AP?

I have some devices that seem to have been expired for more than a month, and others that shifted to down after a short period of time.

Re: Using Unifi for home states

PostPosted: Sat Sep 09, 2017 11:40 am
by kw123
up --> down =xx seconds with no signal
down--> expired = xx seconds with no signal

xx = expiration time you can set in config

xx=90 seconds:
down = no signal for >= 90 seconds < 180 seconds
expired = it is gone for >= 180seconds

Karl

Re: Using Unifi for home states

PostPosted: Sat Sep 09, 2017 12:18 pm
by Different Computers
So the order of device statuses from on to off the network is UP DOWN EXPIRED?

I had assumed UP EXPIRED DOWN.

Re: Using Unifi for home states

PostPosted: Sat Sep 09, 2017 1:40 pm
by kw123
Up down expired.
And back to up if any signal

Just picked that some years ago in fingscan and have that used in all plugins.


Sent from my iPhone using Tapatalk

Re: Using Unifi for home states

PostPosted: Tue Sep 12, 2017 11:22 am
by mundmc
Hey Karl, I hope this isn't thread-jacking- I'm wondering if your Unifi plugin offers any obvious advantages I'm missing to your fingscan, which I have used for two years and love.


Sent from my iPhone using Tapatalk

Re: Using Unifi for home states

PostPosted: Tue Sep 12, 2017 11:56 am
by kw123
fingscan = my first big plugin , historically from, fully debugged, uses FING to passively and actively scan the network, can add ping to test if device is up. very fast

unifi: get all info from unifi devices to indigo. one of my latest plugins, more mature, likely few bugs. does not actively scan the network.but if you use the switch & Gateway & AP you have it covered.
is better for wifi devices than fingscan

I would say 80% overlap

Re: Using Unifi for home states

PostPosted: Tue Sep 12, 2017 1:27 pm
by Different Computers
As for the "likely few bugs" I'm pretty sure I've never seen a single "mission critical" problem from this plugin, which I've been running on just an AP for about a year now. And I've certainly created a few problem of my own with it from failure to understand all of its features!

@kw123, you need referral credit from Unifi, whom I otherwise would never have considered purchasing from!

Using Unifi for home states

PostPosted: Tue Sep 12, 2017 7:17 pm
by kw123
With a few I meant not so many.


Sent from my iPhone using Tapatalk

Re: Using Unifi for home states

PostPosted: Wed Sep 13, 2017 10:54 pm
by mundmc
kw123 wrote:
fingscan = my first big plugin , historically from, fully debugged, uses FING to passively and actively scan the network, can add ping to test if device is up. very fast

unifi: get all info from unifi devices to indigo. one of my latest plugins, more mature, likely few bugs. does not actively scan the network.but if you use the switch & Gateway & AP you have it covered.
is better for wifi devices than fingscan

I would say 80% overlap


Thanks, you the man!


Sent from my iPhone using Tapatalk