Trigger Switch based on garage door state

I have a multipurpose sensor detecting garage door state(open or closed). I want to turn a switch on if the door is closed and off if the door is open. Is there an app that can do this? Thanks.

Great, thanks!