Announcement

Collapse
No announcement yet.

How to adjust for sunset and sunrise times in winter and summer?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to adjust for sunset and sunrise times in winter and summer?

    I have a few events that rely on sunset and sunrise times but I find that I am always having to change the +/- adjustments to time because sunset in winter is a lot darker than sunsets in spring and summer. And the same for sunrises. So if I have an event to turn on some lights at sunrise, I am finding I am adjusting the +/- over the months as the days get lighter or darker. How does everyone handle this?

    #2
    Personally, I use a luminence sensor and Easy Trigger to add a value from a virtual device to the luminance trigger. Then an event date driven can change that virtual device offset to account for summer/winter. It's also useful for "dialing in" the exact luminance value.

    I only use "sunrise" and "sunset" as a backup in the event the luminance sensor is offline. I use a virtual device to set that as well.

    Comment


      #3
      Ah, I have the same issue. I was told that others don't have that problem but I definitely experience the same thing as you do. I double checked my coordinates and they seem just fine. I am quite interested for a solution for this. Something where the +/- can be adjusted based don the day of the year (some kind of sinus curve where you can define the 0-crossoever and amplitude).

      Comment


        #4
        I have 2 events for my outside lights. One for Winter and one for Summer. I COULD do it with one event. Basically the winter one turns things on 25 minutes after sunset and the summer one is 15 minutes after sunset. Beyond that it is just an And for the dates. The summer one is just an After OR IF Before on the dates. I USE to have the summer one run all year but my wife needs to manually control the lights too much so these do not run that often. When the summer one ran all year she would turn the lights off in the winter and they would come on 10 minutes later. Yes, I just said that she would be watching for them to come on and immediately turn them off... 😩

        Click image for larger version

Name:	hs2.PNG
Views:	109
Size:	383.1 KB
ID:	1470506
        Karl S
        HS4Pro on Windows 10
        242 Devices
        56 Z-Wave Nodes
        37 Events
        HSTouch Clients: 3 Android, 1 iOS
        Google Home: 3 Mini units 1 display

        Comment


          #5
          ksum I notice that your date has the year in it. Do you have to change that every year?

          Comment


            #6
            Originally posted by pcgirl65 View Post
            ksum I notice that your date has the year in it. Do you have to change that every year?
            Good catch!!! Thank You!!! I needed to check the box for Any Year. So that image is now not in sync with my event. In older versions you put a Y in for the year. In HS4 you check a box. I want to say that when I set up the event that was missing, but I could be wrong on that memory. Too many beers since setting it up.
            Karl S
            HS4Pro on Windows 10
            242 Devices
            56 Z-Wave Nodes
            37 Events
            HSTouch Clients: 3 Android, 1 iOS
            Google Home: 3 Mini units 1 display

            Comment


              #7
              If the date is before April 1 OR After Sept.30. So this would be Oct. 1 - Mar.30? Could the event be written using AND IF instead of OR IF for the second date?

              IE:

              Time is sunset + 15
              AND IF The date is before April 1
              AND IF The date is After Sept.30
              AND IF The Group Conditions are True
              THEN
              Turn on Lights

              If we wanted to set it up for either Summer or Winter could we do it like your above with the OR IF conditions for the Summer months?

              Time is sunset + 15
              AND IF The date is before April 1
              AND IF The date is After Sept.30
              AND IF The Group Conditions are True

              OR IF
              Time is sunset -30
              AND IF The date is after March 31
              AND IF The date is Before Oct 31
              AND IF The Group Conditions are True

              THEN
              Turn on Lights

              Would this work?

              Comment


                #8
                Click image for larger version

Name:	screencapture-192-168-1-15-8000-events-html-2021-04-23-14_51_35.png
Views:	108
Size:	491.3 KB
ID:	1470514

                Comment


                  #9
                  The Dates take the year into account for figuring Before and After. So the date is never both Before April AND after September in the same calendar year. If you want something to happen Dec 31 And Jan 1 you need to use IF Before Jan 2 OR IF After Dec 30. Yes, December is Before January IF viewed from November. My grandfather always use to ask "Which comes first, Christmas Day or New Years Day?"
                  Karl S
                  HS4Pro on Windows 10
                  242 Devices
                  56 Z-Wave Nodes
                  37 Events
                  HSTouch Clients: 3 Android, 1 iOS
                  Google Home: 3 Mini units 1 display

                  Comment


                    #10
                    So the first part of the event would work because it is between months March-Sept. But the second part wouldn't work because the months are between October - February of the next year. Correct? I can see how this can become confusing trying to do it all in one event. Better to break it down into two. But the first part would work, right?

                    Comment


                      #11
                      The first part would. After March AND Before Sept gives you April to August. It could be done with 3 OR IF:
                      IF the date is Before March
                      OR IF the date is After February AND IF the date is Before Sept
                      OR IF the date is After August.
                      Adding, of course, and the time is __ after sunset
                      Karl S
                      HS4Pro on Windows 10
                      242 Devices
                      56 Z-Wave Nodes
                      37 Events
                      HSTouch Clients: 3 Android, 1 iOS
                      Google Home: 3 Mini units 1 display

                      Comment


                        #12
                        Do you have to put all the conditions in again after an OR IF?

                        Comment


                          #13
                          The pink OR IF starts a new group of conditions which are checked independently of the previous. So each bullet below is an independent set of conditions. When one set is met, the event runs. I would hope the program does not continue checking all the other OR IF options as that is just a waste of time. The conditions in any bullet item below do not care about the conditions in the other bullet items.
                          • IF (All of my conditions)
                          • OR IF (My Conditions, and only my conditions)
                          • OR IF (My Conditions and only my conditions)
                          Karl S
                          HS4Pro on Windows 10
                          242 Devices
                          56 Z-Wave Nodes
                          37 Events
                          HSTouch Clients: 3 Android, 1 iOS
                          Google Home: 3 Mini units 1 display

                          Comment


                            #14
                            The same situation is true for time as well. The day starts and ends at midnight, so the following conditions will never evaluate as true:

                            If...
                            AndIf Time is after 10pm
                            AndIf Time is before 6am

                            As the time can never be 10pm to 12midnight simultaneously with time being 12midnight to 6am.

                            Rather than complicate the logic with the OrIf triggers as described above, I use virtual switches to indicate day, night, winter, summer, or whatever. Makes the other dependent events simplier to create.

                            So for night, I have an event the sets a virtual switch to "Night" at sunset, and another event that resets that virutal switch to "Day" at sunrise. You could have a virtual switch that sets the "Season" on the apprpriate day of the year (i.e sets it to
                            "Winter" on December 21, and "Summer" on June 21). So then the other events would only need to reference that virtual switch:

                            If ...
                            AndIf Virtual Switch "Season" is set to "Winter"
                            Then....

                            One other advantage to using a virtual switch is that you can temporarily manually change the switch value to a different season in order to test out the your coding (testing your winter code in the middle of summer, for instance).

                            Comment


                              #15
                              This is also a good idea! Thanks for sharing. So, do you just adjust the time dependent on what time of year it is? So, if the Winter virtual switch is on then sunrise - 30 minutues and if the Summer virtual switch is on it is sunrise +30 minutes, etc.?

                              Comment

                              Working...
                              X