Sequence of sensors in logic

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Damaxx, May 14, 2010.

  1. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    I have an idea that i would like to code into logic and would appreciate some help in to what functions to use.

    I have a cbus motion sensor pointed across the driveway and another in the carport.
    The driveway sensor is assigned to the front wall lights and the carport sensor, you guessed it, the carport lights.

    What would be the correct functions to use to code the following -

    1. If the driveway sensor is activated, cbus assumes its a guest and only turns on the front wall lights for 2 min.

    2. If the driveway sensor is activated and then the carport sensor, cbus assumes that we have come home so turns on the carport lights for 2 min, back door lights, and family room.

    3. If the carport sensor is activated, then the driveway sensor, cbus assumes that we are leaving so turns on carport lights, and front wall lights both for 2 min.

    4. If the carport sensor is only activated then cbus, and basically anyone who knows me, assumes that I am getting another slab of ales out of the car and only turns on the carport lights for 2 min. (Later I will program cbus to detect level of my intoxication by measuring wobble and leave lights on for longer, even if I have stopped moving.:rolleyes:)

    Logically, 1,3 and 4 work at the moment using the existing grouping but having the added touch of case 2 would be a great little function to be able to have. Cbus would actually know if we are coming or going.

    Thanks in advance gents.
     
    Damaxx, May 14, 2010
    #1
  2. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You could do something like:

    Code:
    once GetLightingState("Carport") = On then
    begin
      if GetLightingState("Driveway") = On then
      begin
        { Driveway lights were already on when carport came on, so someone is coming home }
        ...
      end;
    end;
    
    once GetLightingState("Driveway") = On then
    begin
      if GetLightingState("Carport") = On then
      begin
        { Carport lights were already on when driveway came on, so someone is leaving home }
        ...
      end;
    end;
    
     
    Darren, May 15, 2010
    #2
  3. Damaxx

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    229
    Likes Received:
    47
    Darren, if your ever in the Latrobe valley area, I think I owe you one or more of those ales that I was refering to in my earlier post. Thanks for helping me out yet again. That will be perfect with a bit of fine tuning. I could not work out the boolean logic on it but makes sense using the lights as the first variable rather than the sensor itself.

    Cheers again.
     
    Damaxx, May 15, 2010
    #3
  4. Damaxx

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    No problems.
     
    Darren, May 17, 2010
    #4
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.