Jump to content

Question about my Program


your2slow

Recommended Posts

Posted

So I've got a Scene that controls my Kitchen Valance and Mud room lights.

 

I've created the following program...

 

IF

Elk Area 'Home' 'Alarm State' is Entrance Delay Active

or Elk Area 'Home' 'Armed State' is Disarmed

And From Sunset

To Sunrise (next day)

 

Then

Set Scene "Scene's / Coming Home' On

 

Else

- No Actions - (To add one, press 'Action')

 

So what I was hoping to accomplish with this was to have the scene lights only turn on when it's dark out and if the alarm is disarmed with the keyfob or disarmed when opening a door. Essentially when coming home and it's dark, the lights inside will turn on.

 

But what is happening is at sunset (5:55pm) the lights turned on. I'm guessing because the alarm is in a disarm state. This would work perfect if I didn't have the keyfob because I would always get the entrance timer, but because the keyfob disarms with out the entry delay I'm not sure how to capture it.

 

Any help?

Posted

The order of precedence may be giving the If a problem. Add parens around the two Or’ed statements.

 

IF

(

Elk Area 'Home' 'Alarm State' is Entrance Delay Active

or Elk Area 'Home' 'Armed State' is Disarmed

)

And From Sunset

To Sunrise (next day)

Posted

I don't think my suggestion is going to work. The Program is triggered at Sunset. If either of the two conditions above are true the Then clause will run.

Posted

Is there another way to accomplish this? Or is the universal able to detect a keyfob disarm?

 

I wonder if I'd have to setup an output to trigger when there is a disarm then use that output to trigger the lights...

Posted

Separate the logic into two Programs. Program 1 triggers on Sunset to Sunrise, setting an Integer variable to 1 if between sunset and sunrise, 0 if otherwise.

 

The posted Program checks for a value of 1 in the variable (rather than sunset to sunrise) along with the 2 Ored conditions. Using an integer variable will not cause the existing Program to trigger at sunset.

Posted

These three programs will set things right I do believe

 

 

1) if elk is armed to any type, then set "elk armed" state variable to 1, else set to 0

2) if it is from sunset to sunrise next day, set "dark outside" integer variable to 1, else to 0

3) if "elk armed" variable is 0 and "dark outside" integer varialbe is 1, then turn lights on.

 

In this way, the third program only triggers on the elk arming or disarming (the state variable changing). The dark outside variable is only checked if the system is armed/disarmed (it is not a trigger) so the lights won't turn on at sunset when the security system is just sitting there disarmed.

 

The variables for the first two programs might be useful for other programs as well.

Posted
These three programs will set things right I do believe

 

 

1) if elk is armed to any type, then set "elk armed" state variable to 1, else set to 0

2) if it is from sunset to sunrise next day, set "dark outside" integer variable to 1, else to 0

3) if "elk armed" variable is 0 and "dark outside" integer varialbe is 1, then turn lights on.

 

In this way, the third program only triggers on the elk arming or disarming (the state variable changing). The dark outside variable is only checked if the system is armed/disarmed (it is not a trigger) so the lights won't turn on at sunset when the security system is just sitting there disarmed.

 

The variables for the first two programs might be useful for other programs as well.

 

Thanks apostalakis,

 

For some reason I can't get the "Dark outside" integer variable to change to 1. Do I need to wait till tomorrow to see if it will work?

Posted

The Program that sets the variable is triggered at Sunset (Then clause) and at Sunrise (Else clause). Right click the Program name and select Run Then or Run Else to test the respective code.

Posted
These three programs will set things right I do believe

 

 

1) if elk is armed to any type, then set "elk armed" state variable to 1, else set to 0

2) if it is from sunset to sunrise next day, set "dark outside" integer variable to 1, else to 0

3) if "elk armed" variable is 0 and "dark outside" integer varialbe is 1, then turn lights on.

 

In this way, the third program only triggers on the elk arming or disarming (the state variable changing). The dark outside variable is only checked if the system is armed/disarmed (it is not a trigger) so the lights won't turn on at sunset when the security system is just sitting there disarmed.

 

The variables for the first two programs might be useful for other programs as well.

 

Thanks apostalakis,

 

For some reason I can't get the "Dark outside" integer variable to change to 1. Do I need to wait till tomorrow to see if it will work?

 

As lee mentioned, you can force run the "then" or "else" clause manually. On its own, the program runs twice/day, at sunrise and at sunset. If you manually did a "run then" or "run else" to the inacurate state (ie 1 during the day) it would not self correct to the actual light/dark outside status until the next sunrise or sunset.

Archived

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

×
×
  • Create New...