Jump to content

Program Problem


smokegrub

Recommended Posts

Posted

I want the BuzzLinc to buzz 3 times when either of 3 hidden door sensors are open between sunset and sunrise the next day. The buzzer sounds whenever a door is opened, i.e., it is unrestricted as to the timeframe. What am I doing wrong?

 

If
        From    Sunset
        To      Sunrise (next day)
    And Status  'Door Sensors / Deck Door Sensor' is On
     Or Status  'Door Sensors / Kitchen Door Sensor' is On
     Or Status  'Door Sensors / Man Cave Door Sensor' is On
 
Then
        Repeat 3 times
           Set 'BuzzLinc' On
           Set 'BuzzLinc' 2 (Beep Duration)
           Set 'BuzzLinc' Off
 
Else
        Set 'BuzzLinc' Off
 
 

Posted

Need Parens so time range applies to all Sensors

 

If
        From    Sunset
        To      Sunrise (next day)
    And

    (

 

          Status  'Door Sensors / Deck Door Sensor' is On
     Or Status  'Door Sensors / Kitchen Door Sensor' is On
     Or Status  'Door Sensors / Man Cave Door Sensor' is On
    )
Then
        Repeat 3 times
           Set 'BuzzLinc' On
           Set 'BuzzLinc' 2 (Beep Duration)
           Set 'BuzzLinc' Off
 
Else
        Set 'BuzzLinc' Off

Posted

What, specifically, is not working correctly? Which mode is the I/O Linc set for, Latching, Momentary A, B, C?

Posted

Also if the BuzzLinc should alert ONLY when door is Opened and NOT if door remains Open then use If Control

 

If
        From    Sunset
        To      Sunrise (next day)
    And

    (

 

          Control  'Door Sensors / Deck Door Sensor' is switched On
     Or  Control  'Door Sensors / Kitchen Door Sensor' is switched On
     Or  Control  'Door Sensors / Man Cave Door Sensor' is switched On
    )
Then
        Repeat 3 times
           Set 'BuzzLinc' On
           Set 'BuzzLinc' 2 (Beep Duration)
           Set 'BuzzLinc' Off
 
Else
        Set 'BuzzLinc' Off

Posted

Generally Parens are needed when the If has both Or and And statements.  The Parens bracket a set of conditions, a group of Ors or a Group of Ands that then need to be Ored or Anded with something else.  Without the Parens some of the Ored conditions operate without benefit of the time range.  The Wiki has some examples that may be helpful. 

Guest
This topic is now closed to further replies.

×
×
  • Create New...