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.

Using bitmasks in conditions

Featured Replies

Posted

I would like to use bitmasks in my programs.  I the idea being that each 'bit' represents some state of a system.  I found that I can do bit math when setting a variable, but I want to use that in conditionals.

 

I want todo this so that a variable for an item such as 'garage lights'  can remember all the programs that should still be true. Example I want to have them on between some given time period, but I also want to control them when my opener is operated.  I don't want the opener timeout to shut off the outside if the other program is still in effect.  Each bit would represent this sort of, 'don't forget you should still be doing this other code path while this one finished'.

 

Any thoughts how todo this?  It doesn't look like you can do variable math in the conditional at all.

 

Thanks

Doesn't look like it.

 

What I would do is add "And Program 'Lights On in Evening' is False" to the conditions for my "Turn off Garage Lights When Door Closes" program;  this way the program doesn't run if the other program is currently true.

 

I also have programs that exist just to provide a 'true' or 'false' statement for whether another program has run recently, like this:

Garage Door Opened Recently

If
        From    Last Run Time for 'Garage Door Opened'
        To      Last Run Time for 'Garage Door Opened' +  1 hour  (same day)
 
Then
        Wait  1 hour and 1 second

This makes it easy to add And Program 'Garage Door Opened Recently' is False" as a condition for other programs, and I edit just one program to change the definition of "Recently" everywhere it is used (maybe I want to make it 30 minutes instead of an hour).

 

I'm not sure if the wait does anything.

Hi brockp,

 

ISY does support bitmasks (&, ^, !) for variables. The only issue is that in your conditions you must use actual numbers.

 

With kind regards,

Michel

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.