Using Fing as a new way to detect smartphone presence

Plugins that users have built. NOTE: plugins that were developed for Indigo versions older than 2022.1 will have to be updated to work with Indigo 2022.1 (Python 3 - see this blog post for details). If the plugin listed here is not in the Plugin Store (which will show updated plugins) then you will need to ask on the appropriate thread below if it has been updated and where you get get the update.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

version 1.01 posted

new:
1. supports "&" in password
2. set OSX attribute to be able to run for files downloaded from internet
3. hide icon in dock for fingscan .. it is running in the background, you can still see it in system monitor

Karl

for technically interested folks:

1. put ' around password in echo 'yourpassword' :

Code: Select all

set cmd to "echo '" & yourPassword & "' | sudo -S fing  -o table,csv,\"" & theDir & theFile & "\"  log,csv,\"" & theDir & theLog & "\"  >/dev/null  2>&1 &" 
do shell script cmd
2. do shell script "xattr -d com.apple.quarantine /directory of /fingscan.app"

3. add NSUIElement set to true in info.plist in fingscan.app container:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSUIElement</key>        <++++
	<true/>                                     <++++
	<key>CFBundleAllowMixedLocalizations</key>
	<true/>
midd
Posts: 374
Joined: Sun Apr 18, 2010 3:00 pm

Re: Using Fing as a new way to detect smartphone presence

Post by midd »

so does fing override Travis's Smartphone Radar plugin and Find My iDevice?
M4 Mac mini.
Simon
Posts: 32
Joined: Thu Aug 15, 2013 8:37 am
Location: Denmark

Re: Using Fing as a new way to detect smartphone presence

Post by Simon »

Thanks for the quick fix. I can now use strong password again :-)
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

midd, this is a utility that can be used to get an overview of all ip devices connected / disconnected in your network.

I believe the other tools are to track 1,..,3 specific devices.

your choice

Karl
bip.philippe
Posts: 58
Joined: Wed Feb 20, 2013 2:09 am
Location: France

Re: Using Fing as a new way to detect smartphone presence

Post by bip.philippe »

Hi,

I have worked on patching smartphone radar with fing as a new way of getting smartphone presence. It is implemented as a third communication choice.
I did not work on the launching fing aspect and decided to rely on a fing launched by another way (which is the case on my mac mini, in fact).

This allowed me to solve the issue cause by the latest airport extreme and to keep the built-in smartradar mechanisms.

It is running for three weeks at home. Yon can download it from here : http://bipphilippe.files.wordpress.com/ ... eradar.zip.

Bernard
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Using Fing as a new way to detect smartphone presence

Post by durosity »

Very nice!
Computer says no.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

FINGSCAN V 1.2 is uploaded at http://www.perceptiveautomation.com/fil ... words=fing

new :
1. enables indigo trigger on new (unknown) devices attached to the network
2. added info on number of connect/disconnect per device
3. added many checks if things are going correctly, ie checking fing std out and error messages
4. structured program better
5. "readme" gives examples how to set up trigger, schedule, using the information:
- new unknown device attached to network, ....... using trigger
- specific device not connected for xx minutes, .... using trigger
- several devices not connected for xx minutes, ... using scheduled action



Karl
richy240
Posts: 111
Joined: Sun Jul 08, 2012 10:14 am

Re: Using Fing as a new way to detect smartphone presence

Post by richy240 »

I haven't tried this yet, but it looks pretty awesome. I do have a question though...

Is this method susceptible to the wifi "time-out" issue iDevices have? It's not really an issue so to speak, but the behavior where your wifi network connection is dropped when the network is not in use, and reconnects as necessary.

So, if Fing is scanning the network for connected devices, and one isn't there because it's dropped its network connection, does this somehow compensate for that? (I'm thinking no, but I thought I'd ask. This was one of my primary complaints with Smartphone Radar, since iOS displays some really interesting patterns when you shorten home/away window.)
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

Here is my understanding how fing &fingscan works:

1. fing is listening on a low level to network traffic coming by the ethernet card. If a device that is currently marked as down an entry is made into the finglog file (mac# ip# up). Same if there is a new device not known to fing. "fingscan" checks if there is any change to finglogfile every 5 seconds. It then reads the last line of finglog and updates ipDevicenn accordingly and increments variable ipDevcsNoOfDevices if there is a new device.

2. In addition every minute fing is sending out pings to all fing-known devices (in my network fing takes about 5 seconds to get answers / no answer from all 28 devices). If a device is answering that device is marked as "up". If the device is not answering, "down" is marked in file fingdata.
Fingscan checks the time stamp of fingdata, if changed reads it and updates the variables ipDevicenn list & ipDevcsNoOfDevices (mostly "down" as the "up's" are discovered quicker through listening to traffic coming by).

Observing Iphone and Kindle, it looks to me that when connected to a power supply wifi goes up every ~12 minutes for ~ 30 seconds and then down again. When not connected to a power supply the intervals seem to be longer (have not measured exactly how long).

To shed light on it fingscan adds # of up/down changes to the ipDevicenn variable.

So to make this useful one should wait ~ 15 minutes (after signal is down with eg delayed trigger, see read me file) to determine if an iphone is not present in the house anymore.

Better result would be achieved with listening to 2 devices as they are on a different schedule to reduce the wait period - see readme file.

I guess 10-15 minutes is the minimum time period to make a decision if a device is away. if the devices would do it much more often likely the battery of the device would be drained to quickly. New devices with low power bluetooth might change that in the future.

For me the really interesting feature is that by checking variable ipDevsNoOfDevices for "any change" one can set a trigger to warn if there is a new device attached to the network even if it is only for a few seconds.

hope that helps

Karl
richy240
Posts: 111
Joined: Sun Jul 08, 2012 10:14 am

Re: Using Fing as a new way to detect smartphone presence

Post by richy240 »

It does help, greatly. Thank you very much! :D
wileyone
Posts: 14
Joined: Wed Sep 04, 2013 8:04 am

Re: Using Fing as a new way to detect smartphone presence

Post by wileyone »

First off - Thanks very much for doing this work. This is exactly what I was looking for to detect smartphone devices on my home network since I have an uncooperative router and couldn't use Travis' excellent Smartphone Radar.

A comment or two...
1. When I began setting triggers, I found that I did not have to include the semicolon associated with the variable values of 'up' or 'down'. I simply entered them as up or down with no quotes or anything (underlines added at left for emphasis). Maybe I misinterpreted your instructions in the Readme - but thought I would just give you an FYI...

2. Do you have any plans to add variables that would be along the lines of Travis' work that include things such as "All Phones Away"? I've worked around it by using multiple conditions in the triggers and creating my own variable, but if there was a grouping such as this it would be very handy. I would see it being used for it for things such as - "when we all are gone, adjust the thermostat setting", etc.

3. I'd love to hear from everyone in this forum regarding the creative things they are doing with this and/or Smartphone Radar. I'm simply using it at this point for thermostat and lighting control, but there is probably more creative stuff going on.

Thanks again.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

Yes, you are correct the ";" is not needed. --but-- The trigger condition "contains" looks at the whole string of the variable. As it contains some free text (vendor, name of device...) you might have the string "up" in e.g. vendor "upscale" device name "updated-phone". That would create always true for up-- Just to be 101% sure.

As for other conditions: there you get into all kinds of variations and it will be difficult to support.
1. which one is the device you would like to track
2. do you want to track multiple devices
3. are there any links between these devices (and or ..)
4. what are time-outs you would like to use. Some devices behave differently in terms of connect / disconnect cycles
5. cycle times differ if running on battery or connected to power
6. you might want to change the trigger depending on day / night (if you are at home and sleeping at night) and the devices is "down" too long you might not want to change the away status.
..

Again: FINGSCAN is meant to deliver "raw" information to Indigo you can use to set up your triggers as you see fit.


Karl
wileyone
Posts: 14
Joined: Wed Sep 04, 2013 8:04 am

Re: Using Fing as a new way to detect smartphone presence

Post by wileyone »

I had thought that might be the reason for calling out the semicolon. Thanks for the clarification.

Re: other elements - I understand completely. Not a problem. I can certainly work with the raw info.

Thanks again. This is good stuff. :mrgreen:
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Using Fing as a new way to detect smartphone presence

Post by kw123 »

:oops: actually the condition ";up" would also be triggered by ";upscale" ... ;) to be 200% sure use ";up;"
wileyone
Posts: 14
Joined: Wed Sep 04, 2013 8:04 am

Re: Using Fing as a new way to detect smartphone presence

Post by wileyone »

Indeed... :lol:
Post Reply

Return to “User Plugins”