Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Using Scheduler with General Logic

  1. #11
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Well it looks no different to what I tried which worked.

    So if you can send a copy of your database to Idratek we will find the cause.

    Viv.

  2. #12
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Martin has supplied his database and from this was able to discover the problem.
    It was caused by connecting the logic gate output to the LED of the button.
    This is quite legitimate and should not have caused a problem. The result was that the gate got clocked twice because the gate got re-evaluated twice. This is the only gate which would have suffered from being re-evaluated twice.

    Cortex update 25.2.11 should resolve the problem.

    Viv

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

    Default

    Indeed it has, many thanks Viv - excellent support as ever.

    Regards,
    Martin

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

    Default

    With the onset of darker mornings and evenings I am revisiting the logic that I am using to control the outside lighting and would appreciate clarification on a couple of things:

    1) The logic that I have implemented provides an on/off state for the outside lighting.
    I haven't found a way to use this to directly control the lighting; instead I am using 1 second monostables to trigger the On and Off inputs
    when the state changes. Is this the best way to do this?

    2) As previously, I am using a T-type to store the toggle on/off of an override status derived from a QBI button.
    I am also directly controlling the associated LED on the QBI to reflect the status.
    Is this the best way to do this? If I edit the logic gate to review the current status it is reevaluated and resets.
    Is there any way to implement the latching and LED follow state in the QBI itself? - this would be more reliable.

    3) I am using Time Windows to set the operating windows (morning and evening) for the outside lights.
    However, I am having to use Events to trigger a 'Weekday' status latch (an SR-type) - I am using single events at present.
    Is there a better way of doing this?

    4) As I require a default High (1) input for the T-type and Time Windows I have used a NOT gate with a disconnected input to generate a permanent 1.
    It might be useful to define a World/Global 'True' output for this purpose.


    I would appreciate any comments on the above.

    Martin

  5. #15
    Automated Home Legend Karam's Avatar
    Join Date
    Mar 2005
    Posts
    817

    Default

    I just wonder if there is another way to achieve what you want. Is it that you don't have light level sensors and are using scheduling as a way around this, or is it that you are trying to achieve some specific behaviours not covered by existing logic notwithstanding light level sensing?

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

    Default

    Hi Karam,

    Here's what I am trying to achieve:

    1) Outside lights to come on each evening as it gets dark and go off at a set time - currently this is handled via on/off times and an external light level sensor.
    2) Outside lights to stay on past the set time if we are 'out late' - we live on an unlit lane so it is useful to be able drive in and unlock the door safely.
    I am using one of the QRI buttons to toggle the 'out late' status - when we come home pressing the button toggles the status and kills the outside lights.
    3) Outside lights to come on each weekday morning at a set time and go off as it gets light - we often leave before it is light and I want the lights on as we drive off.

    I have considered using the PIR in the hall to automate this a bit more, perhaps detecting when someone has come home, but I can think of scenarios where this wouldn't work (for instance, when I am coming home late but everyone else is already in) and also the dog sets the hall PIR off fairly regularly.

    Very happy to consider alternative ideas.

    Martin

  7. #17
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Quote Originally Posted by m****erell View Post
    Hi Karam,

    Here's what I am trying to achieve:

    1) Outside lights to come on each evening as it gets dark and go off at a set time - currently this is handled via on/off times and an external light level sensor.
    2) Outside lights to stay on past the set time if we are 'out late' - we live on an unlit lane so it is useful to be able drive in and unlock the door safely.
    I am using one of the QRI buttons to toggle the 'out late' status - when we come home pressing the button toggles the status and kills the outside lights.
    3) Outside lights to come on each weekday morning at a set time and go off as it gets light - we often leave before it is light and I want the lights on as we drive off.

    I have considered using the PIR in the hall to automate this a bit more, perhaps detecting when someone has come home, but I can think of scenarios where this wouldn't work (for instance, when I am coming home late but everyone else is already in) and also the dog sets the hall PIR off fairly regularly.

    Very happy to consider alternative ideas.

    Martin
    Hi Martin,

    I must confess to having spent quite a bit of time on this trying to find a complete solution and in doing so abandoned many ideas. However I believe I have a solution that can be broken down to the 3 logic requirements your have outlined.

    So each logic requirement is addressed seperately...

    1/ This logic is achieved by the lights normal operating methods. The outside light is configured to
    Operating Mode = At Lighting up time and dark to turn on , lighting off time to turn off.

    The turn off time will be the normal evening off time. Ensure the ‘Auto set override to default…’ is checked and that the default is ‘None’.


    2/ This logic is achieved by switching the lights operating mode between

    ‘At lighting up time and dark to turn on, lighting off time to turn off’
    And
    ‘Use Light level dark to turn on, bright to turn off’.

    Using a General Logic object a T-Type flip-flop is configured to create the ‘Out Late’ mode. Its output trigger behavior is ‘On Change’. Its output is connected to Two NOT gates inputs. The T-Type flip-flop has its clock input triggered by a suitable button. The LED of the button can be connected to the output of the T-type flip-flop to indicate you are in ‘out late’ mode.

    The first NOT gate is configured to have an ‘Output trigger behavior’ of ‘To False’. This is used for the light to operate in normal mode (e.g as in logic requirement 1 above). The output of the gate is set to send a ‘Value’ of 6 to the outside lights operating mode.

    The second NOT gate is configured to have an Output trigger behavior’ of ‘To True’. That is ‘Out Late’ mode. The output of the gate is set to send a ‘Value’ of 8 to the outside lights operating mode. That is to not be time dependant but only dark.

    Pressing the button will cause the ‘Out Late’ mode to turn on (press again to turn off). The light will not come on in either mode unless its dark. The light will stay on if it is in ‘Out late’ mode – that is it will not turn off in late evening as in normal mode.

    3/ This is achieved by using a second light object. You can use a legacy relay object to create a virtual light (one that is not network enabled). This light is configured to use the outside light level as normal. Configure this light to operate as you want in the morning. Turning on and off at suitable times and using the dark state.

    This lights ‘Set State (Output)’ is connected to the Outside lights ‘Follow state (input)’. What this is doing is creating a whole new light behavior at another time. As this virtual light turns on in early morning it sends a message to the real outside light and causes it to turn on. When this virtual light turns off it will also turn the real outside light off.

    Viv.

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

    Default

    Hi Viv,

    Many thanks for the very detailed response - it's certainly better than the complex General Logic that I was trying to use.

    Part 1 is the base case that I had originally implemented, and works perfectly.

    Part 2 is a good way of implementing the required override capability and works well - I did have to swap the mode values on the NOT gates so that a '1' from the T-Type sets the override (operating mode 8) and lights the LED on the QBI.

    Part 3 is a neat way to provide a second operating period for lighting (which I was unaware of). The only thing I need to add to this is some 'weekday only' logic. I was using two weekday event triggers to turn an SR Type on and off outside the required operating period; I seem to be able to connect the SR output to a light level input on the second light object - would this achieve the desired gating effect?

    Many thanks,
    Martin

  9. #19
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Quote Originally Posted by m****erell View Post
    Hi Viv,

    The only thing I need to add to this is some 'weekday only' logic.
    Hi Martin,

    I also had much more complicated methods initially!!!.

    For weekday only logic I would create two Event Scheduler events.

    1. On a 'Week Day' I would trigger the Virtual Light to 'Enable' at some suitable time in the morning which is before its Lighting up Time.
    2. On the 'Week End' I would trigger the Virtual Light to 'Disable at time as above.

    This is the lights 'Overall Master Control' state as seen in the Lights behaviour menu top left.

    So in 1 it will trigger the light Monday through Friday to ensure its Enabled and similarly on Saturday and Sunday to ensure its disabled.


    Viv.
    Last edited by Viv; 21st October 2012 at 06:17 PM.

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

    Default

    OK, during experimentation I found a couple of issues with the method that I was using for the virtual light:

    1) The virtual light wasn't turning off when the light level went above the dark threshold if using operating mode 6.
    2) Disabling the virtual light doesn't turn the light off if it is already on.

    So I've adopted a simpler approach:

    The first Event Scheduler event sets the operation mode to '8' on a weekday - this turns the the light on at the event time if it is dark and turns it off under light sensor control.

    The second Event Scheduler event sets the operation mode to '7' every day of the week at a later time in the morning - this effectively prevents the light coming on at weekends.

    It took me a while to find out that 'Manual Control' is operation mode '7' - although this is displayed when the cursor hovers over the option, the same value is displayed for a couple of other modes as well. I eventually found it in the help for 'Light Connections' - but not all the modes are listed there.

    Anyway, hopefully I now have what I want - many thanks for your earlier help, it was the trigger for these latest ideas.

    Martin

Posting Permissions

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