- Posted on
Wed Dec 28, 2016 1:59 am
-
lalisingh
offline
-
- Posts: 166
- Joined: Mar 27, 2007
-
The following code toggles a timer.
if timer is running then stop timer else restart it. If you copy/paste this code please check the indentation as it may get mangled.
- Code: Select all
id_timer = 704705687 # Your timer ID
timerPlugin = indigo.server.getPlugin(u"com.perceptiveautomation.indigoplugin.timersandpesters")
if timerPlugin.isEnabled():
tmr = indigo.devices[id_timer]
if tmr.enabled:
if tmr.states['timerStatus'] == "active":
timerPlugin.executeAction("stopTimer", deviceId=id_timer)
else:
timerPlugin.executeAction("restartTimer", deviceId=id_timer)
[url]https://www.VillageWorker.com[/url]
Extreme data analytics, Sensing, Control integration work.
Indigo • Barix • Kentix • Mobotix • Mikrotik • Apple