Menu

Sunset and Sunrise

Help
airmax-b3
2008-05-08
2012-12-14
  • airmax-b3

    airmax-b3 - 2008-05-08

    I was wondering if it is possible to use the sunset/sunrise with linknx to trigger some events? I think it is not yet implemented - but would it be possible to add it? How could this be done?

     
    • jef2000

      jef2000 - 2008-05-08

      I already found 2 sunrise/sunset calculation algorithm that seems to work. I still have to choose which one is the best choice. I'll try to do it in the coming weeks, but cannot guarantee anything.

      Regards,

      Jean-François

       
    • airmax-b3

      airmax-b3 - 2008-05-10

      Yes, that would be really great. Looking forward for the results.

      Some kind of scripting ability is a thing that would be great in any way. ;)

       
    • jef2000

      jef2000 - 2008-07-02

      Hi,

      I finally was able to add the sunrise/sunset module. It's already checked in in CVS and will be officially released in next linknx release.

      Here's a short description of how it works:

      In <services> section of xml config, add something like:
      <location lon="4.20" lat="50.54"/>

      Then you can use something like this in a timer:
              <condition type='timer' trigger='true'>
                  <at type='sunrise' wdays='12' offset="1200"/>
                  <until hour='23' min='58' wdays='12'/>
              </condition>

      In <at .../> or <until .../> elements, you can set "type" attribute to "sunrise" , "sunset" or "noon". Of course, using "hour" and "min" attributes is useless, but "day", "month" and "year" still works, even if in most case you will use "wdays" and/or "exception" instead. The "offset" is a number of seconds added to the computed sunrise/set time. (negative offset should be possible also)

      The feature is not much tested yet, but basic functionality seems to work.

      Regards,

      Jean-François

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.