have a look at this: Adding a New Device using MQTT follow step 3 and add MQTT credential into the code i gave above.