Using a Contact sensor as a light switch?

Pressure mat thread: