Nehsmit Posted May 4, 2016 Share Posted May 4, 2016 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: 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 More sharing options...
Nehsmit Posted May 4, 2016 Author Share Posted May 4, 2016 Anyone? Link to comment Share on other sites More sharing options...
South Africa C4 user Posted May 4, 2016 Share Posted May 4, 2016 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 More sharing options...
martymohr Posted May 5, 2016 Share Posted May 5, 2016 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 More sharing options...
mstafford388 Posted May 5, 2016 Share Posted May 5, 2016 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 More sharing options...
rosenqui Posted May 5, 2016 Share Posted May 5, 2016 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 More sharing options...
South Africa C4 user Posted May 5, 2016 Share Posted May 5, 2016 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 More sharing options...
Matt Lowe Posted June 14, 2016 Share Posted June 14, 2016 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 More sharing options...
pkkaiser Posted August 27, 2016 Share Posted August 27, 2016 There is also a handy Hack from Ryan (google it) that sets multiple LED's with a particular color all at once. Makes programming easier. Link to comment Share on other sites More sharing options...
brucecampbell Posted August 30, 2016 Share Posted August 30, 2016 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 More sharing options...
SMHarman Posted September 22, 2016 Share Posted September 22, 2016 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.