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.

Program Associative Property...Like Algebra?

Featured Replies

Posted

I'm having problems with my program below. It isn't only working after sunset and before sunrise. It works 24 hours per day....what do I have wrong? Do ISY programs follow the associative property like in algebra (the order of the and & or doesn't matter)?

 

If
       Elk Zone 'Front Door' is Violated
    Or Elk Zone 'Garage Entry Dr' is Violated
   And From    Sunset 
       To      Sunrise (next day)

Then
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes 
       Set 'Insteon Bulb' Fast Off

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

To achieve the effect, ANDing the time range with either of the other conditions, add the parens as follows

If
{
       Elk Zone 'Front Door' is Violated
    Or Elk Zone 'Garage Entry Dr' is Violated
}
   And From    Sunset
       To      Sunrise (next day)

Then
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes
       Set 'Insteon Bulb' Fast Off

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

 

There is an order of precedence which is described in the Wiki

 

EDIT: The original Program without parens is the same as coding

If
       Elk Zone 'Front Door' is Violated
    Or 
    { 
         Elk Zone 'Garage Entry Dr' is Violated
     And From    Sunset
          To      Sunrise (next day)
    }
Then
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes
       Set 'Insteon Bulb' Fast Off

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

  • Author

Ok...I now have...

 

If
       From    Sunset 
       To      Sunrise (next day)
   And (
            Elk Zone 'Front Door' is Violated
         Or Elk Zone 'Garage Entry Dr' is Violated
       )

Then
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes 
       Set 'Insteon Bulb' Fast Off

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

 

It seems to be working correctly except it isn't turning off after 2 minutes of turning on. I want it to come on when the doors open the turn off 2 minutes later regardless of the doors being open or closed. Any ideas? Thanks!

The Elk zone is not staying violated. During the Wait the zone changes state causing the Program If section to be reevaluated to False driving the Else clause so statement(s) after the Wait are not executed.

The most reliable method would be to make a SECOND program with no if clause.

 

The wait statement and the turn off would be the THEN clause of the second program.

 

Have the THEN clause of the first program execute the THEN clause of the second program.

 

 

Sent from my iPad using Tapatalk HD

The most reliable method would be to make a SECOND program with no if clause.

 

The wait statement and the turn off would be the THEN clause of the second program.

 

Have the THEN clause of the first program execute the THEN clause of the second program.

 

 

Sent from my iPad using Tapatalk HD

 

Actually both are equally reliable with subtle differences.

 

Using the else clause restarts the timer when the door closes. Mostly an academic issue since exterior doors are usually not left open for long. But if you are carting a few things through the door it gives you the full 2 minutes of light once you are done and close the door.

 

Using the else clause restarts the timer at sunrise if you happened to open/close the door within 2 minutes of sunrise. This will rarely come into play and shouldn't make any difference to anyone anyway.

 

Using one program is a touch less confusing and saves space. But again not much difference.

  • Author

I'm now using the following program...

If
       From    Sunset 
       To      Sunrise (next day)
   And (
            Elk Zone 'Front Door' is Violated
         Or Elk Zone 'Garage Entry Dr' is Violated
       )

Then
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes 
       Set 'Insteon Bulb' Fast Off

Else
       Set 'Insteon Bulb' Fast On
       Wait  2 minutes 
       Set 'Insteon Bulb' Fast Off


The light still comes on before sunset. Today it came on at 4PM when I opened the door. It then turned off 2 minutes later.

 

What am I doing wrong?

The Else clause should not turn the light On.

 

Anytime the Elk zones are violated outside the desired time range the else clause runs turning the light On.

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.