Restarting iFindStuff

Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Restarting iFindStuff

Post 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:
Restarting a plugin
Restarting a plugin
Screen Shot 2015-09-27 at 14.46.53.png (89.02 KiB) Viewed 5076 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
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Restarting iFindStuff

Post 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.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Restarting iFindStuff

Post 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
nev
Posts: 48
Joined: Wed Aug 19, 2015 8:29 am

Re: Restarting iFindStuff

Post 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.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Restarting iFindStuff

Post 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= ... 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
Chameleon
Posts: 611
Joined: Sat Oct 04, 2014 9:50 am

Re: Restarting iFindStuff

Post 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= ... 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 :)
[email protected]
Posts: 1
Joined: Fri Apr 24, 2015 1:56 am

Re: Restarting iFindStuff

Post by [email protected] »

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
Post Reply

Return to “iFindStuff”