Simple script help please

Posted on
Thu Jun 30, 2022 7:59 am
jalves offline
Posts: 745
Joined: Jun 16, 2013

Simple script help please

I've never created a python script but was thinking about one that would help with some light controls that currently require 2 different triggers.

Use Case:
I have some lights that are triggered by motion sensors.
When the sensor fires I'd like to turn on the associated light
That part is easy. The twist is that at certain times I'd like the lights to be at 100% and other times (night) I'd like the lights to be at ~30%.
As noted above, I currently do this with two different triggers. One for 100% which only turns on the light (at 100%) if its between the hours of 7 am and 9 pm. The second trigger handles the period between 9 pm and 7 am, setting the lights to 30%

Just to add another level of complexity, no matter which level the lights are set to, they should automatically turn off after 20 minutes. I currently do this using the auto off feature of the triggers.

Thinking this script will be helpful in removing some triggers (not a big thing) and will help me get my feet wet in scripting so I can make Indigo even more useful.

Thanks for any help.

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Thu Jun 30, 2022 10:41 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Simple script help please

TBH, I don't think this is a particularly good scenario to try to script. The way you have it constructed now is exactly how I am doing it in my own house. Trying to convert to a script is really needless complexity. Now, if you had something that required a multitude of triggers to accomplish, that would be different, but not just two (you can even name them so it's clear when they run).

I encourage you to pick something else to get your feet wet in terms of scripting.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Jul 01, 2022 8:39 am
jalves offline
Posts: 745
Joined: Jun 16, 2013

Re: Simple script help please

Thanks Jay. I appreciate your advice on this.

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 13 guests