PDA

View Full Version : Sequence of sensors in logic


Damaxx
14 May 10, 08:43 PM
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.

Darren
15 May 10, 05:42 PM
You could do something like:

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;

Damaxx
15 May 10, 10:04 PM
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.

Darren
17 May 10, 03:07 PM
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.
No problems.