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.

Simple programming question

Featured Replies

Posted

I've got a bunch of programs and they're all running fine, but I'm trying to add one that should be simple but I can't get it to work.

Here's what I'm trying to do: On Mondays I leave the house at 5:30 AM, and on Tuesday, Wednesday, and Thursday I leave at 6:00.  If it's dark when I leave I would like the side yard light to be on for 15 minutes.  Here's what I've got at the moment:

If
   From    Sunset 
   To      Sunrise (next day)
   And     On Tue, Wed, Thu
           Time is 6:00:00AM
   Or      On Mon
           Time is 5:30:00AM
Then
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 100% (on Level)
     Wait 15 minutes
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 0% (on Level)
Else
   -No actions

I tried changing "Sunrise" to "same day" but it is still never running.  This has got to be something ridiculously simple that I'm overlooking.  What is it?

 

Thanks!

 

-Rick

There's no need for the Sunset-Sunrise condition.

I assume you are using the sunrise and sunset conditions as "dark", correct?

 

I suspect you have some logical priority issues here.  This can be corrected with a couple of parenthesis.  I also suspect your THEN clause is incorrect.  Rather than setting the responder levels, simply turn the scene on.

 

If
   From    Sunset 
  
To      Sunrise (next day)
   And

(

On Tue, Wed, Thu
           Time is 6:00:00AM
   Or   On Mon
           Time is 5:30:00AM

)

Then
     Set scene 'Outside / Side Yard'  ON
     Wait 15 minutes
    
Set Scene 'Outside / Side Yard'  OFF
Else
   -No actions

Try this. The parenthesis supercedes the AND which has a higher priority than the OR.

It should have worked on Mon at 5:30 regardless

 

If
   From    Sunset
   To      Sunrise (next day)
   And  (

           On Tue, Wed, Thu
           Time is 6:00:00AM
   Or      On Mon
           Time is 5:30:00AM

            )
Then
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 100% (on Level)  <--- set scene ON not modify it
     Wait 15 minutes
     In Scene 'Outside / Side Yard'  Set 'Outside / Side Yard' 0% (on Level)    <---set scene Off, not modify it
Else
   -No actions

 

EDIT: OberKC is correct.I missed the then problem. Modifying scenes does not activate them.

Edited by larryllix

oberck is correct. The scene should be set to On of Off.

  • Author

Thanks!

I didn't know about parenthesis.  I'll read up on it.

 

I modified my program as suggested in post#4 above.  I'll report back when I find out if it works tomorrow morning.

 

Appreciate the help!

 

-Rick

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.