Jump to content

Simple Program


hart2hart

Recommended Posts

I've got a :

 

Program folder with condition "if Garage Light is Off"

 

Program within folder above which says

If Motion sensor is switched on

Then

Set Garage Light on

Wait 10 Minutes

Set Garage Light off

 

 

The light never goes off so what am I doing wrong. I've read big debates about program triggers vs condtions so I understand this does not work work like old school programmmer thinks but ....

Link to comment

You are right about this not working as a programmer would expect. A programmer would expect to be able to say:

 

Trigger Event: Motion sensor is switched On

If

Garage Light is Off

Then

Set Garage Light On

Wait 10 Minutes

Set Garage Light Off

 

But as you have read, the ISY doesn't work that way. The problem with using folders as you did is that when you turn your garage light on, the folder's condition goes false, and when the program enters the WAIT, it dies because the folder it is contained in is now disabled.

 

Unfortunately, the way to do what you want requires 4 programs. First you need a status program "Garage Light Status" with no conditions or actions. Next, you need a "Garage Light On" program that, upon receiving a command that turns the garage light On, runs the THEN branch of the status program. For example:

 

If 'Keypad - Garage Light' is switched on OR 'Garage Light' is switched on

Then

Run Program 'Garage Light Status' (THEN branch)

 

Similarly, you need a "Garage Light Off" program that runs the ELSE branch of the status program:

 

If 'Keypad - Garage Light' is switched off OR 'Garage Light' is switched off

Then

Run Program 'Garage Light Status' (ELSE branch)

 

Note that you cannot use a status condition for these programs, because those programs would then run when the light turned on in your motion program. Finally, modify your motion program to read:

 

If 'Motion sensor' is switched on AND Program 'Garage Light Status' is false

Then

Set 'Garage Light' on

Wait 10 Minutes

Set 'Garage Light' off

 

Subsequent motion in the garage will reset the time, as you probably already know. Also, if the garage light is turned on by motion, and then someone turns it on via the KPL button or switch during the 10 minutes, the light will stay on beyond the 10 minutes, because the motion program dies in the Wait.

Link to comment

That is correct . . . I think. If the conditions in the two programs were status conditions, i.e. If Status 'Garage Light' is On, then the programs would run anytime the status of the garage light changed, regardless of how it was controlled.

 

The question is, if I send a direct device On, i.e. Set 'Garage Light' On, will that trigger a program with the condition If Control 'Garage Light' is switched On. I think the answer is no. However, one way to be sure would be to put the Garage Light device in a scene and then turn the Scene on/off in your motion program.

Link to comment

Archived

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


×
×
  • Create New...