Jump to content

Setting Program State


born2dive

Recommended Posts

Posted

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
 
 
 
 
 
Posted

I think you have a misunderstanding of what program state means.

 

Sent from my SM-N900P using Tapatalk

Posted

I think you have a misunderstanding of what program state means.

 

Sent from my SM-N900P using Tapatalk

Thanks...I agree, which is why I am asking...can you point me somewhere where I can read up?

Posted

Program state reflects results of condition when last evaluated. If a program last ran three days ago, and executed the THEN path, the program status will be true and remain true until it runs again.

Guest
This topic is now closed to further replies.

×
×
  • Create New...