Reload, enable, disable plugin via trigger action / script?

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
neilgreene
Posts: 32
Joined: Thu Nov 29, 2012 5:35 am

Re: Reload, enable, disable plugin via trigger action / scri

Post by neilgreene »

Could someone help me with a script that would reload the ELK plugin? Thanks in advance
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Reload, enable, disable plugin via trigger action / scri

Post by matt (support) »

Try:

Code: Select all

plugin = indigo.server.getPlugin("com.elkplug.indigoplugin.elkm1g")
if plugin.isEnabled():
   plugin.restart()
Image
thedon
Posts: 246
Joined: Fri Apr 01, 2011 1:05 pm

Re: Reload, enable, disable plugin via trigger action / scri

Post by thedon »

Hello,

I tried to use this script but cannot find the plugin ID for the vera plugin.
Look through documentation but couldn't find a way to get it.

I am going to schedule the plugin to reload every 2 hours as it works but some communication gets lost in the plugin over time I've noticed.
Reloading it show fix this
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Reload, enable, disable plugin via trigger action / scri

Post by matt (support) »

Its plugin ID is:

Code: Select all

com.homeautomationplugins.vera
Image
User avatar
c64
Posts: 53
Joined: Sun Oct 28, 2012 2:09 am
Location: Germany

Re: Reload, enable, disable plugin via trigger action / scri

Post by c64 »

So the only control over a Plugin is that you can restart it using Python? I am trying to work out how to disable a running Plugin, (then change an .indiPref file outside of Indigo), and then restart the Plugin. Is there a trick to doing that? Thank you.
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Reload, enable, disable plugin via trigger action / scri

Post by matt (support) »

c64 wrote:So the only control over a Plugin is that you can restart it using Python? I am trying to work out how to disable a running Plugin, (then change an .indiPref file outside of Indigo), and then restart the Plugin. Is there a trick to doing that? Thank you.
Correct. Out of security/usability concerns we only allow plugins to be restarted (but not started) via scripting.

Perhaps there is another way to accomplish what you need. Can you provide more details on what that is?
Image
Locked

Return to “Extending Indigo with Plugins and Python”