How to convert an ON/OFF switch to a dumb switch?

I prefer all my washroom doors to be always closed and not open when not in use, hence i was thinking to add a door sensor to turn on and off the lights in the bathroom. I have installed a Zooz zwave on/off switch in the washroom. So opening the door turns on the light and closing the door turns off the light, but with the switch, even if manually pressed off the lights do not turn off. The lights should turn off only when the door is closed.
So how can i achieve this?