Skip 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.

Programs - Control vs State?

Featured Replies

Hi - just looking for insight on more programming tips.

When creating if statements - one has the option of using "Control" or "State". I just want to clarify the difference to see if my understanding is correct.

Control:

An if statement that uses "Control" means that the program is triggered automatically by the EISY if the appropriate action has been taken from the control. For example, if the program (Program A) has "If x-control is switched on" - this will automatically fire the "Then" statements - so if someone turns on that switch - this program will automatically be initiated by the EISY. Conversely if the program contained "if x-control is switched off" then if someone turns off the control then the "then" part of the program would be initiated y the EISY. Finally - if the if contained "if x-control is switched on OR if x-control is switched off" then the EISY would initiate the "then" part of the program with the control is switched on or off.

Follow up to this - if the x-control is turned on via another program - would this also trigger "Program A" as defined above - in other words - it does not matter whether the switch is physically or logically turned "on" - the EISY would initiate "Program A"?

Status:

This simply allows you to check the status of a control from within a program - but is not automatically initiated by the EISY if something physically happens at that control (or if the control status is changed by a program).

Can someone confirm that this is the case? Or am I missing something?

If Control will trigger even if the device is already in that state so if a switch is on and you tap on at switch it will trigger.

If Status only triggers if the device state changes from some other state so if it’s on and you tell it on again it will not trigger.

2 hours ago, SMonk said:

Follow up to this - if the x-control is turned on via another program - would this also trigger "Program A" as defined above - in other words - it does not matter whether the switch is physically or logically turned "on" - the EISY would initiate "Program A"?

No. This is not correct. "Control" is only if a device is PHYSICALLY operated.

If a program might say at 2:30pm turn off a device and another program says if the device is "controlled"/switched "OFF" then do another step. If the program turns off that device the other step is not performed. Just tested this with devices in my office. If I manually turned off the device then the next program would run.

What you're looking for there is to either put another line in the "THEN" to call on the "then" of the 2nd program or change the second program to a "Status" so if the status of "device x" changes to "OFF" then the second program would run.

The second program would have two "IF" statements of "if switched (controlled) off" or "if status IS off".

As @hart2hart points out the device can be in the state already and physically controlled to that state it will trigger the program. If the lights are off and you press the switch to off again the program would trigger.

Lastly, for your multiple posts about questions it will help if you can give a program you're working on by including in your post rather than lengthy descriptions. Try a program. If it doesn't work as you expect then posting the program here gives us an idea of what you're attempting and might lead to suggestions of what to alter. Just be sure you post the program as text and NOT a screenshot! Text programs are many times easier to alter/edit to help you along the path. Right click on the program and select the last menu option of "COPY to Clipboard" then paste as text in your thread.

  • Author
4 hours ago, hart2hart said:

If Control will trigger even if the device is already in that state so if a switch is on and you tap on at switch it will trigger.

If Status only triggers if the device state changes from some other state so if it’s on and you tell it on again it will not trigger.

Ok - cool - thanks - so the programs for a "switch" will trigger whenever that switch is tapped irrespective of whether the program "IF" uses the "control" check whether it uses the "status" check - interesting - was not aware of that.

2 hours ago, Geddy said:

No. This is not correct. "Control" is only if a device is PHYSICALLY operated.

If a program might say at 2:30pm turn off a device and another program says if the device is "controlled"/switched "OFF" then do another step. If the program turns off that device the other step is not performed. Just tested this with devices in my office. If I manually turned off the device then the next program would run.

What you're looking for there is to either put another line in the "THEN" to call on the "then" of the 2nd program or change the second program to a "Status" so if the status of "device x" changes to "OFF" then the second program would run.

The second program would have two "IF" statements of "if switched (controlled) off" or "if status IS off".

As @hart2hart points out the device can be in the state already and physically controlled to that state it will trigger the program. If the lights are off and you press the switch to off again the program would trigger.

Lastly, for your multiple posts about questions it will help if you can give a program you're working on by including in your post rather than lengthy descriptions. Try a program. If it doesn't work as you expect then posting the program here gives us an idea of what you're attempting and might lead to suggestions of what to alter. Just be sure you post the program as text and NOT a screenshot! Text programs are many times easier to alter/edit to help you along the path. Right click on the program and select the last menu option of "COPY to Clipboard" then paste as text in your thread.

Thank you - that helps - and also good to know. Thanks!

Regarding posting the programs - yup planning on doing that when I gain the right level of knowledge to construct it/them appropriately (and will post the text - not a screen shot LOL). Cheers!

Control statement important considerations

1) Only an action originating at that device is a trigger. Typically that means you physically acted on the switch. However, things likes motion sensors would also trigger a control statement if it picked up motion because that device is the origin, it isn't responding to another device.

2) The status of a device is not relevant to a control statement of a program. (though you can still have separate status lines in the same program, see point 5)

3) Use "is" logic to trigger true, use "is not" to trigger false and you can have both in the same program. For example:

if device a is control switched on and device a is not control switched off. In this case, the program runs true when you click the on paddle, and runs false if you click the off paddle. What it does is make the program mirror an action at the switch.

4) A control statement using "is" logic will only ever be true if it is the trigger of the program. So if you mix status items into a program with control, then that program will never be true when triggered by the status line. Using "is not" logic is the same but opposite. Also along these lines, you would never have two "control is" statements in the same program if you ever wanted it to run true because you can never have two devices simultaneously hit the program at once. No matter how hard you try to hit two light switch on paddles at the same time, one will always come before the other.

5) You can combine status and control for certain logic. For example: If device a status if off and device a is control switched off, then . . . . In that case, if the light is off already, and you push the off paddle the program runs true. In my home I use this as a night light feature where I can get up in the middle of the night, hit the off paddle and the program turns the light on to 10% instead of the usual on level.

6 hours ago, apostolakisl said:

5) You can combine status and control for certain logic. For example: If device a status if off and device a is control switched off, then . . . . In that case, if the light is off already, and you push the off paddle the program runs true. In my home I use this as a night light feature where I can get up in the middle of the night, hit the off paddle and the program turns the light on to 10% instead of the usual on level.

I used to do that, too, but my other house occupants couldn't get their heads around the idea that pressing off would turn on the light! However, I do make use of it to turn other lights off. For example, if you turn off the over sink light and then press off again it turns off the under counter lights which have a separate switch farther away.

Create an account or sign in to comment

Account

Navigation

Search

Search

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.