Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Macro which queries the clock

  1. #1
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    261

    Default Macro which queries the clock

    Hi All,

    Anyone know of a way to create a macro, when that when triggered, checks the time (and does something based on it)?

    In this case, I want to connect it to an outside light level sensor, such that when it goes dark in the evening, if it's within a particular time range, to turn on some driveway lights.

    Cheers,

    Marcus

  2. #2
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,674

    Default

    we'd use General Logic for this, with a TimeWindow gate in the logic …

    Tools … General Logic … … Add … Time Window … Add … AND …
    Last edited by chris_j_hunter; 13th March 2014 at 10:45 AM.

  3. #3
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    261

    Default

    Quote Originally Posted by chris_j_hunter View Post
    we'd use General Logic for this, with a TimeWindow gate in the logic

    Tools General Logic Add Time Window Add AND

    Ohh interesting (not come across this Time Window GL before). Thanks Chris!

  4. #4
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    818

    Default

    There is an existing behaviour for the light object (At lighting up time and dark to turn on, lighting off time to turn off). Or would this not cover the full requirement?

  5. #5
    Automated Home Sr Member mcockerell's Avatar
    Join Date
    Jan 2009
    Posts
    71

    Default

    I use that mode of operation for the lamppost in the driveway, but this only gives one operating period (this is every evening for us).
    I then have a virtual light object set to switch only on light level that is enabled and disabled by events - these are set for appropriate times on weekday mornings.
    The virtual light object is connected to the follow state input of the lamppost light object, so triggers it on for dark mornings - thanks to Karam for explaining how to do this.
    The advantage of this approach is that I have also been able to set a separate event which turns the lamppost on earlier on the morning that my wife has a very early start.

    Hope this helps.

  6. #6
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    261

    Default

    Quote Originally Posted by m****erell View Post
    I use that mode of operation for the lamppost in the driveway, but this only gives one operating period (this is every evening for us).
    I then have a virtual light object set to switch only on light level that is enabled and disabled by events - these are set for appropriate times on weekday mornings.
    The virtual light object is connected to the follow state input of the lamppost light object, so triggers it on for dark mornings - thanks to Karam for explaining how to do this.
    The advantage of this approach is that I have also been able to set a separate event which turns the lamppost on earlier on the morning that my wife has a very early start.

    Hope this helps.
    Hmm thanks for replies, will look into it / see if I can get this to work.

  7. #7
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    261

    Default

    Quote Originally Posted by m****erell View Post
    I use that mode of operation for the lamppost in the driveway, but this only gives one operating period (this is every evening for us).
    I then have a virtual light object set to switch only on light level that is enabled and disabled by events - these are set for appropriate times on weekday mornings.
    The virtual light object is connected to the follow state input of the lamppost light object, so triggers it on for dark mornings - thanks to Karam for explaining how to do this.
    The advantage of this approach is that I have also been able to set a separate event which turns the lamppost on earlier on the morning that my wife has a very early start.

    Hope this helps.
    Hmm I think this might be the best bet for what I'm trying to achieve (weekdays only, if it goes dark between 6 - 6:45pm, to turn on driveway light). However I can't seem to see a virtual light object to add?

    Thanks in advance,

    Marcus

  8. #8
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,674

    Default

    virtual just means an object that's not been enabled - so, for a light, add a module of any type that has a relay, and add a Light in the usual way - the module has no physical reality, so don't enable it, and its virtual …

  9. #9
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    818

    Default

    You may find the legacy relay object is useful for creating such virtual objects

  10. #10
    Automated Home Ninja marcuslee's Avatar
    Join Date
    Dec 2009
    Posts
    261

    Default

    Quote Originally Posted by Karam View Post
    You may find the legacy relay object is useful for creating such virtual objects
    Thanks for everyone's assistance.

    I'm looking into this, and I'm not sure if I can find a way to get this to work.

    Specifically:
    - I have an event scheduled that at 6:30pm every week day it checks if it's dark, if so, turn light on
    - I have an event scheduled at 7:30pm every week day it turns light off

    However I want to cover the possibility that in between 6:30 and 7:30pm, on week days, if it goes from bright to dark outside, it turns on the light.

    Not sure how I can do this last bit?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •