[SOLVED]How to "Interfaces > Z-Wave > Reload" in a python sc

Posted on
Sun Oct 13, 2013 11:50 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

[SOLVED]How to "Interfaces > Z-Wave > Reload" in a python sc

I have a z-wave problem where my z-stick becomes unresponsive after a number of hours - not sure what is causing this and I am investigating separately. :(

In the meanwhile, I am detecting this by checking when a thermostat last processed a z-wave command. This should be every 5 minutes or so. If this time is exceeded for a large number of thermostats, I want to reload the z-wave interface as this resolves the issue (at least temporarily).

I tried using the action "server actions > reset interface connections" but this seems to do nothing (as nothing appears in the Event Log even with debug turned on and the z-wave interface isn't reloaded). :?

Is there a way to do this in a python script :?:

Posted on
Sun Oct 13, 2013 8:13 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: How to "Interfaces > Z-Wave > Reload" in a python script

Yes, from an Indigo python script you can do this to restart the Z-Wave library:

Code: Select all
    pluginId = "com.perceptiveautomation.indigoplugin.zwave"
    plugin = indigo.server.getPlugin(pluginId)
    plugin.restart()

That shouldn't be needed of course, so let us know what your troubleshooting turns up. We also need to modify the Reset Interface Connections action so that it restarts the Z-Wave library. I'll try to get that into the next release of Indigo.

Image

Posted on
Mon Oct 14, 2013 5:13 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: How to "Interfaces > Z-Wave > Reload" in a python script

matt (support) wrote:
Yes, from an Indigo python script you can do this to restart the Z-Wave library:

Code: Select all
    pluginId = "com.perceptiveautomation.indigoplugin.zwave"
    plugin = indigo.server.getPlugin(pluginId)
    plugin.restart()

That shouldn't be needed of course, so let us know what your troubleshooting turns up. We also need to modify the Reset Interface Connections action so that it restarts the Z-Wave library. I'll try to get that into the next release of Indigo.


I am still working on the trouble shooting but in the meanwhile this is working well :D

Posted on
Thu Mar 13, 2014 12:29 pm
Chompy offline
User avatar
Posts: 84
Joined: Sep 07, 2009
Location: Seattle, WA

Re: How to "Interfaces > Z-Wave > Reload" in a python script

Is there a way to reload the Insteon interface via python or applescript?

Posted on
Thu Mar 13, 2014 12:45 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: How to "Interfaces > Z-Wave > Reload" in a python script

From AppleScript try:

Code: Select all
tell application "IndigoServer"
   set main interface enabled to false
   set main interface enabled to true
end tell

Image

Posted on
Thu Mar 13, 2014 1:06 pm
Chompy offline
User avatar
Posts: 84
Joined: Sep 07, 2009
Location: Seattle, WA

Re: How to "Interfaces > Z-Wave > Reload" in a python script

Thanks Matt! That did the trick!

Posted on
Tue Dec 15, 2015 8:38 am
oddhenrik offline
User avatar
Posts: 19
Joined: Aug 26, 2014
Location: Norway

Re: How to "Interfaces > Z-Wave > Reload" in a python script

matt (support) wrote:
From AppleScript try:

Code: Select all
tell application "IndigoServer"
   set main interface enabled to false
   set main interface enabled to true
end tell



I would like to reload the z-wave interface like this but it does not reload my z-wave interface. I get the error message:

Failed to establish connection or open serial port to interface. ....

And it logs like this:
Enabling interface "INSTEON Commands 2.0.5"
Starting interface "INSTEON Commands 2.0.5" (pid 21600)
Error Install Interface() caught exception: IllegalParameterError -- serial port name not specified
Interface Failure failed to establish connection with serial interface
Started interface "INSTEON Commands 2.0.5"

Do you have any tip on what I'm doing wrong?

Yours,
ʞᴉɹuǝH-ppO

Posted on
Tue Dec 15, 2015 10:28 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: [SOLVED]How to "Interfaces > Z-Wave > Reload" in a pytho

For reloading the Z-Wave interface you need to use the python script documented above.

Image

Posted on
Tue Dec 15, 2015 4:06 pm
oddhenrik offline
User avatar
Posts: 19
Joined: Aug 26, 2014
Location: Norway

Re: [SOLVED]How to "Interfaces > Z-Wave > Reload" in a pytho

matt (support) wrote:
For reloading the Z-Wave interface you need to use the python script documented above.



Thx Matt, works like a charm :)

Yours,
ʞᴉɹuǝH-ppO

Posted on
Mon Mar 21, 2016 3:43 am
lochnesz offline
Posts: 370
Joined: Oct 01, 2014
Location: Stockholm, Sweden

Re: [SOLVED]How to "Interfaces > Z-Wave > Reload" in a pytho

How can I monitor if the Z-wave plugin is "active" with a established serial connection to the Z-wave interface (i.e. the Z-wave status isn't red and crossed out) and then use it to trigger the above Python script?

Thanks!

Posted on
Tue Mar 22, 2016 8:35 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: [SOLVED]How to "Interfaces > Z-Wave > Reload" in a pytho

There isn't currently an API to read if the Z-Wave connection is up and working correctly, but that might be in a future version.

You can create Indigo Triggers on the type Interface Connection Failure and Interface Connection Initialized to generically detect when an Indigo interface is working and fails, but note that applies to all interfaces type (X10 and INSTEON as well). So there isn't a way to detect Z-Wave by itself.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests