simple scripting of "enabled" or not

Posted on
Mon Jan 15, 2018 10:30 am
esprits300 offline
Posts: 49
Joined: Apr 29, 2012

simple scripting of "enabled" or not

Hello, I am trying to find a way to create a red light green light to see if a a device or schedule is enabled in indigo. NOT the status of the device but if the checkbox for enabled is checked or not. I cant seem to find anything on how to do this. what im thinking is making a schedule that checks to see if a device or other schedule is enabled, if it is set true, if not set false. then from there I can work it out but I cant seem to do this. anyone have any ideas? thank you!

Posted on
Mon Jan 15, 2018 10:45 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: simple scripting of "enabled" or not

You could use Device Extensions to wrap a status around the state or property of another device and then utilize the device state like normal but of the extension instead of the device itself. It's actually this exact type of thing that motivated me to write D/E.

You could also write some scripting to update a variable with the value that you want and then reference the variable.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Mon Jan 15, 2018 1:01 pm
esprits300 offline
Posts: 49
Joined: Apr 29, 2012

Re: simple scripting of "enabled" or not

Thats a great idea for devices but it doesn't seem to work for action groups. im trying to poll indigo to see if an action group is enabled or not. I figured its easy in python or AppleScript but I dont know the syntax or object ids. thanks!

Posted on
Mon Jan 15, 2018 1:40 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: simple scripting of "enabled" or not

In Python you can:

Code: Select all

sch = indigo.schedules[1853612566]
dev = indigo.devices[182494986]

var = indigo.variables[1797442237] # Variable to update

if sch.enabled and dev.enabled:
   var.value = "true"
   var.replaceOnServer()
else:
   var.value = "false"
   var.replaceOnServer()


My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Mon Jan 15, 2018 3:00 pm
esprits300 offline
Posts: 49
Joined: Apr 29, 2012

Re: simple scripting of "enabled" or not

that worked perfect! thank you!

Posted on
Mon Jan 15, 2018 3:19 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: simple scripting of "enabled" or not

Vault-Boy-Approves.jpg
Vault-Boy-Approves.jpg (115.81 KiB) Viewed 1277 times

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests