It's pretty easy, actually.
Create a group called Mapping, (or whatever you want to call it; I call it mapping because I'm basically mapping events)
In that group, create a scripting action for each event of the door sensor: one for the event that occurs on open, and one on close. Attach the correct events to each of the scripting actions. Here is the script for an OPEN event, in this case my front bottom door:
FrontBottomDoor = FrontBottomDoor or 0
if FrontBottomDoor == 0 then FrontBottomDoor = "closed"
end
if FrontBottomDoor == "open" then gir.TriggerEvent ('FrontBottomDoorOpenConfirm',18)
elseif FrontBottomDoor == "closed" then FrontBottomDoor = "open"
gir.TriggerEvent ('FrontBottomDoorOpen',18)
end
and here is the CLOSE script:
FrontBottomDoor = FrontBottomDoor or 0
if FrontBottomDoor == 0 then FrontBottomDoor = "closed"
end
if FrontBottomDoor == "closed" then gir.TriggerEvent ('FrontBottomDoorClosedConfirm',18)
elseif FrontBottomDoor == "open" then FrontBottomDoor = "closed"
gir.TriggerEvent ('FrontBottomDoorClosed',18)
end
Next, you create the events that you wish to happen when the events happen. In this example, you'll need girder events called "FrontBottomDoorOpenConfirm", "FrontBottomDoorOpen'", "FrontBottomDoorClosedConfirm", and "FrontBottomDoorClosed" (all without the quotes, of course).
What you do with those events are up to you, but my confirm scripts currently only give me an OSD message. For the open confirm event, you can use speech to tell you that you left the door ajar.
What do you think? I strongly suggest you check out Girder v4. It's much more powerful than the previous version and totally worth the bit of cash you'll have to spend to get it. By far, the best investment I've made in my home automation system. Talk to you later!
PS, do you do any graphics? Just curious.