Syntax for python script

Posted on
Mon Jun 19, 2017 3:51 pm
qcvictor offline
Posts: 80
Joined: Apr 23, 2015
Location: Quebec, Canada

Syntax for python script

Hi Guys
I'm looking for get good syntax for use in python script, I want replace the send mail by prowl like in this example
Code: Select all
dev = indigo.devices[IOLINCID] # "IO Linc"
if not dev.states["binaryInput1"]:
    indigo.server.sendEmailTo("ADDRESSHERE", subject="The garage door is OPEN!!")
from the wiki!

Posted on
Tue Jun 20, 2017 10:03 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Syntax for python script

I'd recommend just creating an Action Group that does the notification, then calling the action group from your script:

Code: Select all
dev = indigo.devices[IOLINCID] # "IO Linc"
if not dev.states["binaryInput1"]:
    indigo.actionGroup.execute(12345) # ID of action group that sends notification


That way you can change it, add more notifications, etc. in the UI rather than editing the script.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron