Here you can see how the will retrive the payload informations and then check the status of the device understanding it by java script function return payload == "off" ? 0 : 1;