Jump to content
C4 Forums | Control4

Turn on kitchen light when garage opens, how to turn light off?


Recommended Posts

I did some programming that if nighttime and garage opens, to turn on a kitchen light. 
I then added a timer, that after 5 minutes to turn the light off.

that all works very well.

However, when ever I turn on that same light manually by the keypad button,  the light turns off automatically after 5 minutes regardless of the garage door or time of day etc.

I want the light to be able to be used by the keypad as well and not turn off if it is turned on by the keypad.

 

any ideas?

thank you.

Link to comment
Share on other sites


1 hour ago, msgreenf said:

use a variable and set that variable when the garage door opens and trigger based on that variable

I’ve never used Variables, What do I choose under “Type” Boolean...etc?

and what do those mean under “Type”?

 

 Thank you 

Link to comment
Share on other sites

3 hours ago, ekohn00 said:

I'm guessing your timer is set to start the timer with the light coming on. 

Try opening the door and starting the timer, when timer expires it should then turn off the light.

This is step one. Trigger the timer when the garage door opens, not when the light turns on:

WHEN garage door opens
Turn on light
Start Timer

For ease, I would simply do this to prevent the light from turning off should the garage door be opened when the light is already on:

WHEN garage door opens
IF light is off (or lighting scene is off)
	Start Timer
	Turn on light

 

Link to comment
Share on other sites

Hi I updated the programming as suggested.  (see pics below) 

It works, however, when everything is closed (IE the light and garage door are closed) and I turn on the same programmed light manually via the keypaf, it shuts off after 5 minutes.

I may not have the timer agent correct?  

Appreciate as always all the help!

 

Capture3.PNG

Capture4.PNG

Link to comment
Share on other sites

Isn't that because you have to open the door to manually use the keypad ?  The act of opening the door starts the timer, which expires after 5 minutes, thus turning off the light as programmed.  Or am I missing something ?

 

Link to comment
Share on other sites

7 hours ago, Cyknight said:

The above programming is correct as such - my thought would be that the timer is being triggered on the light turning on (or possible the button being pressed) as well.

Yes that seems to correct.

but why?

thsnk you.

Link to comment
Share on other sites

Yes I get what you're asking.

First reason i asked if it was a C4 switch - some 3rd party options don't track well so that could have caused issues, but not the case here.

As for why does it turn off - I would guess there is a programmed line under either 'when light turns on' or 'when button is pressed' you may have added at some point that starts the timer (note that reset also starts the timer)

Only other thing that comes to mind is .... did you set the timer to repeating?

Link to comment
Share on other sites

On 5/26/2021 at 9:59 PM, antneed said:

Hi I updated the programming as suggested.  (see pics below) 

It works, however, when everything is closed (IE the light and garage door are closed) and I turn on the same programmed light manually via the keypaf, it shuts off after 5 minutes.

I may not have the timer agent correct?  

Appreciate as always all the help!

 

Capture3.PNG

Capture4.PNG

 

 

Although this works, there's another way to do this that is "cleaner" and will be easier to trouble shoot.

When you have the garage open and it's night time start your timer. (do not turn on lights as shown above).

Instead, go into programming -> Timer Agent -> Select Timer.

1. When timer "garage kitchen Light" starts -> turn on light

2. when timer "garage kitchen Light" stops -> turn off light.

 

 

 

 

Link to comment
Share on other sites

56 minutes ago, ekohn00 said:

 

 

Although this works, there's another way to do this that is "cleaner" and will be easier to trouble shoot.

When you have the garage open and it's night time start your timer. (do not turn on lights as shown above).

Instead, go into programming -> Timer Agent -> Select Timer.

1. When timer "garage kitchen Light" starts -> turn on light

2. when timer "garage kitchen Light" stops -> turn off light.

 

 

 

 

That sounds too easy, lol. 
I’d have to take a peek.

I’ll keep you updated .

thank you.

Link to comment
Share on other sites

4 hours ago, ekohn00 said:

 

 

Although this works, there's another way to do this that is "cleaner" and will be easier to trouble shoot.

When you have the garage open and it's night time start your timer. (do not turn on lights as shown above).

Instead, go into programming -> Timer Agent -> Select Timer.

1. When timer "garage kitchen Light" starts -> turn on light

2. when timer "garage kitchen Light" stops -> turn off light.

 

 

 

 

This still doesn't catch not starting the timer when the light is already on in any way.

Beyond that it's semantics. In the initial setup you have programming in two locations (WHEN garage door opens and WHEN timer expires or stops) whereas in your example you have it in three locations. So I'm not sure I agree it's cleaner that way. There's really no better or worse way there, just preference.

Link to comment
Share on other sites

1 hour ago, Cyknight said:

This still doesn't catch not starting the timer when the light is already on in any way.

Beyond that it's semantics. In the initial setup you have programming in two locations (WHEN garage door opens and WHEN timer expires or stops) whereas in your example you have it in three locations. So I'm not sure I agree it's cleaner that way. There's really no better or worse way there, just preference.

In my example, the timer would have started regardless of the light being on or off. Personally i'd write and exception if you didn't want the light to turn off 5 minutes after the garage opens, assuming the light was already on.

 

Not exactly semantics, but may be cleaner, balanced code. In the example there's a need for a timer for a specific event. The garage opening is the trigger. The timer starts and stops an action (on/off lights).  You could use the same timer with other triggers (ie a side door opens).  When you go to trouble shoot, you only need to focus on the timer (what's its status, whats it doing) rather than back and forth between a trigger, timer and action.

All coders have a style..... so not saying this is any better, just explaining the logic behind it.

 

 

 

Link to comment
Share on other sites

10 hours ago, ekohn00 said:

In my example, the timer would have started regardless of the light being on or off. Personally i'd write and exception if you didn't want the light to turn off 5 minutes after the garage opens, assuming the light was already on.

 

Not exactly semantics, but may be cleaner, balanced code. In the example there's a need for a timer for a specific event. The garage opening is the trigger. The timer starts and stops an action (on/off lights).  You could use the same timer with other triggers (ie a side door opens).  When you go to trouble shoot, you only need to focus on the timer (what's its status, whats it doing) rather than back and forth between a trigger, timer and action.

All coders have a style..... so not saying this is any better, just explaining the logic behind it.

 

 

 

LOL true - but if you TRULY wanted universal concentrated code, you'd always go

Event -> start Macro X

Then Macro X would have all coding in it.

😄

 

THAT is actually my preferred method, as Macros are the easiest to track.

 

But the bigger point was that he was looking for exactly that:

10 hours ago, ekohn00 said:

if you didn't want the light to turn off 5 minutes after the garage opens, assuming the light was already on.

And that was the bigger point of the comment.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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