Jump to content

Re-checking Condition?


jerlands

Recommended Posts

I'm trying to write a program that will turn off some lights after the Status 'MOTION SENSOR-Dusk/Dawn' is Off and a 25 min. wait period has elapsed (Cloudy Days B.) I want to re-check the status and turn the lights off only if "Status 'MOTION SENSOR-Dusk/Dawn' is Off" after the wait but I'm brain drained and don't see the way. As it stands now I believe it will turn the lights off regardless of current status.

 

Cloudy Days A

If
       From    Sunrise + 15 minutes
       To      Sunset  -  1 hour  and 15 minutes (same day)
   And (
            Status  'MOTION SENSOR-Dusk/Dawn' is On
       )

Then
       Set 'Foyer Light' On
       Set 'Kitchen Sink Light' On
       Set 'Media Room Light' On

Else
       Run Program 'Cloudy Days B' (If)


 

Cloudy Days B


If
       From    Sunrise +  1 hour 
       To      Sunset  -  1 hour  and 15 minutes (same day)
   And (
            Status  'MOTION SENSOR-Dusk/Dawn' is Off
       )

Then
       Wait  25 minutes 
       Set 'Foyer Light' Off
       Set 'Media Room Light' Off
       Set Scene 'Kitchen Sink Light' Off

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

 

Thanks,

 

Jon

Link to comment
I want to re-check the status and turn the lights off only if "Status 'MOTION SENSOR-Dusk/Dawn' is Off" after the wait but I'm brain drained and don't see the way

 

With regards to your 'cloudy days B' program, it will trigger an evaluation at: sunrise + 1 hour, sunset - 1 hour 15 minute, and ANY change in status of the motion sensor. If this program triggers an evaluation which results of "true", then it will run the "then" path. But you know all this.

 

Additionally, if the program is re-triggered during the 25 minute wait (by a change in motion sensor status, for example), the execution will halt and restart the "then" or "else" path, based upon the results of the new evaluation. In other words, if the 25 minute period was counting down, and the motion sensor status changed to "on" during the wait period, current execution would halt and the "else' path would execute. Nothing further would happen (empty else path). Therefore, I don't believe you need a separate check of the motion sensor status.

 

I do notice a couple of things hower. First, I find it unusual that you would limit the response of lights to daylight hours (from sunrise to sunset). Normally, lights are more needed during nightime hours (sunset to sunrise (next day)). Second, your "B" program will fail you if the lights are on and it is triggered less than 25 minutes before 'sunset-1h15m'. If this were to ever happen your lights would remain on all night.

 

There are several ways to avoid this. The simplest, in your case, may be to add a third program to turn the lights off at Sunset - 1 hour and 15 minutes, as a backup.

Link to comment
Additionally, if the program is re-triggered during the 25 minute wait (by a change in motion sensor status, for example), the execution will halt and restart the "then" or "else" path, based upon the results of the new evaluation. In other words, if the 25 minute period was counting down, and the motion sensor status changed to "on" during the wait period, current execution would halt and the "else' path would execute. Nothing further would happen (empty else path). Therefore, I don't believe you need a separate check of the motion sensor status.

 

Thanks... I guess then the program should run as I had hoped.

 

I do notice a couple of things hower. First, I find it unusual that you would limit the response of lights to daylight hours (from sunrise to sunset). Normally, lights are more needed during nightime hours (sunset to sunrise (next day)). Second, your "B" program will fail you if the lights are on and it is triggered less than 25 minutes before 'sunset-1h15m'. If this were to ever happen your lights would remain on all night.

 

The program is only to give light during those dark cloudy days... I have another program for night time events, it starts as this program ends and shuts them off.

 

Thanks,

 

Jon

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.3k
×
×
  • Create New...