             switch (item) {
             case 'P':
                 // CO2
-                mqtt_send(TOPIC_CO2, value, "PPM");
+                snprintf(valstr, sizeof(valstr), "%d PPM", value);
+                mqtt_send(TOPIC_CO2, valstr);
                 break;
             case 'A':
                 // humidity
-                mqtt_send(TOPIC_HUMIDITY, (value + 50) / 100, "%");
+                snprintf(valstr, sizeof(valstr), "%d.%02d %%", value / 100, value % 100);
+                mqtt_send(TOPIC_HUMIDITY, valstr);
                 break;
             default:
                 // ignore unhandled packet

void loop(void)
{
    static bool prev_clk = false;
    
    bool clk = (digitalRead(PIN_CLOCK) == HIGH);
    if (prev_clk && !clk) {

    wifiManager.autoConnect("ESP-ZG01");
}

static void mqtt_send(const char *topic, const char *value)
{
    if (!mqttClient.connected()) {
        mqttClient.setServer(MQTT_HOST, MQTT_PORT);
        mqttClient.connect(esp_id);
    }
    if (mqttClient.connected()) {
        Serial.print("Publishing ");
        Serial.print(value);
        Serial.print(" to ");
        Serial.print(topic);
        Serial.print("...");
        int result = mqttClient.publish(topic, value, true);
        Serial.println(result ? "OK" : "FAIL");
    }    
}
