How do I do this?

Posted on
Thu Jul 28, 2016 7:24 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

How do I do this?

Hey everyone,

I'm having a bit of difficulty figuring out how to get Indigo to do what I want. Here's what I have:

- A I/O Linc Controller for my Gate. Binary input 1 is the status of the gate (open or closed) and binary output 1 opens/closes the gate on command.
- A I/O Linc Controller for Garage Door 1. Binary input 1 is the status of the gate (open or closed) and binary output 1 opens/closes the gate on command.
- A I/O Linc Controller for Garage Door 2. Binary input 1 is the status of the gate (open or closed) and binary output 1 opens/closes the gate on command.

Here's what I want to do:

I want to, by some command, do the following logic called "Good Morning":

1. Check if Gate Binary input 1 is closed (1) if so, set binary output 1 (to open Gate)
2. Check if Garage Door 1 Binary input 1 is closed (1) if so, set binary output 1 (to open Garage Door 1)
3. Check if Garage Door 2 Binary input 1 is closed (1) if so, set binary output 1 (to open Garage Door 2)

I also want to, by some command, do the following logic called "Good Night":

1. Check if Gate Binary input 1 is open (0) if so, set binary output 1 (to close Gate)
2. Check if Garage Door 1 Binary input 1 is open (0) if so, set binary output 1 (to close Garage Door 1)
3. Check if Garage Door 2 Binary input 1 is open (0) if so, set binary output 1 (to close Garage Door 2)

Essentially I want logic to close the gate and garage doors if they are open. I also want logic to open the gate and garage doors if they are closed.

I've been playing around with virtual devices, triggers, etc, and just cannot see how to do this. Any pointers?

Posted on
Thu Jul 28, 2016 7:43 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: How do I do this?

Probably best to do this with a script, doing it with a load of triggers will be confusing and frustrating :). I would just create two action groups and set them to execute a script then use the code below (replace DEVICEID with the ID you get from Indigo when you right click each device and "Copy ID"):

Code: Select all
gateDev = indigo.devices[DEVICEID]
garageADev = indigo.devices[DEVICEID]
garageBDev = indigo.devices[DEVICEID]

# Good Morning

if gateDev.states["binaryInput1"]: indigo.iodevice.setBinaryOutput(gateDev.id, index=0, value=True)
if garageADev.states["binaryInput1"]: indigo.iodevice.setBinaryOutput(garageADev.id, index=0, value=True)
if garageBDev.states["binaryInput1"]: indigo.iodevice.setBinaryOutput(garageBDev.id, index=0, value=True)



Code: Select all
gateDev = indigo.devices[DEVICEID]
garageADev = indigo.devices[DEVICEID]
garageBDev = indigo.devices[DEVICEID]

# Good Night

if gateDev.states["binaryInput1"] == False: indigo.iodevice.setBinaryOutput(gateDev.id, index=0, value=True)
if garageADev.states["binaryInput1"] == False: indigo.iodevice.setBinaryOutput(garageADev.id, index=0, value=True)
if garageBDev.states["binaryInput1"] == False: indigo.iodevice.setBinaryOutput(garageBDev.id, index=0, value=True)

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
Thu Jul 28, 2016 8:00 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: How do I do this?

Holy cow. It works.

I will cook you a free meal if you ever get down here to South Louisiana. You've saved me a ton of time and exposed me to a new and cool feature. Thanks man!

Posted on
Thu Jul 28, 2016 8:18 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: How do I do this?

boisy wrote:
Holy cow. It works.

So, better than many of my plugins huh? :P

boisy wrote:
I will cook you a free meal if you ever get down here to South Louisiana

Mmmmmm, loves me some Southern food (Southern boy here despite the name). But, alas, not necessary since doing my part to build the Indigo ecosystem helps keeps this HA system I love so much alive and kicking. Regardless, you're welcome :).

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 15 guests