When you switch the switch from one side to another.what’s the value of GPIO5?
The attach pic is a switch i found,please check with yours.
Regards