- if it's dark, it turns on the lights
- if it's not dark, it enables/disables a schedule that will turn on the lights when it becomes dark
- I want to turn on the LED associated with the lights if the schedule is enabled. What I am finding is that a few seconds after turning the light, Lutron(?) is turning it off. Is it possible to manage the LED on/off status?
- Code: Select all
# Devices to be tested
ltSensor = indigo.devices[1666063006] #phidgets amb lt
ambLt = int(ltSensor.states["brightness"])
dev = indigo.devices[1017239549] # dRm kPdW LED#1
# test variable - daylight
if ambLt < 100:
#test device condition
if not dev.onState: #if device is off
# turn device on/off
indigo.actionGroup.execute(1870342736) #bYrd Deck ON
# manage keypad LEDs
indigo.device.turnOn(1017239549) # turn on LED#1
else:
indigo.actionGroup.execute(1695122854) # bYrd Deck OFF
# manage keypad LEDs
indigo.device.turnOff(1017239549) # turn off LED#1
# Because it is still light out, enable schedule to turn on light when ambient light <100
else:
# if keypad LED is off, enable schedule and turn on LED
if not dev.onState: #if LED is off
indigo.schedule.enable(1133523279,value=True) #enable schedule for ~sunset
indigo.device.turnOn(1017239549) # turn on LED#1
else:
indigo.device.turnOff(1017239549) # turn off LED#1
indigo.schedule.enable(1133523279,value=False) #disable schedule for ~sunset