restart a plugin with an action group?

Posted on
Wed May 13, 2015 5:32 am
Seeker offline
Posts: 440
Joined: Aug 05, 2013

restart a plugin with an action group?

is it possible to make an action group that will restart a specific plugin? I'm specifically looking at the sonos plugin which on rare occasion loses communication with my sonos system. i'd like to have a control page/action group which would reload the plugin, as if i were doing it from the client plugin menu.

thanks.

Posted on
Wed May 13, 2015 5:54 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: restart a plugin with an action group?

I don't see why not. Use this code:

Code: Select all
plugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
if plugin.isEnabled():
   plugin.restart()

Note that this script has worked for me in the past with other plugins, but for some reason there's something about the Sonos plugin that doesn't like to be reloaded in this way. Perhaps there's another step that needs to be added to ask it to shut down nicely first.

This gets you at least part of the way there.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed May 13, 2015 5:06 pm
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: restart a plugin with an action group?

yes, that seems to work. i do see a couple of errors but it forced it to restart. thank you!

hopefully won't have to use it often, but nice to have an action there if i need it remotely.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests