Restarting an Active Plugin in Indigo 7 – Python Scripting

Standard

The Indigo Smart Home platform supports plugin development. In addition to the built-in plugins, my setup also has a few custom plugins developed by third-parties. Every now and then the plugins need to be restarted (reloaded). I decided to setup a scheuled proces to restart a plugin and fortunately, this can easily be one via scripting within Indigo.

For security reasons it is only possible to reload an active plugin. One cannot load a plugin that isn’t already enabled.

The python script required to do this is very simple, within Indigo.

plugin = indigo.server.getPlugin("uk.co.greensky.flux")
if plugin.isEnabled():
 plugin.restart()

In this example I’m restarting the FLUX LED plugin. You’ll need to replace uk.co.greensky.flux with the appropriate plugin ID. I wasn’t able to find the plugin IDs directly within Indigo but they can be obtained by looking at the plugin filenames located in /Library/Application Support/Perceptive Automation/Indigo 7/Preferences/Plugins/ and leaving off the “.indiPref” file extension.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.