Python Quickie

Posted on
Thu Aug 15, 2019 10:10 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Python Quickie

So I had this script originally and it worked just fine.

Code: Select all
alarmPanel = 1145882715
alarmPanelState = indigo.devices[alarmPanel].states['panelReady']
day = indigo.variables[1864332157]

if alarmPanelState == "0":
      indigo.dimmer.setLedState(215921706, index = 4, value = False)
elif alarmPanelState == "1" and day.value == "true":
   indigo.actionGroup.execute(327874994), indigo.actionGroup.execute(1040855971)
elif alarmPanelState == "1" and day.value == "false":
   indigo.actionGroup.execute(327874994), indigo.actionGroup.execute(53352835)

So now I'm trying to amend it for something else, and tried this, but it doesn't work.

Code: Select all
day = indigo.variables[507666416]


if day.value == "true"
   indigo.actionGroup.execute(1909876887)
elif day.value == "false"
   indigo.actionGroup.execute(1300897338)


I've been keeping copies of all the Python scripts that I've cobbled together, MAINLY with so much help from users here.... but don't see a version where I used the day variable like in the 2nd example, only used the day variable as in the 1st script. The error is on the first "if" line... but no doubt the "elif" line won't work either... (I am aware the "day" variables have different ID's, which isn't the problem...)

Any suggestions ?

Posted on
Thu Aug 15, 2019 10:17 am
FlyingDiver offline
User avatar
Posts: 7220
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python Quickie

You're missing the colons at the end of the if/elif lines:

Code: Select all
day = indigo.variables[507666416]

if day.value == "true":
   indigo.actionGroup.execute(1909876887)
elif day.value == "false":
   indigo.actionGroup.execute(1300897338)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Aug 15, 2019 10:37 am
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Python Quickie

Duh!

Thanks..

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests