NkySpike65 Posted March 29, 2011 Share Posted March 29, 2011 This is my other programing dilemma.I have a card access motion sensor that turns on a C4 dimmer switch (ldz-102) when it senses motion, and when no motion is detected it turns the lights off after 5 minutes... Nothing really special.I was trying to setup a program were I can double tap the top button on the C4 dimmer switch, and that would stop the timer and hold it there... So I can keep the lights on until I manually turned it off from the dimmer switch it's self.Also the way it's setup now the motion sensor turns the lights on before you can even get to the dimmer switch.Every time I think I got it, the lights go off after the 5 min timers runs down. Any ideals would be great. Thanks, David Link to comment Share on other sites More sharing options...
ILoveC4 Posted March 29, 2011 Share Posted March 29, 2011 Create a boolean variable that you can toggle with a double tap. Then make the motion sensors turning that light off conditional of the state of the variable. Does that make sense? Link to comment Share on other sites More sharing options...
ILoveC4 Posted March 29, 2011 Share Posted March 29, 2011 Also, you don't ned to use a timer here. Just set the occupancy period on the motion detector to 5 minutes...that will also improve the battery life of the motion detector. You don't need to do this, what you've done will work great, but it would simplify things. Link to comment Share on other sites More sharing options...
NkySpike65 Posted March 29, 2011 Author Share Posted March 29, 2011 Thanks, I'll give it a try later today. Link to comment Share on other sites More sharing options...
EagleMoon Posted March 29, 2011 Share Posted March 29, 2011 I think you need to create a variable like "Hold Front Room Lights", then set that to TRUE when the button is double-tapped. Then you need to check that variable first in each of your existing three scripts -- only execute them if the variable is FALSE. Add to each of those scripts an "If variable is FALSE" statement and indent the rest under it.This way, even if the timer is running when you double-tap, the script to turn off the lights when the timer expires will never execute even though the timer expired.You may want to change an LED color when that variable is set so you know it's on manual control.Then you need a way to set the variable back to FALSE. I think you could do that when the bottom button of the dimmer is tapped. Perhaps better would be to do it when the light level is changed and the level is zero, i.e. turned off by any means.And if you set the LED color, be sure to set it back when the variable is set to FALSE.Edit: Early bird Dan beat me again. Link to comment Share on other sites More sharing options...
ILoveC4 Posted March 29, 2011 Share Posted March 29, 2011 I think you need to create a variable like "Hold Front Room Lights", then set that to TRUE when the button is double-tapped. Then you need to check that variable first in each of your existing three scripts -- only execute them if the variable is FALSE. Add to each of those scripts an "If variable is FALSE" statement and indent the rest under it.This way, even if the timer is running when you double-tap, the script to turn off the lights when the timer expires will never execute even though the timer expired.You may want to change an LED color when that variable is set so you know it's on manual control.Then you need a way to set the variable back to FALSE. I think you could do that when the bottom button of the dimmer is tapped. Perhaps better would be to do it when the light level is changed and the level is zero, i.e. turned off by any means.And if you set the LED color, be sure to set it back when the variable is set to FALSE.Edit: Early bird Dan beat me again.You were much more detailed in your explanation though...nice job. Link to comment Share on other sites More sharing options...
EagleMoon Posted March 29, 2011 Share Posted March 29, 2011 You were much more detailed in your explanation though...nice job.My wife sometimes just walks away in the middle of my explanations. Or she interrupts with, "Okay, but what's the answer?" Link to comment Share on other sites More sharing options...
EagleMoon Posted March 29, 2011 Share Posted March 29, 2011 David,On a side topic, it looks like all your devices are in the same "room" in the project even though they are in different physical rooms. Is that correct? And is it really how you want it?I can see how that simplifies navigation sometimes, but beyond a small project it would seem to get unwieldy to navigate. No? Link to comment Share on other sites More sharing options...
NkySpike65 Posted March 29, 2011 Author Share Posted March 29, 2011 Thanks EagleMoon,The more detailed you are , the better off I am! Thanks again EagleMoon, and Dan David Link to comment Share on other sites More sharing options...
NkySpike65 Posted March 29, 2011 Author Share Posted March 29, 2011 David,On a side topic, it looks like all your devices are in the same "room" in the project even though they are in different physical rooms. Is that correct? And is it really how you want it?I can see how that simplifies navigation sometimes, but beyond a small project it would seem to get unwieldy to navigate. No?Yea, that's the way my first installer set everything up. At the time I had HC300 and two dimmer switches in the theater room, and one dimmer switch for the front porch plus one wireless dimmer front room.Added few more dimmer down the road and he just kept adding them at the Theater Room location, at the time it didn't really bother me ( nor did I know any better). I always wanted to move everything to their own room, but was afraid once things got moved around that all my lighting scenes would stop working. I have a lot.If I have all the lights that are now listed something like: Theater Room-Front Porch Light. To First Floor-Front Porch Light, or Theater Room-2nd Floor Hall Light, to Second Floor-Hall Light.I take it that I would have to redo every lighting scene all over again, or can a room be created and then that light or keypad be dragged and dropped. So the lighting scene is still in tacked but. Just the location title is renamed? Thanks, David Link to comment Share on other sites More sharing options...
thecodeman Posted March 29, 2011 Share Posted March 29, 2011 When you make lighting scenes you just select the loads you want, the room/name is irrelevant as the commands are broadcast to the node's ID. Link to comment Share on other sites More sharing options...
NkySpike65 Posted March 29, 2011 Author Share Posted March 29, 2011 Thanks, Cody. Link to comment Share on other sites More sharing options...
NkySpike65 Posted March 30, 2011 Author Share Posted March 30, 2011 EagleMoon,Thanks again works great. I didn't do the " light level is changed and the level is zero ", just wasn't sure how to really set that up correctly.Thanks, David Link to comment Share on other sites More sharing options...
EagleMoon Posted March 30, 2011 Share Posted March 30, 2011 If you are using the variable as we suggested to signify manual control, then somewhere you've got to reset that variable to allow the automatic control to work again.There's no single "right" way to do it. Below is one simple way. You could also check On/Off state instead of level. I'm not sure if "level=0%" is technically the same as "Off" in the Control4 scripting; I assume so, but don't know for sure. You could also do it with a tap of the bottom button (which turns the lights off anyway), but that doesn't do it if you turn the lights off from anything else (like a scene).When your_room-->your_lights level changes If the your_room-->your_lights level is = 0% --> Variables-->your_hold_lights_variable = FALSE --> Put code here to restore the LED color if you changed it elsewhereSubstitute your actual room, lights and variable names where appropriate. This assumes you set the variable = TRUE with some other script like the double-tap of the top button.Controlling the LED color on my 1.8.0 system for a keypad is confusing but it's especially confusing for a dimmer. I still don't fully understand when the "On" and "Off" colors are used. And for a dimmer there's no "current" color on my system. I'm not at that house so I can't test it until later in April.So for LED color you'll have to experiment. You also have to know the default color so you can restore it to default above. You probably need its RGB values; it's a version of blue but may not be one of the standard colors in the dialog.Edit: typo in the sample script Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.