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.

Variable Doesn't Reset after Wait

Featured Replies

Posted

This program turns on my humidifier when the humidity is above 63%, whch works fine. The problem is that it doesn't set my "Dehumidify" state variable back to zero, or turn off the dehumidifier after the wait time is over. I've experienced this with other similar programs using Wait functions as well. Does anyone know why this doesn't work?

 

post-5633-0-09958800-1414904694_thumb.png

 

 

The Program  changes the value of variable $Dehumidifier.  When the Wait is issued the Program is triggered because the variable has changed value except now the If is False driving the Else clause.  The statements after the Wait never execute.  If the change to the variable should not trigger the Program the variable should be an Integer rather than a State variable.

 

If the variable is an integer already the change in Humidity as the dehumidifier runs will also trigger the Program again.  The value of 1 in the variable will make the if False so the statements after the Wait will not execute.

 

A solution to both situations is have this Program invoke Program 2 which has the existing Then logic.  That way when Program 1 is triggered again and runs the Else it will not affect Program 2. 

 

EDIT: Wait and Repeat statements allow a Program to be triggered again when the conditions in the If have changed.  See this Wiki section which covers Wait and Repeat statements.

 

http://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order

Edited by LeeG

  • Author

Thanks for the help, Lee.

 

It's a bit confusing, but I think I get it.

 

I rewrote with two programs to separate the "If" and "then" functions. I also changed my variable from a state to an integer.

 

Since I wanted the humidifier to keep running if it was still humid, and not cycle off and back on, I added a second wait after resetting my variable, but before turning off the dehumidifier. This seems to work the way I want it to.

 

 

 Here are my programs:

 

post-5633-0-28316100-1414952842_thumb.png

post-5633-0-32434000-1414952831_thumb.png

 

Thanks again,

 

Bob

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.