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.

and+or?

Featured Replies

Posted

If I create a program that contains both an 'and' and an 'or' in the IF statement, how does it get parsed?

 

IF

status "switch 1" is on

and status of "switch 2" is on

or status of "switch 3" is on

 

Is it parsed like this:

 

IF

[status "switch 1" is on

and status of "switch 2" is on]

or status of "switch 3" is on

 

or like this:

 

IF

status "switch 1" is on

and [status of "switch 2" is on

or status of "switch 3" is on]

 

 

It might be nice to clarify that in the program content window when the commands are entered.

Hi Mike,

 

All the And conditions are grouped together, making your first example the correct one.

 

i.e.

A and B or C and D is equivalent to (A and B) or (C and D)

  • Author

Thanks...

 

So, I can combine these 2 programs:

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'FoyerControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

Else
  - No Actions - (To add one, press 'Action')

 

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'MasterBedControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

Else
  - No Actions - (To add one, press 'Action')

 

 

 

..with this:

 

 

If
       Program 'Floor 1 Status Update' is False
   And Status  'FoyerControls1G' is not Off
    Or Program 'Floor 1 Status Update' is False
   And Status  'MasterBedControls1G' is not Off

Then
       Set  Scene 'Floor1StatusLight' Off

Else
  - No Actions - (To add one, press 'Action')

 

Correct?

Yes, you can combine these programs.

 

You should also be aware of the And (...) / Or (...) buttons, they allow you to explicitly specify parentheses so you can have more complex programs.

  • Author

Doh!!!! I didn't even see that!

 

OK, so is this the equivelant?

 

If
       Program 'Floor 1 Status Update' is False
   And (
            Status  'MasterBedControls1G' is not Off
         Or Status  'FoyerControls1G' is not Off
       )

Then
       Set  Scene 'Floor1StatusLight' Off

Else
  - No Actions - (To add one, press 'Action')

Mike:

 

That looks to me like it should work.

 

I used the parentheticals already in one program and they worked as expected.

 

 

Best wishes,

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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.