Restarting iFindStuff

Posted on
Sun Sep 27, 2015 7:50 am
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Restarting iFindStuff

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 4354 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

Posted on
Sun Sep 27, 2015 10:23 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Restarting iFindStuff

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.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Sep 27, 2015 12:12 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: Restarting iFindStuff

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

Posted on
Mon Sep 28, 2015 8:33 pm
nev offline
Posts: 48
Joined: Aug 19, 2015

Re: Restarting iFindStuff

Thanks, that's great! Now how would one go about modifying this code to deactivate/activate an iFindStuff device called "MYiPhone" for example.

Posted on
Mon Sep 28, 2015 11:45 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Restarting iFindStuff

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

Posted on
Tue Sep 29, 2015 12:51 pm
Chameleon offline
Posts: 611
Joined: Oct 04, 2014

Re: Restarting iFindStuff

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

Posted on
Wed Oct 21, 2015 6:47 am
web@theonlineproshop.co.uk offline
Posts: 1
Joined: Apr 24, 2015

Re: Restarting iFindStuff

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests