Announcement

Collapse
No announcement yet.

Solar Noon

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

    Solar Noon

    I want to trigger some events at solar noon, I have the following script that runs daily at 4 am to determine when Solar Noon will be that day, however there doesn't seem to be a system variable for current time that I can compare to z99 in this case

    Sub Main
    dim t
    t = hs.solarnoon
    hs.setdevicestring "z99",t
    End Sub

    z99 shows the time of solar noon in the device status screen properly. I want events to trigger at the value of z99

    any ideas?

    Jack
    Over The Hill
    What Hill?
    Where?
    When?
    I Don't Remember Any Hill

    Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

    #2
    Time() is the system variable for current time
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Jack,

      What you need to do is to first create the event, and set it to run at an absolute time - e.g. 12:00 PM. Then, your script would get the solar noon time, convert it to a string, and then set it as the new trigger time in the event.

      ev_time is the property you need to modify - all of them are listed here:
      http://www.homeseer.com/support/home...eventclass.htm

      The time should be in HH:MM AM/PM or HH:MM:SS AM/PM format.

      If your script were in .NET, it would be just .ToShortTimeString I think. With a VBS script, FormatDateTime(varDate, 3) or FormatDateTime(varDate, vbLongTime) will work so long as your computer's regional settings use the HH:MM AM/PM format.
      Regards,

      Rick Tinker (a.k.a. "Tink")

      Comment


        #4
        Thanks
        Over The Hill
        What Hill?
        Where?
        When?
        I Don't Remember Any Hill

        Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

        Comment


          #5
          Rick, Rupp,
          Ok I looked at the event class's, a little over my head. I do have a recurring script that runs once a minute that calculates system uptime. Within that script i have it set to get the system date and time, concatenate the two (because solarnoon format is 06/28/2006 12:30:00 PM) and then compare this with solar time. the problem I am having is the seconds. I guess I need to se if i can find the syntax for left$ and only go so many characters to the right, cutting off the seconds on those two strings.

          My goal is to automate the ventilation windows on my greenhouse depending on where the sun is

          Thanks!

          Jack
          Over The Hill
          What Hill?
          Where?
          When?
          I Don't Remember Any Hill

          Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

          Comment


            #6
            Jack,
            http://www.devguru.com is an excellent reference site.
            Here's the vbscript second function that may do what you need.
            http://www.devguru.com/technologies/vbscript/13968.asp
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Rupp, Thanks I was looking for devguru post to see where it was as you had pointed it out before.


              Maybe down the road Rick and Rich could make Solar Noon an event trigger, there are actually a lot of uses for it

              Thanks Again

              Jack
              Over The Hill
              What Hill?
              Where?
              When?
              I Don't Remember Any Hill

              Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

              Comment


                #8
                Jack,

                The solar noon calculation came as part of some libraries I integrated into HomeSeer to get a much more accurate sunrise/sunset calculation back in the 1.6 or 1.7 days. When I exposed it in the API so that it could be used, Rich laughed at me!

                While I have yet to find a use for it, I figured SOMEBODY would like to have it, so I am glad you are using it!

                I envy your having the greenhouse - I did not take up my father's green thumb, although I like plants, just not to the degree he did... We built a new house when I was in middle school which my family was convinced was done just so my dad could have a new 18'x33' greenhouse! I must admit though, it was a lot of fun sitting on a hammock in shorts in January while snowmobilers drove by outside....
                Regards,

                Rick Tinker (a.k.a. "Tink")

                Comment


                  #9
                  Rick, here in Flagstaff (elevation 7000') it is too dry, the nights get too cold and the wind blows a lot, it is almost impossible to grow any kind of vegetables. I have a 9' x 12' greenhouse for vegetables only. I have automatic vents in the roof, in the morning I have HS open the west side vents and once i get solar noon working it will close the west vents and open the east vents an hour after solar noon(we will see today at 12:30pm) if the event works. That way I still get ventilation but at the same time always have the side of the greenhouse that is facing the sun closed for full "greenhouse" effect. This will be especially useful in winter. I should (hopefully) be able to grow all year long this way. No more "cardboard tasting, picked green, store bought" vegetables for me!

                  If this works as planned, i have some ideas integrating solar noon into my hvac. here in the winter it can be single digits outside but still warm in the sun.

                  Thanks!

                  Jack
                  Over The Hill
                  What Hill?
                  Where?
                  When?
                  I Don't Remember Any Hill

                  Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

                  Comment


                    #10
                    Yep - I understand - I have experience with Mesa and Prescott through parents and grandparents! Good luck with the veggies!
                    Regards,

                    Rick Tinker (a.k.a. "Tink")

                    Comment


                      #11
                      Rick,

                      well my attempt at string manipulation failed. I did not get a tts test message that solar noon had just occurred. Any chance you could give Rich something to laugh about and tell him there is actually a user who needs solar noon in the event trigger drop down? (i'll overnight you guys a box of fresh veggies )

                      Being hopeful

                      Jack
                      Over The Hill
                      What Hill?
                      Where?
                      When?
                      I Don't Remember Any Hill

                      Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

                      Comment


                        #12
                        Jack,
                        How about something like this.
                        Keep the event you now have that runs at 4am and let it create the event for you. You will need to change the A1:dimto-60 to what ever you need to control like A1: on for example.

                        PHP Code:
                        Sub Main
                          t
                        =hs.SolarNoon
                          tFormatted 
                        FormatDateTime(tvbLongTime)
                          
                        hs.NewTimeEvent "test event",tFormatted""1111111"A1:dimto-60"0"","my group"
                          
                        hs.enableEvent("test event")
                         
                        End Sub 
                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #13
                          Rupp,

                          Ok I put your code in my event, changed the a1 variable to z94, manually ran the 4am event and it created the test event. I then created another event that triggers device value change to on for z94 and hopefully today at 12:30 Susi will speak "the geological solar noon has just occurred" will i have to delete the test event each day or will it just update the existing event. I have never created events on the fly like this

                          Thanks

                          Jack
                          Over The Hill
                          What Hill?
                          Where?
                          When?
                          I Don't Remember Any Hill

                          Virtualized Server 2k3 Ent X86 Guest on VMWare ESXi 4.1 with 3 SunRay thin clients as access points - HSPro 2.4.0.48 - ZTroller - ACRF2 (3 WGL 800's) - iAutomate RFID - Ledam - MLHSPlugin - Ultra1wire - RainRelay8 - TI103 - Ultramon - WAF-AB8SS - jvESS (11 zones) - Bitwise Controls BC4 - with 745 Total Devices - 550 Events - 104 scripts - 78 ZWave devices - 42 X10 devices - 76 DS10a's 3 RFXSenors and 32 Motion Sensors

                          Comment


                            #14
                            Jack,
                            A couple of questions. Is z94 only announcing that information? If it is you can get rid of z94 all together and have the event speak.

                            As far as recreating the event. You need to change the 0 to a 1 in the event to enable the event to delete itself after running. So it would become:
                            PHP Code:
                            hs.NewTimeEvent "test event",tFormatted""1111111"A1:dimto-60"1"","my group" 
                            This way each day it will be created at 4AM run at SolarNoon and then delete itself.
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              I would have throught it easier to just modify the trigger time of an existing event rather than creating a new one each day.

                              Dim ev

                              Set ev = hs.GetEventEx("solar noon greenhouse event")
                              If IsNothing(ev) then ' Or is it If Not IsObject(ev) Then..... ?
                                  hs.WriteLog "Error","Could not find the event."
                                  exit sub
                              End If
                              ev.ev_time = "12:15 PM" <--- Replace with your solar noon time formatted like this.
                              Regards,

                              Rick Tinker (a.k.a. "Tink")

                              Comment

                              Working...
                              X