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.

What's wrong with this program?

Featured Replies

Posted

I'm trying to get the landscape lights to come on at about 10 minutes past sunrise unless it's cloudy. Here is my program

 

If

When time is sunset

and Module 'Climate' Light is 0

 

Then

Set Scene 'Landscape Lights' On

 

Else

Wait 10 minutes

Set Scene 'Landscape Lights' On

 

 

I'm getting landscape lights turning on at various times during the day. Even during daylight.

I suspect you are either getting dark cloud cover or someone is setting something on or over the light sensor of the weather station you are using. That's causing the light level to reach 0, which triggers evaluation of your program. Since the result is False (because it isn't Sunset), it executes the Else statement.

 

Easily solved by splitting this into multiple programs:

 

 Sunset timer

If
       Time is Sunset 
Then
       Run Program 'Landscape Lights' (If)

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

 

 Landscape Lights
If
       Module 'Climate' Light is 0 

Then
       Set Scene 'Landscape Lights' On

Else
       Wait  10 minutes 
       Set Scene 'Landscape Lights' On

how does splitting it help? His if is sunset AND light at 0. You seem to describe the problem as if its executing in an OR method.

how does splitting it help? His if is sunset AND light at 0. You seem to describe the problem as if its executing in an OR method.

That's exactly the effect of the original program, although with respect to the ELSE part, not the THEN part. Remember that individual components of the IF are evaluated whenever they happen. So the evaluation of Light value happens indepedently of whether it's sunset or not, and the program continues accordingly.

 

So, yes, the original conditions are ANDed. But this also means that the inverses are ORed: If either condition is FALSE, then the whole condition is FALSE and the ELSE part of the program runs. In this case, any time the climate module spits out an event that says the light value is not 0, then the Landscape Lights will come on 10 minutes later via the ELSE part of the program.

Whoops, neglected to mention that my second program has to be disabled to prevent the same problem from happening when the climate module says the light level is NOT 0!

 

Thanks, Markens, for pointing that out.

  • Author

Thanks for the help. I didn't realize that if the first statement was false, the program would be evaluated. I had assumed that with the first statement being a timed event, it would force the program to only be evaluated once daily.

 

I guess else statements can get you in trouble unless you know what you are doing.

  • Author

That seems to have fixed my issues that I was having.

 

Thanks for all your help.

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.