Jump to content

Question about my Program


your2slow

Recommended Posts

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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

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


×
×
  • Create New...