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 »

I am not home. Back tomorrow. From that version to ..4 I changed how ping is done. Could you select " do not use ping "(*) in the config to see if that's it. It will not ping the devices just use fing

(*) or something like that.


Sent from my iPhone using Tapatalk
angel2014
Posts: 12
Joined: Sat Apr 05, 2014 10:04 am

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

Post by angel2014 »

Hi, as suggested by you, I started fing manually from the Terminal and I left it running for several hours, but I've never had any problems. I rebooted fingscan and the problem has come back.

:cry:
evansgo
Posts: 223
Joined: Fri Nov 29, 2013 10:53 am

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

Post by evansgo »

Just loaded 10.4 and checked the ping option but it was already off, so it wasn't that. But I'm going away for a couple of weeks tomorrow so cannot leave the Mac in an unstable state so have disabled fingscan for now, will gladly assist on my return if you've not found it by then.

Gareth
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 »

I have been running FINGSCAN on a 4 year old laptop for some hours, none of that behavior. very difficult to diagnose if I can't reproduce the issue.

could you share the configuration of the MAC?
and are there any entries in the system log file (start console) around these times when it happens?

and have a nice trip

Karl
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 »

I need some help configuring the plugin. I have been trying to test it by simply sending a text message when Fingscan sees that my iPhone is away. I want to try this out before I try changing my Thermostat variables.

EVENT 1

I have my iPhone selected as IP Device 1
Minutes Bf Away status can trigger 30 seconds
Minutes BF Home can re- trigger 0 minutes, immediate
min. dist. status can be away 3.5 units
min dist. status is home 1.8 units
ignore dist. info if older than no selection
Enable/Disable this event on


For the actual trigger

the type is fingscan event
event: Event 1 Away
Actions: text me that my iPhone is away.

I would eventually like it to send me a text when my phone is within 1.8 units and is home.

Once I get texts, I can assume its working and I'll go ahead and change the variables to turn on/off my HVAC.

Thanks
M4 Mac mini.
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 »

ok so where do you need help?

some tricks:
in order to test the Trigger there is a menu item (plugins/fingscan/trigger AWAY1) that triggers AWAY 1.
I would use that to test if the downstream part works. Use that event as a trigger for your actions. Once that works, change the event to HOME 1.

Also if you don't have an ASUS router enabled your trigger setting is a bit "nervous" wifi goes on and off quickly. You might get false positives too often. I would set it to minimum of 1 minute (with no WIFI -ASUS router)



Hope that helps

Karl
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 »

well I just wanted to make sure everything was configured correctly. I tried this Monday night in haste but I never received the text while on my way to work.

would I need to configure my phone under "use my iDevice for Home status"? Currently I have "no selection" for it.

I'm missing something here. I was gone for over an hour and a half this morning and never received the text message that my phone was away. Nothing occurred in the Event Log as well.

Thanks.
M4 Mac mini.
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 »

https://www.dropbox.com/s/jw8qvchuw2p70 ... 6.zip?dl=0 version 4-10-6

fixed:
- under some circumstance variables where not initialized in the right sequence
- fixed some spelling in config and log file output


added:
add choice how PINGs are launched
(a) sequentially for all (UP) devices one after the other - a little bit slower if a device does not not answer i.e. is now DOWN (all other devices will have to wait for devices that do not answer), but less taxing on your system
(b) parallel for all (UP) devices at the same time -- fastest way, all pings are done in parallel.
-- see PDF for a more detailed discussion., you can switch between the options and try out what works best for you.

Karl
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:

start easy: first do a simple event 1:
device = your iphone
time settings: immediate
do not use distance info
enable event
save

setup trigger to trigger on events home 1 and one to trigger on away 1
action: say home / away
save
on your phone switch wifi on / off /on/off (you might need to way 1 minute in-between.)

if you get announcement "home" "away" go to the next level

enable distance info
to test this you will need to leave the house
..

then you will need to tune the wait periods. FING itself does not know if its wifi or ethernet. (i)Phones disappear for FING sometimes for ~ 15 minutes (i.e.when you do not have them charging i.e. running on battery power)

let me know if you need more info

Karl
Dewster35
Posts: 1033
Joined: Tue Jul 06, 2010 6:29 pm
Location: Petoskey, MI

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

Post by Dewster35 »

kw123 wrote: start easy: first do a simple event
Sage advice for every single home automation logic created
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 »

Thank you. I will give it a try. Although I saw that I didn't enable the event once I set it up. DOH! Will still give your sample a test run.

Update: Had success with no distance info. Received both texts as I should have. Now to mess around with time and distance.

Thanks
kw123 wrote:midd:

start easy: first do a simple event 1:
device = your iphone
time settings: immediate
do not use distance info
enable event
save

setup trigger to trigger on events home 1 and one to trigger on away 1
action: say home / away
save
on your phone switch wifi on / off /on/off (you might need to way 1 minute in-between.)

if you get announcement "home" "away" go to the next level

enable distance info
to test this you will need to leave the house
..

then you will need to tune the wait periods. FING itself does not know if its wifi or ethernet. (i)Phones disappear for FING sometimes for ~ 15 minutes (i.e.when you do not have them charging i.e. running on battery power)

let me know if you need more info

Karl
M4 Mac mini.
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 »

https://www.dropbox.com/s/cpygg33cf2zdv ... 7.zip?dl=0 v 4-7-10

fixes:
1. samsung TV's use both wired and wifi connections and switches between them. The WiFi connection stays "kind of" on if the wired connection works. i.e. it is "associated and authorized" to/with the router, but does not request an IP number. That device state is now covered
2. after 1 week of running, I got a msg "too many files open" Fix: reboot 19(*) minutes after midnight and close all open files in loops.

added:
some formatting improvements, clearer messages, increased # of events from 10 to 12

Karl

(*) picked 19 minutes after midnight as many other things might happen directly after midnight.
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 »

using FINGSCAN with motion sensor to unlock/lock front door:

You should have a motion sensor installed at the front door with limited detection area. Mine is installed above the door looking down measuring only 3x3 meters in front of the door.

0. create variable homeF

1. create trigger listening to FINGSCAN event HOME 1 for your Phone or simply trigger on state="UP" for your device(phone)
-- 1. action: set variable homeF to 1
-- 2. delayed action: (1 minute) set homeF to 0

2. create trigger motion sensor at front door
if motion detected ; condition: variable homeF = 1; action: unlock door

This should reduce false positives, i.e. if your iPhone goes to sleep and wakes up in the middle of the night and trigger "HOME" or "AWAY"

You could do the LOCK door to in the same way.

create variable awayF
The sequence here should be:
1. create new trigger motion sensor
-- 1. action set variable awayF to 1
-- 2. delayed action(~ 2 minutes) set variable homeF to 0 ( 2 minutes should give the phone enough time to disappear from your house WiFi range and Fing to detect it is not answering pings)

2. create trigger to listen to device(phone) state="down" or EVENT away in FINGSCAN
condition: homeF =1
action: lock door.

Both require that WiFi on your phone is active.

Karl
philc
Posts: 156
Joined: Tue May 17, 2011 8:36 pm

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

Post by philc »

Karl,
I have struggled to get the plugin working since it was first released. I had it disabled for a very long time, but last week - seeing the version had progressed quite a bit - I upgraded and reenabled. The plugin worked for a few hours, then quit updating.
The first challenge I have is the configuration. Every time I hit Save, I get a field validation error - but no fields turn red.
Edit: Second challenge is that when I attempt to configure an event, the device drop down won't drop down. It doesn't list any devices.
From reading the forum, it seems I should expect Fing and Fingscan to show up in activity monitor. Neither of them do (which may explain the first challenge). I've disabled, reenabled, uninstalled, reinstalled - everything. Fing works - I can run it from Terminal no problem - but fingscan just refuses to work.
Happy to provide whatever info you need. I guess the first obstacle is: how do I know Fingscan is running? If not running, how do I get it to run?
Best,
Phil
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 »

Phil,
could you be so kind and post or email me your indigo event log - the lines that start with "fingscan" make sure you don't copy your password.

Activity Monitor: you should see FING in the activity log not FINGSCAN . FINGSCAN is a plugin and it is one of the "INDIGIPLOGINHOSTS" entries. When you start it should log the "PID" in the indigo event log.
That is the number you can identify it in the Activity Monitor (second to last column)

If you get a validation error there should be an entry in the log file that indicates the problem.

What version are your running (FINGSCAN, OSX, INDIGO...) What kind of MAC, router, are you running wired / wireless....etc ?


Karl

[email protected]

here an example of the log file entries:

Code: Select all

Started plugin "fingscan 4.10.7"
  fingscan                        FINGSCAN--V 4.10.7   initializing     will take ~ 2 minutes...
  fingscan                        indigo variables initialized
  fingscan                        loaded indigo data
  fingscan                        FING initializing
  fingscan                        FING initialized ..  created new data   waiting ~ 1 minute for stable operation
  fingscan                        settings:  iDevicesEnabled              True
  fingscan                        settings:  inbetweenPingType            parallel
  fingscan                        settings:  wifiRouter                   ASUS
  fingscan                        settings:  wait seconds between cycles  2
  fingscan                        settings:  password entered             True
  fingscan                        

  fingscan                        EVENT:-------------  1  ---------------------------------------------------------------
....
Post Reply

Return to “User Plugins”