How to compare payload value?
You receive the character 0 or 1 but compare it to the value 0 or 1. The two things are very different.

You are sending ASCII but comparing it to decimal. 

Instead you need to compare like for like.  Either:

if (payload[0] == '0') {


Or:

if (payload[0] == 48) {


You can find an easy reference for the full ASCII table here.