brain shocker Posted May 5, 2015 Posted May 5, 2015 Need some help with programs to run a scene(winter) from 6:30 to 7:30 before sunrise but if it is after sunrise I need scene(summer) to run from 6:30 to 7:30. Please excuse the wording I don't have the program in front of me Program 1: If before sunrise -10 minutes and mon, tues, wed, thurs, fri 6:30 - 7:30 Then run scene winter Else stop scene winter Program 2: If after sunrise +10 minutes and mon, tues, wed, thurs, fri 6:30 - 7:30 Then run scene summer Else stop scene summer I know its simple but I can't get it to work any help would be appreciated. TIA
larryllix Posted May 5, 2015 Posted May 5, 2015 (edited) Need some help with programs to run a scene(winter) from 6:30 to 7:30 before sunrise but if it is after sunrise I need scene(summer) to run from 6:30 to 7:30. Please excuse the wording I don't have the program in front of me ..... Since the syntax will be critical on this perhaps you can paste your programs here for the exact wording. Right click on the program's icon (in ISY's Admin Console) and select "copy to clipboard". Then paste it here. One point of possible misunderstanding is the time conditions using sunrise do not have a before or after. They will trigger at an exact time specified only. Any event listed in your "If" section will cause the whole logic to be evaluated and run then or else depending on the outcome. At 7:30 on weekdays both "elses" will run. Edited May 5, 2015 by larryllix
brain shocker Posted May 5, 2015 Author Posted May 5, 2015 I will have to post it later today when I have my laptop
larryllix Posted May 5, 2015 Posted May 5, 2015 (edited) I will have to post it later today when I have my laptop Do the programs have to exactly at 6:30 and stop at 7:30? If so the determination of season using sunrise will cause problems in the same program. It appears to only ever start the "Then" sections based on your sunrise times. At 6:30 and 7:30 the "If" logic in both programs can never be true and the "Else" sections will always run. The time range will not work that way. Edited May 5, 2015 by larryllix
brain shocker Posted May 5, 2015 Author Posted May 5, 2015 Yes I need the scenes to only run between 6:30 and 7:30. The only difference being if it's light outside a scene (summer) will run but if it's dark outside scene (winter) will run Sent from my SM-G920W8 using Tapatalk
oberkc Posted May 5, 2015 Posted May 5, 2015 I am not sure I understand the intentions here. One can turn a scene on or off at certain time, but I don't understand the meaning of "running" a scene over a time period. And, what do you want to happen, and when, if sunrise is between 630 and 730 rather than before or after?
larryllix Posted May 5, 2015 Posted May 5, 2015 (edited) Yes I need the scenes to only run between 6:30 and 7:30. The only difference being if it's light outside a scene (summer) will run but if it's dark outside scene (winter) will run Sent from my SM-G920W8 using Tapatalk "Between" or from-to exactly? From-to time conditions initiate Then - Else at only those two exact times. There will be time where a partial run may happen or they neither will run. If you want one program to always run depending on season I would use a variable called say.. $Nightime. Program Night.detection If ..From sunset+10 minutes ..To sunrise-10 minutes Then ..set $Nightime to $cTrue (I define variable names as constants =1) Else ..set $Nightime to $cFalse Program Event.trigger If ..From 6:30 AM ..To 7:30 AM Then ..Run program Event.season Else ..Run program Events.stopAll (common off program/scene) Program Event.season (disabled to stop self triggering) If ..$Nightime is $cTrue Then ..Run program winter scene Else ..Run program summer scene The sunrise times will not have your offset in them so some inaccuracies may be incurred but if the most important time is 6:30 and one always must be run this may do your job or be another route to contemplate. Edited May 5, 2015 by larryllix
brain shocker Posted May 5, 2015 Author Posted May 5, 2015 I am not sure I understand the intentions here. One can turn a scene on or off at certain time, but I don't understand the meaning of "running" a scene over a time period. And, what do you want to happen, and when, if sunrise is between 630 and 730 rather than before or after?Sorry just my wording scene on at 6:30 , scene off at 7:30 Sent from my SM-G920W8 using Tapatalk
larryllix Posted May 5, 2015 Posted May 5, 2015 (edited) Another possibility (and second thought)would be to define a variable called $Winter that would be evaluated set every day. The time could be tweaked with experience. Program Set_Season If ..at sunrise every day Then ..run Program Set_Season.2 Else -- Program Set_Season.2 (disabled so times don't trigger) If ..From 12:00:01 AM ..To 7:00 AM (adjust by experience) Then ..set $Winter to $cFalse Else ..set $Winter to $cTrue Now the rest should be fairly straightforward. Program Event If ..From 6:30 AM M-F ..To 7:30 AM Then ..run program Event.season Else ..set scene winter Off ..set scene summer Off Program Event.season (disabled but $Winter is not a state var. and won't auto-trigger anyway) If ..$Winter is $cTrue Then ..set scene winter On ..(Wait 1 hour ..set scene winter Off = alternative to time range usage above) Else ..set scene summer On Note that time frames filters are usually best in separate DISABLED programs because the end time triggers the else section if you are using code there. Edited May 5, 2015 by larryllix
Xathros Posted May 5, 2015 Posted May 5, 2015 (edited) How about this: Program: Morning Scene A If Time is from 6:30 am To 7:30 am (Same Day) Then Run Program 'Morning Scene B' IfPath Else Set Scene 'Summer' Off Set Scene 'Winter' Off Program: Morning Scene B(Disabled) If Time is From Sunrise to Sunset (Same Day) Then Set scene 'Summer' On Else Set scene 'Winter' On The first program initiates an action at 6:30 to turn on a scene and at 7:30 to turn of both scenes (only one would have been on). The second disabled program is called by the first and turns on the summer scene if the time is after sunrise or the winter scene if the time is before sunrise. I believe this would fit the stated goal. Hope this helps. -Xathros Edited May 5, 2015 by Xathros
larryllix Posted May 5, 2015 Posted May 5, 2015 (edited) How about this: .... I believe this would fit the stated goal. Hope this helps. -Xathros Yeah! what he said! I was getting around to that in about another five-six hours but I had to warm him up first! Edit: replaced minutes with hours Edited May 5, 2015 by larryllix
brain shocker Posted May 5, 2015 Author Posted May 5, 2015 Thanks guys I will try these out. It sounded simple in my head just couldn't get it on paper Sent from my SM-G920W8 using Tapatalk
Xathros Posted May 5, 2015 Posted May 5, 2015 Thanks guys I will try these out. It sounded simple in my head just couldn't get it on paper Sent from my SM-G920W8 using Tapatalk Always happy to help. -Xathros
stusviews Posted May 5, 2015 Posted May 5, 2015 I use four programs, one for each season based on my location and one program to control the lighting (and window coverings). Example season: Fall - [iD 0056][Parent 0046]If From 12:01:00AM on 2015/08/06 To 11:59:00PM on 2015/11/05 And Time is Sunset - 10 minutes Then Run Program 'Sunset Lighting' (Then Path) Run Program 'Sunset Shading' (Then Path) Else - No Actions - (To add one, press 'Action') I do need to change the dates once a year, but ISY version 5 should alleviate that need. And you need only two programs
Recommended Posts