Jump to content

Can a program be triggered by a change in state?


Recommended Posts

Hi all,

 

I would like to have my garage lights turn on when my garage door opens, and remain on for 10 min. I would then like the lights to turn off regardless of the state of the garage door (open or closed) after 10 mins.  The program below works fine except it will continue to cycle as long as the garage door is open.  I'm thinking there might be a way to have the IF statement run only when the status changes from OFF to ON rather than ON state?  Anyone know if that is an option or if there's another way to do it?

 

Garage Door Open, Lights ON - [iD 0007][Parent 0001]
 
If
        From    Sunset 
        To      Sunrise (next day)
    And Status  'Garage - Mud Rm / Garage Door Sensor' is On
 
Then
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' On
        Wait  10 minutes 
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' Off
 
Else
   - No Actions - (To add one, press 'Action')
 
 
Link to comment

So, I think I figured it out... 

 

Garage Door Open, Lights ON - [iD 0007][Parent 0001]
 
If
        From    Sunset 
        To      Sunrise (next day)
    And Control 'Garage - Mud Rm / Garage Door Sensor' is switched On
    And Status  'Garage - Mud Rm / Garage Lights Mud Rm' is Off
 
Then
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' On
 
Else
        Wait  10 minutes 
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' Off
Link to comment

Control will trigger the program each time the device sends a signal manually. If On is the trigger and you turn the device on three times, then the program will run three times.

 

Status will trigger the program each time the device changes to the desired state from a different state. If On is the trigger and you turn the device On three times, then the program will run once because the state didn't change.

Link to comment

Yup, made some good progress. I was able to set up the garage lights so that if they are off and the door opens after sunset they will turn on for 7 mins and then turn off.  I can detect if the garage light was already on and do nothing... especially not turn the lights off on me.  Trick was to use the Control vs Status and create a scene with just one of the garage light switches in it.  

 

Garage Door Open, Lights ON - [iD 0007][Parent 0001]
 
If
        From    Sunset 
        To      Sunrise (next day)
    And Control 'Garage - Mud Rm / Garage Door Sensor' is switched On
    And Status  'Garage - Mud Rm / Garage Lights Mud Rm' is Off
 
Then
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' On
        Wait  7 minutes and 15 seconds
        Set Scene 'Z Scenes / Garage / Garage Lights Sync 0' Off
 
Else
   - No Actions - (To add one, press 'Action')
Link to comment

Control will trigger the program each time the device sends a signal manually. If On is the trigger and you turn the device on three times, then the program will run three times.

 

Status will trigger the program each time the device changes to the desired state from a different state. If On is the trigger and you turn the device On three times, then the program will run once because the state didn't change.

Stusviews,

 

What was interesting is the program would continue to cycle when I used status.  Like it kept looking and seeing the sensor was on and rerun the Then statement... causing the lights to remain on indefinitely or until the garage door closed.  Where as the Control option would only run the Then statement once when the door opened.  

 

Todd

Link to comment

Do you have an I/O Linc on your garage door sensor? If so, the first program should have worked, in that the programmed should have only run when the status of the sensor changed, plus once at sunset and again at sunrise. It would be interesting to look into the logs and see if the I/O Linc was actually sending multiple On commands. This would not affect your second program because it has the additional check to see if the light is off. However, if the I/O Linc was sending multiple on commands and the door was left open for more than 7 minutes, the light in the mud room should come back on after the subsequent On command.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...