Jump to content

Schedule From To Command in Programs not working.


apodsim

Recommended Posts

This is for UI Ver. 4.9.0 ISY 994i(1120)

I am trying to create a script that interacts with my Motion Sensors to change the outdoor lighting level depending on motion and OFF during daylight hours.  When selecting Schedule If statement From Sunrise After and To Sunset Before settings changes back to After on Update.  When selecting Save Changes the box in RED below returns to After from the Before setting.  The second program "Carriage 35%" keeps the motion detection active during the daylight hours.

The program "Carrige Motion" is OFF between Sunrise and Sunset the same day.  

image.png.b6ce92a1919f5b3710372d35262b6dcb.png


image.png.0fb55a113ebb7ae1ed7e6b2c89d5628a.png

This program forces the lights to respond to motion between After Sunset and Before Sunrise the next day.

image.png.a0f57a778866e2c22214b9e4a542b274.png

image.png.092004e49eb81999c38cd82da7b75eb9.png

Alternative suggestion are welcome.

Link to comment

Couple of things. 

1.  0 minutes before sunrise (next day) and 0 minutes after sunrise (next day) are the exact same time, so no difference.

2.  The second program will trigger 3 times: When the motion sensor status changes, at sunset and sunrise (next day).  Looks like to me during daylight hours and with motion the lights should go to 35% (else condition).  Same thing when the status changes to off (no matter the time of day). 

Link to comment

If you aren't using Offsets don't worry about "before" and "after".  Specifically this means that if the 3 dropdowns just to the left of "before" "after" are all left at zero.  "before" and "after" only applies to those 3 offset adjustments.

For nighttime you want:

    From Sunset
    to Sunrise (Next Day)

For daytime you want;

    From Sunrise
    to Sunset (same day)

 

Link to comment

The settings referenced above is what I have set in the Two programs I pasted to the orginal post. When I select the Before or After setting prefix the setting change which negates the period schedule.  I assume that not having a H:M:S time period set should make any not difference as Sunset and Sunrise continue to change thoughout the year.  The program "Carriage Motion" which is set to Sunrise and Sunset the same day keeps any motion from turing on the lights.  When I enable the Carriage 35% program "Carriage Motion" in the IF statement provides a TRUE and set the lights to full ON else set to %35 if FALSE.  This is overriding the other program "Carriage Motion" because the FROM and TO are both set to AFTER Sunrise and Sunset NEXT DAY.  If the To schedule are not set to "Before" any motion will turn the lights ON regardless of the time of day.  IMO the scripting is the problem due to the reasons expained in the message thread.

Link to comment

The before and after only apply to the hours/minutes/or seconds before our after the appropriate time.  0/0/0 Before sunset is the exact same time as 0/0/0 after sunset.  In program 1 above read it as follows:

if from sunrise to sunset then Set Carriage lights Off else run program carriage lights 35% (if)

There are 2 triggers: Sunrise and Sunset.  At sunrise the program evaluates True and runs the then branch (carriage lights off).  At sunset the program evaluates as false and it runs the else (run carriage lights 35% (if)). Note - this is commanding the execution of the 35% program NOT enabling it.  Nothing else happens with this program at any other time of the day as there are no other triggers.

In the second program there are 3 triggers (change in motion sensor status, sunset and sunrise (next day).  Since you have 0 hms, these triggers occur exactly on the event.  If motion status changes that starts an evaluation of the program condition.  SO DOES sunset and sunrise as they are also triggers.  (I assume this program is enabled or it would only execute once per day based on program 1.)  So when motion status change is the trigger, then it evaluates all three conditionals (motion status off, and is it from sunset to sunrise (next day)).  This program will also evaluate the if statement at sunset and sunrise (next day).  If motion sensor status is True and the current time is between sunset and sunrise (nd) then the lights will come on to 100%.  If motion sensor status is true and current time is outside sunset to sunrise (nd), or between sunrise and sunset then the lights will go to 35%.  Basically the only time the lights go to 100% is with true motion and between sunset and sunrise.  Between sunrise and sunset all motion sensor status changes will command lights to 35%.  Also motion to false between sunset and sunrise (nd) will also set lights to 35%.

 

Hope this makes sense, Jeff

Link to comment
14 hours ago, apodsim said:

The settings referenced above is what I have set in the Two programs I pasted to the orginal post. When I select the Before or After setting prefix the setting change which negates the period schedule.  I assume that not having a H:M:S time period set should make any not difference as Sunset and Sunrise continue to change thoughout the year.  The program "Carriage Motion" which is set to Sunrise and Sunset the same day keeps any motion from turing on the lights.  When I enable the Carriage 35% program "Carriage Motion" in the IF statement provides a TRUE and set the lights to full ON else set to %35 if FALSE.  This is overriding the other program "Carriage Motion" because the FROM and TO are both set to AFTER Sunrise and Sunset NEXT DAY.  If the To schedule are not set to "Before" any motion will turn the lights ON regardless of the time of day.  IMO the scripting is the problem due to the reasons expained in the message thread.

As I mentioned previously as long as the 3 drop-downs to the left of "before" and "After" are left at zero the "before" and "After" drop-down has no effect.

Specifically this is what it DOES do:

In this example no offset is set (i.e. before and after have no meaning):

image.png.9de6f129bb385d38a335a0445ed71fa2.png

Now lets say we want to make the schedule 30 minutes BEFORE sunset ending 30 minutes AFTER Sunrise:

(note the + and - offsets... they are the result of the before and after settings)

image.png.d0c184dee1581f4f8e9dd7167ed8aaea.png

Now lets reverse the schedule 30 minutes AFTER sunset ending 30 minutes BEFORE Sunrise:

image.png.4cf1fda2f77190b224ba3cc78514d75e.png

so now that same scredule read +30 or 30 minutes AFTER sunset and -30 or 30 minutes BEFORE Sunrise.

The Before and After boxes have no meaning if the 3 offset dropdowns are all set to zero.

---

I'm not completely clear what you're wanting.   I can make some assumptions but if I then go back and re-read I get confused whether my assumptions are correct.

Daytime: I assume that you want the lights to always be off.

Night time: What I think you want is the light to be on at 35% unless motion is detected then full brightness?

if so, then your second program will do the job, the first program should be replaced with

If

     Sunrise +1 minute (After)

then

     Set 'Carriage-lights' Off

Note there is only one time in the if statement, it's not a range.  It needs to occur after the time period expires in your second program.

---

A confusing aspect of "From Sunrise to Sunset" is assuming that the conditions of the program are enforced during the entire time block.... reality is that Then runs once at Sunrise, and Else runs once at Sunset.... they don't continually run.

When you add an AND to a time period the programs will run more often in the case of your second program anytime the status of the motion changes, plus additional runs at Sunrise and Sunset.

 

 

 

 

 

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

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