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.
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

kw123 wrote:this is not an error message from fingscan but the script you are using to detect a new ip number.

could you post THAT script. it looks like you might have selected py instead of applescript in YOUR trigger.

to test if the your script compiles, go into your trigger and in action click on compile.

Karl
it is definitely set to applescript.

when i hit compile, i see this error:

Dec 10, 2013, 5:10:19 PM
Error script error: around characters 181 to 182
Error script error: Expected expression but found unknown token. (-2741)

here's the script. only thing i changed was my email address (not in copy below).

Code: Select all

tell application "IndigoServer"
set xxx to (get value of variable "ipDevsNewIPNumber") as text
end tell
— now do something with it:
say xxx
— or send email 
property emailAddress : “[email protected]”
property emailSubject : “New IP Number”
property newline : ASCII character (10)
set eb to “”
set eB to eB & ", new ip number for device: xxx & newline
set eB to eB & ", just for information”
tell application "IndigoServer"
set emailBody to eB
send email to emailAddress with subject emailSubject with body emailBody
end tell
return
end
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 »

The quotes were wrong. The " where not the real " but slanted ". --- tooooo many different text editors involved.

This should compile, but will not work: the email address is missing i.e. [email protected] needs to be replaced with your email address and you need to have email enabled in indigo-- in menu item interfaces/manage interfaces/email
Let me know if you need anything else.

Karl

Code: Select all

tell application "IndigoServer"
	set xxx to (get value of variable "ipDevsNewIPNumber") as text
end tell
set emailAddress to "[email protected]" -- need to put your email address here
set emailSubject to "New IP Number"
set newline to ASCII character (10)
set eb to ""
set eb to eb & ", new ip number for device: " & xxx & newline
set eb to eb & ", just for information"
tell application "IndigoServer"
	set emailBody to eb
	send email to emailAddress with subject emailSubject with body emailBody
end tell

return
end
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

thanks. i guess i'm an idiot. sorry for the confusion.

that one compiles, runs, sends an email.
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 »

there are no stupid questions only stupid answers
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

I'm getting newip emails now.

but i still do not have the variable ipDevsNoOfDevices in my variable list. any ideas?
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 »

forgot to create it in the code, a quick fix: just duplicate ipDevsNewIPNumber and rename it to ipDevsNoOfDevices and it will be filled with the number..


will be fixed in the next release


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 »

here you go v 1.6.9 https://www.dropbox.com/s/428zqovicy4e0 ... l1-6-9.zip

download
unzip
click on fingscaninstall
follow prompts

added:
1. check if communication to indigo works, if not display warning and exit after 60 seconds.==> this is the mavericks applescript problem
2. added creation of ALL variables if they do not exist and remove unused variables ==> clean up
3. manages 2 instances running in parallel, oldest stops, ==> more error control
4.if fing is not running for any reason restart after 5 minutes ==> more error control

Karl
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

That seems to work. thank you.

I can see my iPhone ipdevice09 in the device list change up/down when i toggle wifi on/off. I'm still not getting my home/away variable to change based on this. I'll look into it tonight...i'm sure it's something silly i've done. i'll play with it tonight.
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

does this trigger look right?
Attachments
Screen Shot 2013-12-11 at 7.02.25 AM.png
Screen Shot 2013-12-11 at 7.02.25 AM.png (50.99 KiB) Viewed 5841 times
Screen Shot 2013-12-11 at 7.02.14 AM.png
Screen Shot 2013-12-11 at 7.02.14 AM.png (62.33 KiB) Viewed 5841 times
Screen Shot 2013-12-11 at 7.01.58 AM.png
Screen Shot 2013-12-11 at 7.01.58 AM.png (64.04 KiB) Viewed 5841 times
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 »

that trigger setup looks good. Please keep in mind each device has 4 states: ;up; ;down; ;expired; and ;changed; Fir this purpose up and changed is the same. ;changed; is a temporary assignment and will be overwritten with ;up; at the next update ~ 1 minute. ;expired; can only be changed to ;up; or ;changed; *)

as for password: the key chain does not deliver the user password. I tried that. You only have access to other passwords. BUT your idea to store it there is interesting. Will need to check into it. You might have seen the "encryption" I have used. (look at file parameter). Thats not too safe. plugins store passwords in indigo. each plugin has its own space that is not accessible by other plugins. I am still working on my first plugin. But that is > 4 week away.



*)
up : regular up in network nothing new
down: was up now down no response to ping
expired: was down for more than 6 hours == not anymore in fingdata = officially forgotten by fing
changed: is using an ip number that was used by another device recently (I believe not just its a new ip number) difficult to test
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 »

new version 1.7.1 that stores password in keychain, ONLY TESTED IN MAVERICKS
it gives options on password storage:
1. in MAC keychain
2. in file like in last version -- use this if # 1 does not work
3. manually enter very time fingscan gets launched .. not recommended
4. expert mode. you can set fing to not need "sudo" launch .. only for experts!! (need to modify file "sudoers" with sudo visudo and add fing to the list of files that DO NOT need SUDO rights... !!! This can destroy your Mac installation if done wrong!!)

https://www.dropbox.com/s/sd16skm419slw ... l1-7-1.zip


Karl

ps DO NOT USE " in your password
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

kw123 wrote:that trigger setup looks good. Please keep in mind each device has 4 states: ;up; ;down; ;expired; and ;changed; Fir this purpose up and changed is the same. ;changed; is a temporary assignment and will be overwritten with ;up; at the next update ~ 1 minute. ;expired; can only be changed to ;up; or ;changed; *)

as for password: the key chain does not deliver the user password. I tried that. You only have access to other passwords. BUT your idea to store it there is interesting. Will need to check into it. You might have seen the "encryption" I have used. (look at file parameter). Thats not too safe. plugins store passwords in indigo. each plugin has its own space that is not accessible by other plugins. I am still working on my first plugin. But that is > 4 week away.



*)
up : regular up in network nothing new
down: was up now down no response to ping
expired: was down for more than 6 hours == not anymore in fingdata = officially forgotten by fing
changed: is using an ip number that was used by another device recently (I believe not just its a new ip number) difficult to test
i can watch my ipdevice9 change from up to down when i toggle wifi. but the trigger above is not changing the home status variable. ughhh.
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 »

remove the " around ;up; in condition. it will look for ";up;" not for ;up;
Seeker
Posts: 441
Joined: Mon Aug 05, 2013 5:08 am

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

Post by Seeker »

Thank the maker.

that did it. it seems to be working now. thanks so much.
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 »

happy to see that someone is using it.
Post Reply

Return to “User Plugins”