Jump to content
C4 Forums | Control4

Keypad LED color.change with alarm


Recommended Posts

Hi all,

I am trying to program a few keypad LEDs to be red if my home alarm is set to either away or stay/home mode. LEDs should be basic blue if alarm is off. I'm having a hard time programming this. What I've done:

1. In agents I set a variable called Alarm Armed to True. Set as a Boolean.

2. In programming under variables I have the following set up:

1c3de16324c91d10bd3b1e91ffdc822f.jpg

3. I have not yet set programming if the variable is False.

Any help is greatly appreciated. Thanks in advance

Link to comment
Share on other sites


A couple of comments that may help (i don't have my laptop with me so can't get into composer to check my terminology):

1. I don't see any purpose to your first line of code as you have nothing nested under it.

2. I doubt you want to set the LED on colour... You want to set the LED current colour (terminology may be wrong).

3. On most security drivers there is a better place to do this than when the Alarm armed variable changes... There is usually an event something like when system (or partition) is armed and another one when system is disarmed... There will also be one when system fails to arm (again my terminology may be slightly off).

Hope that helps...

Link to comment
Share on other sites

I too am traveling without access to ComposerHE so cannot be precise. You need to find the embed point for the alarm state change, then put in code similar to:

If alarm state = unarmed

Change LED

If alarm state = armed stay

Change LED

If alarm state = armed away

Change LED

Depending on system response times you may need to put a delay in front of the code. Doubtful, but possible. Keep everything as simple as possible.

HTH

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Move away from the alarm state stuff.  In programming click on the security system on the left and you should see options on the left like away, home, disarm, etc.  when you select "home" your event in the top center becomes "when security system is armed to home".  Then just dump the LED programming in there and you're all set.  you shouldn't need if statements at all.  Just repeat this for away and disarm and you're all set.

Link to comment
Share on other sites

I did something similar and found that I had to set the LED on/off colours plus set the current colour to get the behaviour I wanted.

If you just set the on/off colours, the LEDs don't change until the load state changes. If you just set the current colour, it will revert to its on/off colour as soon as the load state changes.

Link to comment
Share on other sites

1 hour ago, rosenqui said:

I did something similar and found that I had to set the LED on/off colours plus set the current colour to get the behaviour I wanted.

If you just set the on/off colours, the LEDs don't change until the load state changes. If you just set the current colour, it will revert to its on/off colour as soon as the load state changes.

Quite correct... But there should be no load to change on these buttons so as long as the button type (or is it LED type) is set to programmable you won't need both...

Link to comment
Share on other sites

  • 1 month later...

if you are programming for a momentary notification or really for most any programming you want to use the set led current to X color.

if its bound to a light it will change when the light changes. 

    then you will have to get more complicated programming the on and off states and then setting it back when the alarm is disarmed. i would suggest straying from this.

also if using a keypad be sure to set the button to led beheavior programmed if you do not need load status

Link to comment
Share on other sites

  • 2 months later...

You may also find it handy to use macros for the LED colour changes - in particular if you are using the same colours for multiple actions.

ie:

When alarm is unarmed

    run macro Set_Alarm_LEDs_Defaults

......................

When alarm is armed to home

    run macro Set_Alarm_LEDs_Red

......................

When alarm is armed to away

    run macro Set_Alarm_LEDs_Red

......................

When alarm is in panic mode

    run macro Set_Alarm_LEDs_Red

......................

When alarm is in alarm

    run macro Set_Alarm_LEDs_Red

......................

etc...

Link to comment
Share on other sites

  • 4 weeks later...
You may also find it handy to use macros for the LED colour changes - in particular if you are using the same colours for multiple actions.

ie:

When alarm is unarmed

    run macro Set_Alarm_LEDs_Defaults

......................

When alarm is armed to home

    run macro Set_Alarm_LEDs_Red

......................

When alarm is armed to away

    run macro Set_Alarm_LEDs_Red

......................

When alarm is in panic mode

    run macro Set_Alarm_LEDs_Red

......................

When alarm is in alarm

    run macro Set_Alarm_LEDs_Red

......................

etc...

To further this, you can make the code in the first macro then cut and paste to further macros then just edit for colors.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.