Jump to content

Entry light - Door lock program


SteveG

Recommended Posts

Posted

Have a program that won't evaluate true when I think it should. Light is off and I am unlocking the door.

If
        Status  'Front Door Entry Light' is Off
    And (
             Control 'Front Door Lock' is switched Key/Manually Unlocked
          Or Control 'Front Door Lock' is switched Unlocked by Keypad
          Or Control 'Front Door Lock' is switched Remotely Unlocked
        )
 
Then
        Set 'Front Door Entry Light' On
        Wait  30 seconds
        Set 'Front Door Entry Light' Off
 
Else
   - No Actions - (To add one, press 'Action')
 


Can someone help me out with the above program? I just want to have the front entry light turn on temporarly when the door is unlocked, EXCEPT if it's already on. I am guessing I am messing up with the parenthesis but I am new and still getting the syntax down.

 

Thanks,

Steve

Posted

Not sure about the IF, but when it does trigger and the light turns on, the Then will immediately stop and the light will not turn off. You will need to separate to two programs.

Posted

And that would be my problem! Seperated it and it worked like a charm. Just as a reference if anyone else stumbles upon this thread looking for an answer:

 

 

Program 1: DoorUnlock

If
        Control 'Front Door Lock' is switched Key/Manually Unlocked
     Or Control 'Front Door Lock' is switched Unlocked by Keypad
     Or Control 'Front Door Lock' is switched Remotely Unlocked
 
Then
        Run Program 'LightOn' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 


Program2 (Disabled so it only runs by the first programs call): LightOn

If
        Status  'Front Door Entry Light' is Off
 
Then
        Set 'Front Door Entry Light' On
        Wait  30 seconds
        Set 'Front Door Entry Light' Off
 
Else
   - No Actions - (To add one, press 'Action')
 


Thanks again MWareman!

 

~Steve

Posted (edited)

No problem! Glad it helped. You actually don't need anything in the 'if' of your disabled program. Not hurting, just not required.

In the first, change the 'Run If' to 'Run Then' to make this work though. I find it cleaner.

Edited by MWareman
Guest
This topic is now closed to further replies.

  • Recently Browsing

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

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.5k
×
×
  • Create New...