Python script - enabling a timers&pesters timer

Posted on
Thu Oct 10, 2019 4:47 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Python script - enabling a timers&pesters timer

On line 4 of a script, I am attempting to turn on a timer, treating it as a device:

Code: Select all
hseVcnt = indigo.variables[1176596514].getValue(bool)
if not hseVcnt:
   indigo.device.turnOn(1010600690) #espresso machine
   indigo.device.turnOn(1995981377) #2hr espresso machine off timer
   indigo.actionGroup.execute(1996294568) #k lamp, warming up (blue)
   indigo.device.turnOff(1580115691) #nOff desk lamp
   indigo.device.turnOn(1172875783) #25min espresso machine ready timer


with the resulting error message:

Script Error espMachineON_2hrs.py: device "espMachOFF2 hrs" class type Device is not compatible with action turnOn/turnOff/toggle/setBrightness/lock/unlock/open/close
Script Error Exception Traceback (most recent call shown last):

espMachineON_2hrs.py, line 4, at top level
TypeError: device "espMachOFF2 hrs" class type Device is not compatible with action turnOn/turnOff/toggle/setBrightness/lock/unlock/open/close

(same error message for line 7 as well)

Posted on
Thu Oct 10, 2019 5:56 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Python script - enabling a timers&pesters timer

There are a couple of ways to do this, but the easiest would be to create Action Groups that start the timers then just execute those.

Image

Posted on
Thu Oct 10, 2019 6:02 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Python script - enabling a timers&pesters timer

And here is the more direct way to do it (without creating additional Action Groups).

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests