Jump to content
C4 Forums | Control4

Garage door open changes LED light color


zazel1

Recommended Posts


OK I used Conditional

When the variable Garage --> Door 1 --> RelayState Changes

? If the Garage-->Door 1 is open

--> Set LED:6 Current color to Orange on Kitchen-->6 Button Keypad

? If the Garage-->Door 1 is closed

(NEED HELP HERE)

For the closed portion above I want the LED to revert back to the LED color it was before it changed to orange. Button 6 also tracks the lights in the room as well as the state of music i.e. if any of lights and/or music in the room are on then the LED is Red otherwise the LED is Blue.

Without having to add each conditional for all the lights/music I want the LED to revert to its color before change to orange.

What is this the best/correct way?

Link to comment
Share on other sites

  • 3 weeks later...

Ok some help requested here!

Another method I suppose could be a Garage Door Boolean variable.

If true when any garage door open then LED light turns Orange. Fine, but what is the best way to get the LED to revert to the original color once the Boolean is false? (i.e Garage door closed)

Link to comment
Share on other sites

Ok some help requested here!

Another method I suppose could be a Garage Door Boolean variable.

If true when any garage door open then LED light turns Orange. Fine, but what is the best way to get the LED to revert to the original color once the Boolean is false? (i.e Garage door closed)

You'll want it to report that all doors are closed, right? Not just one? You'll need to be able to check if all doors are closed.

Link to comment
Share on other sites

Create a boolean variable 'Garage_Door_Open'

Have the LED colour change on the variable change event

On each of the garage door open states, simply set this variable = true

On each of the garage door close states, check if the other two doors are closed, if so, set variable = false.

Link to comment
Share on other sites

Create a boolean variable 'Garage_Door_Open'

Have the LED colour change on the variable change event

On each of the garage door open states, simply set this variable = true

On each of the garage door close states, check if the other two doors are closed, if so, set variable = false.

Another option, since we don't have multi-conditional if statements is to use an integer. Especially for other similar situations(think windows), you would end up with a huge mess of nested if statement.

Example:

GarageState=0: All garages are closed

GarageState=1: 1 garage door open

GarageState=2: 2 garage doors open

GarageState=3: 3 garage doors open

...

Each time a garage door opens, +1, and each time a door closes, -1. Now you also have extra details such as how many garage doors are open too. And if GarageState changes, update keypad.

I do a similar thing that I call HouseState:

-1 = Vacation Mode

0 = All Off

1 = Lights

2 = Entertainment

It makes for really simple keypad programming, as 2 buttons on every keypad are devoted to either HouseState=HouseState+1 or HouseState=HouseState-1 on release. Just 1 line per button on the keypad, and all the logic is handled in 1 location, which is when the HouseState variable changes. This allows me to go between more than just 2 states with just 2 buttons, something that wouldn't work with True/False.

As far as returning to the previous color.

I don't see anything in Composer that simply says something similar to "Get Color" so you just can't get the color and save it in a variable before you switch to "Open Garage Colors", BUT hopefully you have a variable that your colors are based on to begin with, and then you could do something similar to my "HouseState":

If GarageState=0

--- If RoomState=0, LED=Blue

--- If RoomState>0, LED=Red

If GarageState>0, LED=Orange

Really simple programming that is much more scalable than True/False.

Link to comment
Share on other sites

I actually use a combination of things to do a few things:

- I have the top LED on the 3 button in our mud-room (off the garage) show RED if there is a door open, BLUE if not.

- If you push the top LED, the system opens one garage door and then starts a 3 minute timer

- First 60 seconds, the top LED blinks GREEN

- Second 60 seconds, the top LED blinks YELLOW

- Third 60 seconds, the top LED blinks RED

- Then the garage door closes

Works great when my kids want to leave the house and have the garage auto-close.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...