Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Help; macro to control manual light switch

  1. #11
    Automated Home Guru JonS's Avatar
    Join Date
    Dec 2007
    Location
    Suffolk
    Posts
    201

    Default

    So you want to be able to manually switch the light off on exiting a room but for it to come on again as soon as you re-enter??

    I've not tried this but could you run a macro to re-set override if the light has been forced off?
    It runs every n-minutes same as the light timeout.
    If the light is off and override set set a flag
    If flag set when macro starts, clear override.

    This won't work if you return within the time for the marco to run twice.

    2p
    Jon

  2. #12
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    604

    Default

    The problem with your suggestion is I couldn't find a way to interrogate the current setting of the light. So I can't "ask" Cortex if the light is on / off or if the override flag is set or unset.

    Also the override interface through the macro is a toggle function itself. Therefore, I can't set an unclear option. If the override flag is set then addressing override will clear the flag. However, if the override is not set addressing override will now set it.

    I am thinking about using the API interface to script what I am trying to achieve as I can then interroagte the current values and status and apply IF, Then, Else or Select Case logic. Over option is to wait until the end of February ;o)

    Paul

  3. #13
    Automated Home Guru JonS's Avatar
    Join Date
    Dec 2007
    Location
    Suffolk
    Posts
    201

    Default

    I've only glanced across the help for the Logic objects but it may help if you haven't looked there already. It suggests you can read the state of an object but a quick look for a light object isn't terribly clear cf a door object.
    HTH
    Jon

  4. #14
    Moderator Gumby's Avatar
    Join Date
    May 2004
    Location
    Gloucestershire
    Posts
    437

    Default

    I get the feeling that on the way in you are trying to either allow for old habits or beat the presence detection and on the way out you are trying to override the timeouts - I guess I cheated and taught SWMBO that if she presses the light switches and the red light is then on she has to press it again for automation to work :-)

    Thinking laterally - can you shorten the ensuite light timeout to something acceptable ? Does the ensuite have a door and is presence working reliably ?

  5. #15
    Moderator Gumby's Avatar
    Join Date
    May 2004
    Location
    Gloucestershire
    Posts
    437

    Default

    It's tricky and as you have found, you can't interrogate the override state. You can sort of interrogate the light state by starting macros on set-on/set-off, or waiting on the set state output, but I think your problem here is the interaction of toggle with presence.

    For override to come on in a toggle to off, I think presence has to be true at the time of the button press. So this implies that presence doesn't get cleared before the button is pushed - perhaps the door is not closed first, or you don't have a door or door switches ? If this was consistent we could infer that override is set on an exit press and cancel it by toggling the override.

    But if presence is indeterminate on the exit press then we can't infer the override state and know how to cancel it. So this implies to me that the macro would have to instead disable the light, perhaps wait for the timeout period and then re-enable.

    Then you have to solve the problem of returning to the ensuite whilst the light is disabled :-)

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

    Default

    You may have already explained this elsewhere, but why, on entry, do you want to use the swutch to turn on the light? Is the presence detection not working fast enough? And on exit is the reason for the use of the switch to reduce the 'run on' time?

    The new lighting engine allows other objects to change automation modes

    Karam

  7. #17
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    604

    Default

    Karam,

    To some extent I think the issue is unique to the ensuite because the light switch is actually in the bedroom (modern house so no electrics in ensuite or bathroom). Therefore, presence is not detected in the ensuite before the light switch is operated.

    To some extent I guess what I want is manual control and the HA to act as a failsafe and turn the light on if someone forgets. Or more imprtantly turn the light off when the children leave the room but don't turn off the light.

    Paul

  8. #18
    Moderator Gumby's Avatar
    Join Date
    May 2004
    Location
    Gloucestershire
    Posts
    437

    Default

    Every time I think about your problem my mind bends. May be it's because I'm always looking at it late at night.

    I keep thinking I'm there, but then realise something is not quite right.

    I guess I'd like to understand why you find manual control preferable in this specific instance - since it implies that automation is not working correctly for you - perhaps we can fix that instead ?

Posting Permissions

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