title: Proper syntax of MQTT when retrieving sensor data published in Thingsboard
body: <p>So I have successfully been able to post sensor data to thingsboard and read them in nicely using MQTT ( attached my INO code. )</p>
  
  <p>I have been trying to figure out how properly use the sub/pub syntax to read now data back to a different Arduino board where I would use the CO2 sensor data to controll my AC unit (via TriAC).</p>
  
  <p>I have been trying to decypher the sample here <a href="https://thingsboard.io/docs/samples/esp8266/gpio/" rel="nofollow noreferrer">https://thingsboard.io/docs/samples/esp8266/gpio/</a> (and stripping out the GPIO part) but unfortenatelly without success.</p>
  
  <p>This is how I transfer also the CO2 Data:</p>
  
  <pre><code>Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(", CO2 PPM: ");
  Serial.println(c);
  
  String temperature = String(t);
  String humidity = String(h);
  String carbonmonoxide = String(c);
  
  
  // Just debug messages
  Serial.print( "Sending temperature, humidity and CO2 : [" );
  Serial.print( temperature ); Serial.print( "," );
  Serial.print( humidity ); Serial.print( "," );
  Serial.print( carbonmonoxide );
  Serial.print( "]   -&gt; " );
  
  // Prepare a JSON payload string
  String payload = "{";
  payload += "\"temperature\":"; payload += temperature; payload += ",";
  payload += "\"humidity\":"; payload += humidity; payload += ",";
  payload += "\"CO2\":"; payload += carbonmonoxide;
  payload += "}";
  
  // Send payload
  char attributes[100];
  payload.toCharArray( attributes, 100 );
  client.publish( "v1/devices/me/telemetry", attributes );
  Serial.println( attributes );
  delay(5000);
  </code></pre>