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

Thread: Help; macro to control manual light switch

  1. #1
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    608

    Default Help; macro to control manual light switch

    I am after some help with creating a macro or other solution to control a light from a light switch as well as automatically from sensors. Sounds more simple than it is as I'll try to explain.

    Automatic light control defined by light level sensor, time of day, presence and timer.

    Manual input from digital switch.

    The automatic side works fine, someone enters, its dark, the right time of day the light turns on. They leave and presence removed, light goes off.

    Now to explain what I am trying to do with the manual input from the switch. Basically it should be able to override the current light state regardless of other conditions. So if the light is off and the switch operated the light should come on (regardless of time of day or light level). If the light is on then it can be turned off immediately by pressing the button. However, if the light is left on then the automated presence removal should turn it off after the timer period.

    Now the main problem I have is the macro functionality doesn't allow for state interrogation or extended logic. So I can't do something like.... if light is off then turn on...

    I have made some progress by using two macros; one to switch light on, one to turn light off, both macros are always running and registered against the light condition change. The continuing problem is that when the light conditions would normally have the light off and it is manually turned on the override flag is set and doesn't get reset. Therefore, automatic control no longer works (lights will turn on even when they should be off due to time of day or light level when presence is detected)

    Paul
    Last edited by Paul_B; 9th January 2008 at 12:05 AM.

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

    Default

    So if I understand correctly, when you first press the button it enters an override state, on or off depending on prior state, a subsequent button press clears the override, but there is also an timeout that cancels the override period.

    Or did you mean the second press retains the manual override, but toggles the overridden state ?

    I think we are about to explore the detailed logic of the override vs toggle actions ... I note that the latest help has some additional notes covering these.

    I have a suspicion that you may want to just apply a toggle on the light from the button, and may be enable auto clear override on period change.

    But I'm not sure I've entirely understood your desired scheme.

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

    Default

    So I've just done a quick experiment and I think you just want to set the button to toggle the light. Toggle is sort of intelligent, in that it is exactly a toggle when the light is set to manual, but "does the right thing" when the light is automated in some way.

    Using override actions can confound the logic since the response depends on presence and the button press can create presence depending where it is.

    Have a play with behaviour panels for the room, the light and the button all open at the same time so you can see the status and simulate presence/no presence. I seem to have noticed some changes to the light behaviour panel in particular to help clear up confusions round this topic.

    Or I've misunderstood the requirement :-)

  4. #4
    Automated Home Guru JonS's Avatar
    Join Date
    Dec 2007
    Location
    Suffolk
    Posts
    202

    Default

    I am with David here. I think if you just use Toggle it should work. That is how my lights are set-up and if the light is forced on then presence is still required to keep the light lit.

    My expierence in this area is using macros to create scenes. forcing state to "on" or "off" kinda works but if someone walks past a light sensor then other lights in the room can automatically switch on. I think the way around this is to set the scene wih lights "enabled" / "disabled" but I think I'd also need a macro to run at end of day to sent everything back to normal. I also need to experiment with having fewer of the light channels set to automatic and use manual control instead as this may help. There is also Toggle and Synchronise which I came across recently. Lots of options, not so much time!

    ATM I am reflex programming default light settings as SWMBO doesn't like it if Cortex PC doesn't work and she cannot change the lights

  5. #5
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    608

    Default

    Thanks for the advice guys. I am sure I tried the toggle function initially but it didn't quite do what I wanted. However, I didn't make notes at the time and now can't remember what was wrong.

    I'll re-try this again tonight and this time make some notes!

    The one thing that maybe strange with this particuliar light is it is in an ensuite location. The actual switch is in the next room.

    I'll describe some specifics tonight when I get home.

    Paul

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

    Default

    The automated lighting logic is a good example of how something that might be perceived to be 'easy' is actually quite complex because when you sit down and analyse different peoples' requirements you sometimes find that you need some sort of mind reading facility. Take a simpler example of heating adjustments: Someone is perhaps feeling a bit cold and requests a set point increase from the system, sounds simple enough, but then how long should that set point increase persist? Remember we are talking about automation here so its a bit of a failing if the user has to remember to go and reduce the setting at some later time and this is further complicated by the fact that the system will likely be following a profiled set point curve so it may not be so obvious later on that the setting has been increased. Its the same with lighting - you get some situations where the user is effectively saying they want the automation turned off or mode changed - but how long for? Should they have to remember to then turn it back on? Worse still - someone else later walks into room and automation does not respond as expected. When you get used to automation even occasional incidents of it not working as expected feel worse than not having automation in the first place.

    Cortex uses heuristics to try and second guess peoples intentions, but even so I can tell you that in the new release of Cortex you will likely see a revised lighting engine which is perhaps more complicated to 'play with' but provides better user access to the automation parameters and some new heuristics.

    Karam
    IDRATEK LTD

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

    Default Help; macro to control manual light switch

    sorry, slight aside :

    magic ... Kevin asked a while back why I went with Idratek, and I found it difficult to give a short reply ... but this is exactly it ... ie: Karam & his colleagues do actually understand the problem, do understand what automation needs to be, and are making it happen !

  8. #8
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    608

    Default

    Heuristics is a word I have come across a number of times, but I am not sure I really understand it. Can anyone give a simply explanation as to what heuristics is?

    Paul

  9. #9
    Automated Home Guru JonS's Avatar
    Join Date
    Dec 2007
    Location
    Suffolk
    Posts
    202

  10. #10
    Automated Home Legend Paul_B's Avatar
    Join Date
    Jul 2006
    Location
    Eastbourne, UK
    Posts
    608

    Default

    Back to the original topic of the thread. I have tested disabling the macros I am using and setting the light input to toggle.

    Situation:
    Operating period = valid
    Light level = dark (therefore, light should come on)
    Light switch pressed
    Light comes on
    Add presence, light stays on
    Remove presence, light goes off after timer countdown

    The above situation works as I want.

    Now to describe what doesn't work how I want.

    Situation:
    Operating period = valid
    Light level = dark (therefore, light should come on)
    Light switch pressed
    Light comes on
    Add presence, light stays on
    Remove presence and immediately press light switch
    Light goes off immediately (as I want)

    However, the override flag gets set on the light object. The override then doesn't clear so if I walk back into the room presence detection doesn't turn the light on because of the override flag still being set.

    Paul

Posting Permissions

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