Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Night Light (UPB, ELK & CQC)
ea_automation Wrote:I'm not a home so this is from memory:

I have a trigger on the motion sensor feeding from the Elk.
Trigger if motionsensor = "Violated"

This triggers an event
If var_Sleeping Then
if light is out then
turn light on
end if
set countdown timer to 15 minutes
end if

This will reset the timmer everytime there is motion.

I then have a trigger on the countdown timer = 0

Countdown_Timmer = 0
turn light out.

I can post the code if interested when I get home tonight.
i took one of the TimedFldChange commands out of my i only have TimedFldChange on the UPB driver. i thought that if i used the command for both elk and upb then both driver fields would be up to date. based on dean's comment maybe these two were working against each other. with only one TimedFldChange it seems to be working better, but still seeing a glitch on one upb device.

if your offer still stand, seeing a post of your code would be helpful. thanks.
My application is a little different. I use it to turn off the bathroom exhaust fan.

S.O.O. [sequence of operation]
When the fan is used it should turn off after 5 minutes to remove the stink.
If it is on due to a shower I want it to remove humidity. Run until humidity is back to normal. (Problem - I have not been able to get my 1-wire system running on CQC. Until I can run for 5 minutes after the light goes out)

I have Three Triggered Events

Fan Check is used when the light is turned off
The light in the bathroom is dim able.
I have the Trigger set to "send an event on any value change"

The BathroomFanCheck
New Fld Value Equals --> _Lights.BathroomLight --> 0
Fld Value Equals -->_Lights.BathroomFan --> True
"All True"
FieldWrite(_Timers1.InvokeCmd, ResetCD 3 Mintues 5)

When the light is turned out and the fan is running a countdown timer is set to 5 Minutes.
If anytime during this 5 minutes the light gets turned off again the countdown gets reset to 5 minutes.

The BathroomFanCountDown

The fan is an on/off switch.
I have the Trigger set to "send an event if the expression is true"

Is Field Change For --> _Lights.BathroomFan
"All True"
FieldWrite(_Timers1.InvokeCmd, ResetCD 3 Mintues 5)

When the fan is turned on a countdown timer is set to 5 Minutes.
I check if the light is on during the actual shutdown routine since if someone is still in the bathroom I don't want to change the operation.

The BathroomFanShutdown

The count down timer
I have the Trigger set to "send an event if the expression is true"

Is Field Change For --> _Timers1.CDTimer3
"All True"
FieldRead(_Lights.BathroomLight, LVar:ChkVlu,True)
If System::Equals(%(LVar:ChkVlu),0)
FieldWrite(_Lights.BathroomFan, False)

When the timer expires I check the light to see that it is off. If it is I turn the fan off. If it is not I leave it on - wait for the light to turn off and start the timer over.

Since I use the same timer for the light and the fan when either one changes the timer gets reset. The one thing that I could do to stop from sending a signal when not needed is check the fan status as well in the shutdown routine and if already off, someone turned it off, then do nothing. That would look like:
FieldRead(_Lights.BathroomLight, LVar:ChkVlu,True)
FieldRead(_Lights.BathroomFan, LVar:ChkVlu2,True)
If System::Equals(%(LVar:ChkVlu),0)
If System::Equals(%(LVar:ChkVlu2),True)
FieldWrite(_Lights.BathroomFan, False)

Sorry I took so long to respond. I'm BAD at keeping up with my messages and email. I have to automate to get it done timely.
I should have read closer. You wanted motion:
I use this motion for a couple of different items.
1) night light
2) arming the alarm system when my kids, wife and me forget.


my elk zone that I monitor for a nightlight is Zone 11
Trigger is set to "Send an event on any value change"

Event Filters:
Fld Value Equals --> _Elk.LogZone011 --> Open
"All True"
FieldRead(_Lights.KitchenClockLightDim, LVar:ChkVlu,True)
FieldWrite(_Timers1.InvokeCmd, ResetCD 6 Minutes 35)
If Not System::GrThan(%(LVar:ChkVlu),0)
If System::IsNight()
FieldWrite(_Timers1.InvokeCmd, ResetCD 5 Minutes 2)

Then the TimerCD 5 is set to turn off the light
TimerCD 6 is set to arm the alarm system if there has been no motion for 35 minutes and it is not the weekend and it is not a holiday and there is school and it is inbetween 7 am and 5 pm.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Timbertech RGBW post cap light retrofit and CQC kfly 4 924 07-24-2021, 04:41 AM
Last Post: kfly
  Adding Christmas Light control to CQC with Lutron HW8 avtexan 10 6,688 11-18-2015, 12:35 PM
Last Post: avtexan
  Turning light off after certain time royalj7 8 3,110 11-04-2012, 02:35 PM
Last Post: royalj7
  Speaker wire beside light runs ewiz 6 3,502 06-26-2007, 01:13 PM
Last Post: klindy
  Single Light Widget 3DogKnight 4 2,598 06-22-2007, 02:52 PM
Last Post: 3DogKnight
  Triggered Event on "last light is off" IVB 18 3,982 12-01-2006, 03:37 PM
Last Post: rhamer

Forum Jump:

Users browsing this thread: 1 Guest(s)