Jump to content

If-Else always runs with MS


PhanTomiZ

Recommended Posts

Hi,

 

I have this simple program that I thought would turn on some lights (Then) when MS Tstat sensor is on and it's between 12 and 5:20 am which it does.  But when it's not between 12 and 5:20am, it seems the (Else) part of the program runs by the status of the MS.  

 

I thought the AND in my IF statement had to have both conditions true, to run the "Then" and both conditions false to run the "Else",  Seems like it acts more like an OR statement.  Do I have the right logic????What am I missing?

 

Hope this makes sense.

 

Turn all lights on Living RM - [iD 0016][Parent 0001]

 

If

        (

             Status  'TStat Main / MS TStat Main-Sensor31.F3 64' is On

         And From    12:00:56AM

             To       5:20:00AM (same day)

        )

 

Then

        Send X10 'A2/On (3)'

        Send X10 'A5/On (3)'

        Set 'Range L.E.D.' On

        Set Scene 'zScenes / Foyer Light when Closet open' Fade Up

 

Else

        Send X10 'A2/Off (11)'

        Send X10 'A5/Off (11)'

        Run Program 'Range L.E.D.' (If)

        Set Scene 'zScenes / Foyer Light when Closet open' Fade Down

 

 

Link to comment

To add a little additional information about Programs and triggers.   Any change in the Motion Sensor Status or when the From time or the To time is reached, the Program is triggered (runs If).  The various If conditions are evaluated and when True the Then clause executes.  If not True for any reason the If is considered False and the Else clause runs.

 

When a program is triggered it will execute either the Then or Else.  There is no case where a Program is triggered and no clause (Then or Else) is executed.

Link to comment

What I'm trying to accomplish is....

 

When it's between 12 and 5 am AND if there is motion from MS, THEN turn on the lights.  When there is no motion AND it's still between 12 and 5 am ELSE turn off the lights.  Looks like I will need 2 program to do this, right?

 

So whether there is an AND or an OR, each individual condition in my IF statement is evaluated separately?  If either of these conditions are false, the the ELSE action is triggered?

Link to comment

For those conditions and using the Motion Sensor Off two Programs are needed.  There is some additional logic required for the Fade.  It is easier to combine into one Program.

 

If
         Control  'TStat Main / MS TStat Main-Sensor31.F3 64' is switched On
         And From    12:00:56AM
             To       5:20:00AM (same day)
Then
        Send X10 'A2/On (3)'
        Send X10 'A5/On (3)'
        Set 'Range L.E.D.' On
        Set Scene 'zScenes / Foyer Light when Closet open' Fade Up
        Wait 4 seconds
        Set Scene 'zScenes / Foyer Light when Closet open' Fade Stop.
        Wait 5 minutes       (this is wait timeout value now in MS)
        Send X10 'A2/Off (11)
        Send X10 'A5/Off (11)'
        Run Program 'Range L.E.D.' (If)
        Set Scene 'zScenes / Foyer Light when Closet open' Fade Down
        Wait 4 seconds
        Set Scene 'zScenes / Foyer Light when Closet open' Fade Stop
Else
Link to comment

With this, the timeout of the MS is not used, but rather the wait time in the program.  So, IF both conditions are met THEN my program runs and we could care less about the MS timeout.  This is what I wanted to accomplish, but wasn't looking at it the right way...

 

Why is it the "Fade UP/Down" needs a "Fade Stop"?

 

Thanks

PhanTomiZ

Link to comment

When a paddle/button on a device is pressed and held active, the device issues a Fade Up/Down when the paddle/button is pressed and a fade Stop when the button/paddle is released. The Fade Stop terminates the Fade Up/Down.  Even though I suspect you want the Fade Up/Down to run to the On/Off limit the device firmware is expecting a Fade Stop.  The lack of a Fade Stop can cause the next command to the device to do unexpected things.   Some devices are ok without the Fade Stop, others have  problems when they do not see the Fade Stop.  A device always sends the commands in pairs, Fade Up - Fade Stop,  Fade Down - Fade Stop.

Link to comment

Nothing can be set in device to affect Fade.  It changes the load at a predicable rate because a human (normally) is pressing and holding the paddle/button.  Would not want a human to sit there holding a paddle/button while a device took 2 minutes to Fade Up/Down.   The Fade operation can be simulated by setting the Scene Responder Ramp Rate to like .4 seconds (whatever Fade uses, don't know the specific rate) and using the normal Scene On/Off commands.  The device would Ramp Up or Down as if Fade was being used.

Link to comment

I believe the Ramp Rate is really what you want.  Set on level and ramp rate in the scene and just use Scene On and Scene Off in the program.

 

-Xathros

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...