Jump to content

Else Clause not Evaluated


RickyK53

Recommended Posts

Posted

Mikael,

 

Consider the foloowing program to control my water heater ....

 

If

On Mon, Tue, Wed, Thu, Fri

From 5:30:00 AM

To 8:00:00 AM (same day)

Or

On Mon, Tue, Wed Thu, Fri

From 8:00:00 PM

To 12:00:00 AM (next day)

Then

Set 'Water Heater' On

Else

Set 'Water Heater' Off

 

Today is Tuesday. At 7:30:00 AM we had a power failure. The power returned at 10:30:00 AM. Investigating the state of my ISY world at this time revealed that the water heater was ON.

 

Inspection of this program summary data revealed nothing (blank) under Last Run Time, nothing under Last Finish Time, and 2009/08/04 08:00:00PM under Next Scheduled Run Time.

 

It appears to me that the else clause was not executed as expected. Instead, when evaluating the condition, it immediately determined it would simply rerun the program at 8pm.

 

I can see how this would be valid and a nice optimization if the ISY knows the current state of the device under control to be correct. However, if the state of the device is indeterminate such as after a power failure, does it not make sense on the first running of the program to execute the appropriate action clause?

 

Currently, I am running 2.7.3

 

Thanks in advance for your comments,

 

Rick

Posted

Hello Rick,

 

On the Configuration panel Catch up schedules at Restart should be checked by default. Would you please make sure that is the case?

 

Rand

  • 1 month later...
Posted

I have been loking into to prgram behavior after power failure on the ISY.

 

Take the program:

 

If

On Mon, Tue, Wed, Thu, Fri

Time is 6:00:00:00AM

Then

Set 'Kitchen Sink Lamp' On

Set 'Piano Lamp' 50%

Else

- No Actions

 

It is Monday, 7AM and the power fails and reutrns. Should the above program run? In fact is does run and the lights turn on. Unless the phrase 'Time is 6:00:00AM' really means 'Time is >= 6:00:00AM', I would not expect this program to run.

 

I modified the IF clause to look like:

 

If

On Mon, Tue, Wed, Thu, Fri

From 6:00:00:00AM

To Sunrise +5 minutes (same day)

 

This version behaves correctly (and is probably a better version should power fail and return between 6AM and Sunrise +5 min). The program correctly does not run and the lights remain off.

 

So what is going on with the first version? Why does it run after power is restored?

 

Thanks Rick

Posted

When Catch up schedules at Restart is checked the ISY should start at midnight and run all your scheduled programs until it reaches the current time.

 

Rand

 

I have been loking into to prgram behavior after power failure on the ISY.

 

Take the program:

 

If

On Mon, Tue, Wed, Thu, Fri

Time is 6:00:00:00AM

Then

Set 'Kitchen Sink Lamp' On

Set 'Piano Lamp' 50%

Else

- No Actions

 

It is Monday, 7AM and the power fails and reutrns. Should the above program run? In fact is does run and the lights turn on. Unless the phrase 'Time is 6:00:00AM' really means 'Time is >= 6:00:00AM', I would not expect this program to run.

 

I modified the IF clause to look like:

 

If

On Mon, Tue, Wed, Thu, Fri

From 6:00:00:00AM

To Sunrise +5 minutes (same day)

 

This version behaves correctly (and is probably a better version should power fail and return between 6AM and Sunrise +5 min). The program correctly does not run and the lights remain off.

 

So what is going on with the first version? Why does it run after power is restored?

 

Thanks Rick

Posted

Rand .. thank you for the reply ...

 

So you are saying that after a reset, the ISY pretends it is midnight and 1) second by second until the present time, scans each program to see if it should run, or 2) looks at each program and determines if it should have run prior to the current time.

 

Examining the logfile, I believe it must be number 2 because programs seem to run in the order they are listed in the program list. The program illustrated in this message is called "Morning Scene On". I have another program which turns the same devices off named "Morning Scene Off". Morning Scene Off always runs before Morning Scene On according to the log files. In the program list, it Morning Scene Off is listed first.

 

There must be something else going on here, however. After modifying the If clause with the from / to criteria above, I see no evidence in the log file that this program ever ran. If you are 'catching up', since midnight, I would expect it to have run at least once when you 'hit' 6:00:00AM.

 

I think it is important to understand the specifics of the unit starting up here and this is a topic that is not covered in much detail. Any more light you cold shed o this would be greatly appreciated.

 

Rick

Guest
This topic is now closed to further replies.

×
×
  • Create New...