2010-11-09

Sun rising over NetHomeServer


A couple of weeks ago I, started thinking about finally adding a timer that is controlled by the sunrise/sunset, but I realized I just did not have the time. The day after(!) Peter called and said he had found a Java API for getting sunrise/sunset, and that he wanted to write a HomeItem for this.

I guess it is the shorter days that made us think about this at the same time. After a short design session about how to specify the times Peter started working – and now he has finished the coolest HomeItem in a long time: DayLiteTimer!

For each day of the week, you can specify multiple times when the connected lamp shall be activated like: 08:00-10:00,17:00-21:00.

You can also refer to sunrise [R] or sunset [S] like: 08:00-[R],[S-00:30]-21:00, where [S-00:30] means 30 minutes before sunset.

It is also possible to specify a time interval, where the timer will take a random time within the interval: <15:00-17:00>-<23:00-00:20> meaning the lamp will turn on sometime between 15:00 and 17:00 and turn off sometime between 23:00 and 00:20.

It is also possible to combine all: <06:30-07:00>-<08:00-09:00>/[R+01:00] meaning that the lamp will turn on between 06:30 and 07:00 and turn off between 08:00 and 09:00 or at one hour after sunrise, whichever comes first. If one hour after sunrise occurs before the start time, the lamp will not turn on at all. DayLiteTimer is now available in the Nightly Build. Thanks Peter!!

12 comments:

  1. Hi,
    This is (was) the one thing that I missed the most with Homeserver. Thank you!
    But I think I found a bug:
    When I enter "05:30-[R],[S]-23:00" in the settings for any day, it evaluates to "On: 05:30, On: 15:29, Off: 23:00" which isn't what I expected.
    I expected "On: 05:30, Off: 08:28, On: 15:29, Off: 23:00" meaning, I think the [R] doesn't get evaluated in this expression. [R] seems to work with simpler experssions like "[R]-[S]".

    Maybe I'm wrong about this?

    ReplyDelete
  2. Oups - you are right, it should work... Unfortunately I am in the process of moving right now - so the svn repository server is packed in a box somewhere... So it will actually take a while before I can fix it. I will come back to you as soon as I have the possibility to correct it...

    ReplyDelete
  3. Soooo - finally the move is complete, meaning the repository server is back on line. I have now corrected the problem, so the intervals you wanted should work now.

    /Stefan

    ReplyDelete
  4. Thank you!
    As far as I have been able to test this it seems to be working.

    /Johan

    ReplyDelete
  5. Hi,
    I think I found another problem. I try to use your example "<06:30-07:00>-<08:00-09:00>/[R+01:00]", but when I press save the "+" sign disappers, and the expression don't evaluate correct.

    And now my real problem.
    What I want to do is something like:
    06:30-[R] and when [R]is before 6:30 the timer should stay off.

    /Johan

    ReplyDelete
  6. Hi,

    Have corrected the real problem... If end time occurs before start time, the timer stays off.

    /Stefan

    ReplyDelete
  7. Thank you!
    My timer are working again.

    /Johan

    ReplyDelete
  8. Is there an updated firmware for the v3 CUL?

    ReplyDelete
  9. I have not updated the firmware lately. Does v3 require an update?

    ReplyDelete
  10. Starting V3 the ATMega32U4 processor is used. Culfw apparently has (separate) support for it since v1.37. The precompiled nethomecul hex file kills the stick (nothing on USB), compiling the code does the same, config the new proc in makefile runs into compilation problems. Hope someone can have a look. TIA

    ReplyDelete
  11. *Sigh* I guess this means I will have to buy a V3 at some stage to be able to adapt, test and support it. I will put a warning on the site for now.
    Thanks a lot Bob for the analysis and testing!

    ReplyDelete
  12. Hi,

    Great project! I recently bought the CUL v3, and I patched the firmware to add support for it. Click on my name to download.

    Please let me know if you discover any bugs.
    My email is in the README_CULv3 file.

    Regards,

    Christian Aune Thomassen

    ReplyDelete