Comfort Automation/ Security System Forums > Support > Questions on Programming Comfort > Timer turns lights off when I dont want it to! |
Moderated by: slychiu |
Author | Post | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
ComfortGeek Member ![]()
|
Hi, I have a problem with timers on lighting. I have exterior spot lights which come on when one of three things happens: 1) the intruder alarm is activated, or 2) when I turn them on through the control menu, or 3) if there is movement picked up by the external PIRs. When the lights come on activated by movement via the PIRs, they stay on for 120 seconds and then turn off. However, the problem is, if I turn them on by the control menu and / or when the alarm is activated, if there is also movement past the external PIRs, the lights then turn off after 120 seconds - which is annoying as I need them to stay on until I decide to turn them off. What can I do add so that the lights are only timed and turned off after 120 seconds when activated by movement, but when turned on through the control menu or by the intruder alarm, they stay on until I decide to turn them off? The response currently is: If NightTime <> 0 Then Do SideOsLitesOn Do OsSpot3and2On Do OsSpot3and2off After 120 Seconds Using OsSpots2and3 Do SideOsLitesOff After 120 Seconds Using SideLightTimer End If And the response to turn them on via the control menu is: Do SideOsLitesOn Do OsSpot3and2On What can I add to either / both of these responses to stop the timer turning the lights off after 120 seconds when I have turned the lights on through the control menu? Kind regards, Kevin |
|||||||||
Ingo UCM Pi Users ![]()
|
Your best bet would probably be to put some sort of Flag in the mix. My thinking is that if EG. Flag01 is set then skip the response internals (meaning the light is On already) or if Cleared (Light Off) then execute the response normally. Setting Flag01 should probably be done in a response where you manually turn the lights on, in my case a Counter is set from Cbus so I would just Set|Clear Flag01 as the light changes state. You could also use a Counter if it's mapped to your lights. I might not work at all but it's the avenue I would try. Ingo |
|||||||||
slychiu Administrator ![]()
|
Yes Flags are the way to go Your zone on response could be If NightTime <> 0 Then Do SideOsLitesOn Do OsSpot3and2On If Flag001 =0 then Do OsSpot3and2off After 120 Seconds Using OsSpots2and3 Do SideOsLitesOff After 120 Seconds Using SideLightTimer Endif End If Hence set the flag Flag001 in the control menu and Intruder Alarm or in other events that you dont want the lights to be switched off However take care to turn OFF the flag afterwards otherwise the lights would never turn off after 120 seconds when you want them to |
|||||||||
Swiss-Toni UCM Pi Users ![]()
|
I remember having a very similar problem when I first started writing command lines, their is another alternative. for the control menu add a new "response" Do SideOsLitesOn Do OsSpot3and2On you will also require a response to turn off or use the toggle feature to do so. The problem I see you having is that you are trying to use the same response for a different function, albeit it has the same result for the lighting. However using this method can still be overridden with the initial sensor/s kicking in when activated "If night time" this is the simplest way round it, but using flags is a better way overall. |