There was a discussion on this topic during Month of WTH:
In this thread you can also find a solution with the use of a template sensor to reverse open/close logic.