I am trying to figure out how to change the value of a custom device's state using python. I am using the EPS Alarm Clock plugin and have created a custom device to trigger different actions. I would like to be able to programmatically change one of its custom states (durationMinutes) but having trouble figuring it out.
I'm this far along, but the below code tells me "device object has no attribute "isEnabled".
Please help!
- Code: Select all
myVar = indigo.variables[132104315] # time alarm is set for
deviceId = indigo.devices[1587511492] # custom eps alarm clock device
plug = indigo.server.getPlugin('deviceId') # variable containing the number I want to replace the custom device prop with
if deviceId.isEnabled():
plug.executeAction("epsalarmclock", myVar, props={"durationMinutes":'myVar'}) #gives object has no attribute "isEnabled"