Jump to content

Setting Program State


born2dive

Recommended Posts

I understand that program state by default is "False" and when its condition is being evaluated or the program is running the state changes to "True".  I have a couple of simple programs that I created to automate turning lights on and off.  When the first one executes to turn the lights on its state turns to "True" while running and then "False" when it finishes (most of my other programs do that).  Code below:

 

 
If
        Status  'Garage / Garage Left-Sensor' is Off
     Or Status  'Garage / Garage Right-Sensor' is Off
 
Then
        Set 'Garage / Garage Lights' On
        $GarageOpen  = 1
        Run Program 'Garage LightsOff on Close' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 
I have a second program that turn the lights off after a few minutes, its state is "True" while running and stays "True" after it finishes.  Code below:
 
If
        $GarageOpen is 1
 
Then
        Wait  10 minutes 
        Set 'Garage / Garage Lights' Off
        $GarageOpen  = 0
 
Else
   - No Actions - (To add one, press 'Action')
 
Any advice or more info on how to control program state?  Is there a way to force or set program state?
 
Thanks
 
 
 
 
 
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)

    • There are no registered users currently online
  • Forum Statistics

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