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.

Use of If From/For argument

Featured Replies

Posted

I am new to the ISY world. I am trying to turn a light on at a given time and then turn it off again 2 hours latter. Here is my coding:

 

If From Sunset + 45 minutes

For 2 hours

 

 

 

Then set 'Family room lights' 55%

set 'Kitchen lights' 55%

 

 

Else no actions

 

Then lights come on, but have to be manualy turned off. What am I doing wrong?

post-4811-140474157721_thumb.png

The Program has no statements to turn the devices Off. The Then clause is invoked at the From Time because the If evaluates to True. The Program is triggered again at the +2 hours invoking the Else clause because the If is now False. The current time is outside the time range, albeit seconds outside the range, which is why the If is False driving the Else. The Else contains the statements to turn the devices Off.

 

If From Sunset + 45 minutes

For 2 hours

 

Then set 'Family room lights' 55%

set 'Kitchen lights' 55%

 

Else set 'Family room lights' Off

set 'Kitchen lights' Off

If I may make another observation, you may also benefit from a scene. If you were to create a scene (giving the name of you choice) that includes the family room and kitchen lights, as responders, with 55% on levels each, then your program could be even more simplified. It might even be more responsive.

 

if

time if from sunset + 45min

for 2 hours

 

then

set scene on

 

else

set scene off

One other observation, is do you want the lights to ALWAYS turn off 2 hours later, e.g. someone is in the kitchen cutting with a knife and the lights go OFF.

 

Might be a good idea to check for a control of the kitchen light in another program and stop this program from turning them off.

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.