Although it's an odd situation you want to accomplish... You'll have to add a state for every device, so you'll get something like:
Code: Select all
If [Security sensor = On] and [ceiling = Off]
Do [Set ceiling = On]
Else if [Security sensor = On] and [ceiling = On]
Do [Set ceiling = Off]
Only I think this won't work as you planned because when the first condition is met (and a sensor usually stays on for a certain amount of time after detecting motion) the second condition is true which will turn the ceiling off again. This means the first condition is met again so it'll turn the ceiling back on again etc....
You 'll have to add a variable for instance for this to work properly so you'll get something like this:
Code: Select all
If [Security sensor = On] and [ceiling = Off] and [var ceiling = 0]
Do [Set ceiling = On]
Do [Set var ceiling = 1]
Do [Set var ceiling = 2 after 10* seconds]
Else if [Security sensor = On] and [ceiling = On] and [var ceiling = 2]
Do [Set ceiling = Off]
Do [Set var ceiling = 3]
Do [Set var ceiling = 0 after 10* seconds]
* set this time a bit longer than the sensor stays on after detecting motion
quick'ndirty
You could also use a dummy switch with an off delay set to a bit longer than the sensor stays on