Scripting against Sunrise / Sunset

Discussion in 'C-Bus Automation Controllers' started by pspeirs, Apr 22, 2019.

  1. pspeirs

    pspeirs

    Joined:
    Nov 23, 2013
    Messages:
    185
    Likes Received:
    10
    Location:
    Sydney
    I needed a way to determine in a script whether to run between sunset and sunrise and found that the easiest method (unless someone has something different) was to create an Enable Control group with two levels.


    upload_2019-4-22_22-12-5.png


    Set up a scheduler with two events, one for setting the Enable Group to 255 on sunset and the other setting to 0 when the start time equals sunrise.

    upload_2019-4-22_22-13-15.png


    Now, from any script, just read the state of the enable control value.

    Just wish I could put a clock on the page though :-(


    Cheers,
    Paul
     
    pspeirs, Apr 22, 2019
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.