Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Setting Program State

Featured Replies

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
 
 
 
 
 

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

 

Sent from my SM-N900P using Tapatalk

  • Author

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?

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

Start here.

 

http://wiki.universal-devices.com/index.php?title=Main_Page

 

 

Sent from my SM-N900P using Tapatalk

What is it you want to do?

 

Sent from my SM-N900P using Tapatalk

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.