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.

ISY programming question

Featured Replies

Posted

I wasn't clear on this from the wiki -

 

 

I want to make a program that IF it's dark out AND either one of two zones is violated THEN turn on some lights.

 

IF

Time between dusk and dawn

AND

(Zone 1 violated OR zone 2 violated)

 

 

Not sure how to get the AND/OR correct.  Probably something with the AND (...) buttons but wasn't sure how to get this to work.

Thanks!

You're pretty much there.  

  • Start with the sunset to sunrise (next day).
  • Add the zones. I would use control to catch them going on, but you may want to use status in case that they are on. They may be from an elk, use whatever statements tell you that the zone is violated.
  • Then add the Add And (..)  using the buttons on the right in the admin console. Use the Move Line Up button on the left to put the parens around the code for the zones:

You'll want And, because both things need to be true. Using Or, either event will cause the program to run, which doesn't meet your requirement.

New Program Copy - [ID 004B][Parent 0001]

If
        From    Sunset 
        To      Sunrise (next day)
    And (
             'Zone' is switched On
         And 'Zone' is switched On
        )
 
Then
   - Your Stuff

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

Paul

I wasn't clear on this from the wiki -

 

 

I want to make a program that IF it's dark out AND either one of two zones is violated THEN turn on some lights.

 

IF

Time between dusk and dawn

AND

(Zone 1 violated OR zone 2 violated)

 

 

Not sure how to get the AND/OR correct.  Probably something with the AND (...) buttons but wasn't sure how to get this to work.

Thanks!

 

 

Just the way you wrote it but one condition per line.

 

IF

        From sunset

        To sunrise (next day)                     <----Time between dusk and dawn

AND (

           Zone 1 violated

    OR zone 2 violated

         )

 

Then

   ....

 

Click on the And() or Or() and slide them up or down to where you want.

 

EDIT: Sorry Paul. I formulated this post and then the doorbell rang after which I hit Post. LOL

Edited by larryllix

I run a lot of  test programs to try things out. Use a beeper or even a program to indicate the code is being executed.

 

 

Test Indicator (Not enabled)

If

    --

Then

     Wait 1 second

     Run program 'Test Indicator' (else)

 

Else

   ---

 

Now when you insert the line in your programs Run program 'Test Indicator' (If)' you will see the program icon turn to red and back every time YOUR ISY program passes through that point.

 

When you are sure about your program, remove the test line.

 

NOTE: You have to have your icons colours enabled for this. This is a right click option on the program tree.

post-4697-0-10566800-1449418530_thumb.jpg

Edited by larryllix

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.