Motion lighting with contact sensor

I ended up using this

Thanks @bravenel !