Page 1 of 1

Restarting iFindStuff

PostPosted: Sun Sep 27, 2015 7:50 am
by Chameleon
Hi all

Occasionally I want to restart iFindStuff because that forces an immediate update of all devices and maps (well within 10 seconds anyway). I realised that many of you won't know how to restart a plugin in an action so here is what I use.

I create an action:

Screen Shot 2015-09-27 at 14.46.53.png
Restarting a plugin
Screen Shot 2015-09-27 at 14.46.53.png (89.02 KiB) Viewed 4402 times


I've called it Restart iFindStuff...

The embedded code is:

Code: Select all
import indigo
iFindStuffId = "com.corporatechameleon.iFindplugBeta" # supplied by the documentation
iFindStuffPlugin = indigo.server.getPlugin(iFindStuffId)
if iFindStuffPlugin.isEnabled():
   iFindStuffPlugin.restart(waitUntilDone=False)


if you want to cut and paste it.

When this action runs it stops iFindStuff, Restarts it and Triggers an update of all devices & maps. You can also schedule this to run at a specific time of the day if you want to do a review of all devices at a standard time.

Like all actions they appear in Indigo Touch so you can also restart the plugin from there with this action.

Regards

Mike

Re: Restarting iFindStuff

PostPosted: Sun Sep 27, 2015 10:23 am
by FlyingDiver
I don't think the "import indigo" line is needed for embedded scripts. I think I saw a post from Matt or Jay saying that was done automatically for all embedded scripts.

Re: Restarting iFindStuff

PostPosted: Sun Sep 27, 2015 12:12 pm
by Chameleon
FlyingDiver wrote:
I don't think the "import indigo" line is needed for embedded scripts. I think I saw a post from Matt or Jay saying that was done automatically for all embedded scripts.


You're probably right - it's more of a habit :D

Mike

Re: Restarting iFindStuff

PostPosted: Mon Sep 28, 2015 8:33 pm
by nev
Thanks, that's great! Now how would one go about modifying this code to deactivate/activate an iFindStuff device called "MYiPhone" for example.

Restarting iFindStuff

PostPosted: Mon Sep 28, 2015 11:45 pm
by howartp
nev wrote:
Thanks, that's great! Now how would one go about modifying this code to deactivate/activate an iFindStuff device called "MYiPhone" for example.

From the wiki: http://wiki.indigodomo.com/doku.php?id=indigo_6_documentation:device_class#device_base_class

Code: Select all
indigo.device.enable(123, value=True) #enable
indigo.device.enable(123, value=False) #disable


That sample uses the device's ID which is recommended best practice, but you can also use "MyiPhone" including the quote marks where it says 123.

Peter

Re: Restarting iFindStuff

PostPosted: Tue Sep 29, 2015 12:51 pm
by Chameleon
howartp wrote:
nev wrote:
Thanks, that's great! Now how would one go about modifying this code to deactivate/activate an iFindStuff device called "MYiPhone" for example.

From the wiki: http://wiki.indigodomo.com/doku.php?id=indigo_6_documentation:device_class#device_base_class

Code: Select all
indigo.device.enable(123, value=True) #enable
indigo.device.enable(123, value=False) #disable


That sample uses the device's ID which is recommended best practice, but you can also use "MyiPhone" including the quote marks where it says 123.

Peter


Good answer Peter - nice that someone knew how to do it easily :)

Re: Restarting iFindStuff

PostPosted: Wed Oct 21, 2015 6:47 am
by web@theonlineproshop.co.uk
Hi Mike

All is well with the Plugin but I'm getting false readings on the Distance and Time to Home GeoFence, see screenshot. From the location shown I'm actually about 8ish miles from home,

Any ideas?

Cheers

DaveImage


Sent from my iPhone using Tapatalk