[ANSWERED]How to get a Timer Start Value

Posted on
Mon Jan 09, 2017 1:36 pm
lalisingh offline
Posts: 135
Joined: Mar 27, 2007

[ANSWERED]How to get a Timer Start Value

My search has not resulted in an answer as to how to get a timer's start value.

Here is the code snippet I have tried.
Code: Select all
id_timer    = 207309385     # Your timer ID
timerPlugin = indigo.server.getPlugin(u"com.perceptiveautomation.indigoplugin.timersandpesters")

if timerPlugin.isEnabled():
    tmr = indigo.devices[id_timer]
    TimerDelay = int(tmr.states['TimerStartValue'])
    indigo.server.log("timer start value is " + ": " + str(TimerDelay))


Any suggestion are much appreciated.

[url]www.VillageWorker.com[/url]

Posted on
Mon Jan 09, 2017 3:16 pm
jay (support) offline
Site Admin
User avatar
Posts: 14760
Joined: Mar 19, 2008
Location: Austin, Texas

Re: How to get a Timer Start Value

TimerStartValue isn't a valid state. To see the state list, select the timer in the device list and look at the control area below in the Custom States list. timerStartValueSeconds is what you're looking for.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jan 09, 2017 9:25 pm
lalisingh offline
Posts: 135
Joined: Mar 27, 2007

Re: [ANSWERED]How to get a Timer Start Value

Thanks Jay.

For anyone that stumbles on this thread below is the action group code to increase or decrease a timer's countdown start value. The action is called from a control page.

To Increase by 1 minute
Code: Select all
id_timer    = 207309385     # Your timer ID
timerPlugin = indigo.server.getPlugin(u"com.perceptiveautomation.indigoplugin.timersandpesters")

if timerPlugin.isEnabled():
    tmr = indigo.devices[id_timer]
    intVar = int(tmr.states['timerStartValueSeconds'])/60

if intVar < 240:
   intVar += 1
    timerPlugin.executeAction("setTimerStartValue", deviceId=id_timer, props={'amount':intVar, 'amountType':'minutes'})


To Decrease by one minute
Code: Select all
id_timer    = 207309385     # Your timer ID
timerPlugin = indigo.server.getPlugin(u"com.perceptiveautomation.indigoplugin.timersandpesters")

if timerPlugin.isEnabled():
    tmr = indigo.devices[id_timer]
    intVar = int(tmr.states['timerStartValueSeconds'])/60

if intVar > 5:
    intVar -= 1
    timerPlugin.executeAction("setTimerStartValue", deviceId=id_timer, props={'amount':intVar, 'amountType':'minutes'})

[url]www.VillageWorker.com[/url]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest