Jump to content

Help with Sunrise/Sunset in program


David D

Recommended Posts

I know this is probably a no brainer, but I thought I'd opt for the quick answer since writing a program the wrong way will result in lights going on or off at the wrong time and upsetting SWMBO (she who must be obeyed) :wink: (Yes, it's happened before...)

 

I have a SwitchLinc next to the door that we go in and out of that is our "Arrive" and "Leave" switch. I also have a LampLinc that is set to come on at Sunset and off at Sunrise unless otherwise controlled. What I'd like, is for my "Leave" scene to dim down this LampLinc to a preset level (say 30%) IF it's after Sunset or off completely if before Sunset.

 

Like I said, I know it's simple. I just want to get it right the first time so I don't mess things up and make my wife (and subsequently ME) uncomfortable!

Link to comment

I would try this with two programs. The first would cover the period between sunrise and sunset:

 

if from sunrise to sunset same day

and control switch is set off

 

then set lamp to off

The second program would look something like:

 

if from sunset to sunrise next day

and control switch is set off

 

then set lamp 30%

Link to comment

It is possible that I misunderstood, but the two requests I see are for 30% and off. Did I miss something?

 

What I'd like, is for my "Leave" scene to dim down this LampLinc to a preset level (say 30%) IF it's after Sunset or off completely if before Sunset.
Link to comment

I have two devices (the LampLinc in question and one exterior post light) that are in a "on at sunset, off at sunrise" program. Right now, when I turn off the SwitchLinc by the door ("Leave"), everything turns off except the post light.

 

What I WANT to happen when "Leave" is activated is the lamp in the Kitchen (the LampLinc in question) to turn off if it's during daylight hours (between sunrise and sunset) and dim to 30% at night (between sunset and sunrise). This way, if we leave the house after sunset, we're not shutting off the kitchen lamp and coming home to a dark house.

Link to comment

How is your exterior post light controlled? By the switchllinc? What does your switchlinc control directly, if anything?

 

Perhaps I understand your question a little differently now. If your switch is off, you want your lamplinc to go off at sunrise and to 30% at sunset. You want this to happen continuously for as long as you switch remains off, not just at the moment your switch is turned off, based on the conditions at the time.

 

If I understand correctly, there are a couple of ways that I would consider tackling this problem. One way would be to substitute status for control in my previously suggested two programs:

 

if from sunrise to sunset same day

and status of switch is off

 

then set lamp to off

 

The second program would look something like:

 

if from sunset to sunrise next day

and status of switch is off

 

Alternatively, you may consider creating a program folder which is active when the status of the switch is off. In this folder, place a program:

 

if from sunset to sunrise

 

then set lamp to 30%

 

else set lamp to off

 

Of course, you will want to test these to confirm that they work as you intend.

Link to comment

I have two programs for sunrise/sunset:

 

If time is sunrise

Then set 'Post Light' Off

Then set 'Kitchen Lamp' Off

 

 

If time is sunset

Then set 'Post Light' On

Then set 'Kitchen Lamp' On

 

The Kitchen Lamp is plugged into the LampLinc. The Post Light is connected to a KeypadLinc.

 

 

I want these programs to remain in effect. Basically, I want to add control such that if we leave the house anytime from 6:00 am to sunset, hitting the 'Leave' button will shut off the Kitchen Lamp (LampLinc). If it's sunset or afterwards and before 6:00 am, I want the Kitchen Lamp to dim to 30% when the 'Leave' button is activated.

 

I apologize if I've made this confusing! Thank you for your patience!

Link to comment

You could take your 2 programs and place them in a folder, set the condition of the folder to something like If "Leave is on" then the programs in this folder will run.

 

Create a new folder with a condition like If "Leave is off" ......

 

Inside this folder have a program like

 

If Status "Leave" is on
and from Sunset to Sunrise (next day)

Then
Set "Kitchen Lamp" 30%

Else
Set "Kitchen Lamp" Off

 

Tim

Link to comment

Sorry for the late reply on this. I'm having a hard time getting my head wrapped around this, even with all of your suggestions. My ADHD flares up and when it does, I have a hard time sorting things like this out. Let me chew on this for a little while. If anyone has more suggestions, feel free to make them. Maybe something will "click" and I'll "get it". :roll:

Link to comment

Ok, can I do it using a program like this?

 

If Status 'Dining Rm Entrance' is Off

and Time is after Sunset

Then set 'Kitchen Lamp' to 30%

Else set 'Kitchen Lamp' to Off

 

 

I would also add other devices into the program that would get shut off regardless of sunrise/sunset. but that should be straightforward, I would think.

Link to comment
Ok, can I do it using a program like this?

 

If Status 'Dining Rm Entrance' is Off

and Time is after Sunset

Then set 'Kitchen Lamp' to 30%

Else set 'Kitchen Lamp' to Off

 

First, perhaps we have not been as clear as we should. One does not actually "write" programs. The ISY does this for you, based on conditions and schedules and actions you define.

 

I believe you will have a problem with your program. It may not actually shut the lights off (it is always "after" sunset, whether a few minutes or 23 hours). I believe you should set the second condition to:

 

"and time is between sunset and sunrise".

Link to comment
Ok, can I do it using a program like this?

 

If Status 'Dining Rm Entrance' is Off

and Time is after Sunset

Then set 'Kitchen Lamp' to 30%

Else set 'Kitchen Lamp' to Off

 

First, perhaps we have not been as clear as we should. One does not actually "write" programs. The ISY does this for you, based on conditions and schedules and actions you define.

 

I believe you will have a problem with your program. It may not actually shut the lights off (it is always "after" sunset, whether a few minutes or 23 hours). I believe you should set the second condition to:

 

"and time is between sunset and sunrise".

 

Looking at the program options, I don't see the ability to enter "and time is between sunset and sunrise". It gives options for setting time is before or after sunrise or sunset, but not between. Do I need to enter two lines such as?:

 

And time is after sunset

and time is before sunrise

Link to comment

I apologize for the confusion. It is actually "from". Under the program details tab, add to program: "schedule". In the little schedule window, choose the drop down arrow at "time is", and you can choose "from". This will give you beginning and end times.

 

The actual condition will end up looking like:

 

If

 From    Sunset 
       To      Sunrise (next day)

Then

Else

Link to comment

Hi David,

 

I think the simplest way is to use two programs.

 

Away Nighttime

If
       From    Sunset 
       To       6:00:00AM (next day)
   And Status  'Dining Rm Entrance' is Off

Then
       Set 'Kitchen Lamp' 30%

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

 

Away Daytime

If
       From     6:00:00AM
       To      Sunset  (same day)
   And Status  'Dining Rm Entrance' is Off

Then
       Set 'Kitchen Lamp' Off

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


 

You may want to use Control instead of Status. Control will only trigger the program when you press the switch.

 

To paste your programs here right click on the program and select 'Copy to Clipboard'. Paste it between Code tags.

 

Rand

Link to comment

OK, I think I've got it working. Still need to figure out how to add Button A from a KeypadLinc so I can activate the 'Arrive' and 'Leave' programs from another entrance, but here's what I have thus far:

 

'Leave (Daytime)'

 

If

Control 'Dining Rm Entrance' is switched Off

And From Sunrise

To Sunset (same day)

 

Then

Set Scene 'Master BR Main' Off

Set 'Kitchen Lamp' Off

Set Scene 'LR Lamps' Off

Set 'Dining Rm Lamp' Off

 

Else

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

 

 

Second program:

 

'Leave (Nighttime)'

 

If

Control 'Dining Rm Entrance' is switched Off

And From Sunset

To Sunrise (next day)

 

Then

Set Scene 'Master BR Main' Off

Set Scene 'LR Lamps' Off

Set 'Dining Rm Lamp' Off

Set 'Kitchen Lamp' 50%

 

Else

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

Link to comment
Still need to figure out how to add Button A from a KeypadLinc so I can activate the 'Arrive' and 'Leave' programs from another entrance

That's pretty easy to add to what you have, something like this:

 

'Leave (Daytime)'

If
  (
       Control 'Dining Rm Entrance' is switched Off
   Or  Control 'KPL Button A' is switched Off
   )
   And From    Sunrise
       To      Sunset  (same day)

Then ...

 

--Mark

Link to comment

Ok, I've got things to where they work (almost). What is happening now is that after Sunset, if I turn off the Dining Rm Entrance ('Leave'), everything shuts off, including the Kitchen Lamp and the Post Light. What is supposed to happen is if it's after Sunset, all lights should shut off except for the Post Light and the Kitchen Lamp which should dim to 50%. What am I doing wrong?

 

Leave (Daytime)

 

If

Control 'Dining Rm Entrance' is switched Off

Or Control 'Living Rm Keypad Button A' is switched Off

And From Sunrise

To Sunset (same day)

 

Then

Set Scene 'Master BR Main' Off

Set 'Kitchen Lamp' Off

Set 'Living Room Keypad - Post Lig' Off

 

Else

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

 

 

Leave (Nighttime)

 

If

Control 'Dining Rm Entrance' is switched Off

Or Control 'Living Rm Keypad Button A' is switched Off

And From Sunset

To Sunrise (next day)

 

Then

Set Scene 'Master BR Main' Off

Set 'Kitchen Lamp' 50%

 

Else

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

Link to comment
Ok, I've got things to where they work (almost).

The parentheses in my example are important, and are not present in your latest code. The underlying problem is that AND is higher precedence than OR, and so the logic is incorrect without the parens. As you write it, "Control 'Living Rm Keypad Button A'" is tested only during the time periods, but "Control 'Dining Rm Entrance'" is always effective. Your two programs battle it out on this event, and it's indeterminate who wins.

 

Put the parens in and see if that fixes it.

 

--Mark

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...