 
     Serial.printf("Next loop in %d msec", LOOP_INTERVAL_MSEC);
 
-    // Blink success led
-    digitalWrite(LED_STATUS_PIN, HIGH);
+    // Blink led
+    digitalWrite(statusLed, HIGH);
     delay(500);
-    digitalWrite(LED_STATUS_PIN, LOW);
+    digitalWrite(statusLed, LOW);
 
     delay(LOOP_INTERVAL_MSEC);
 

        if(httpCode == HTTP_CODE_OK) {
            String payload = http.getString();
            Serial.println(payload);
        }
    } else {
        Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());

    const int deskheight = ultrasonic.distanceRead();
    Serial.printf("Desk height: %d CM\n", deskheight);

    Serial.printf("Sending desk height of '%d' to %s:%i%s\n", deskheight, HTTP_HOST.c_str(), HTTP_PORT, HTTP_URI.c_str());

    // Create http client
    // https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266HTTPClient/
    HTTPClient http;
    http.begin(HTTP_HOST, HTTP_PORT, HTTP_URI);
    http.setAuthorization(HTTP_USER, HTTP_PASSWORD);
    
    http.setUserAgent("Deskheight sensor - Wemos D1");
    http.addHeader("content-type", "application/json");

    // '{"value": "<deskheight>", "homeassistant_sensor": { "name": "deskheight", "state": "<deskheight>", "attributes": { "friendly_name": "Desk Height", "unit_of_measurement": "cm" }}}'
    String payload = String("{ \"value\": \"") + deskheight + String("\", \"homeassistant_sensor\": { \"name\": \"deskheight\",\"state\": \"") + deskheight + String("\", \"attributes\": { \"friendly_name\": \"Desk Height\", \"unit_of_measurement\": \"cm\" }}}");

    int httpCode = http.POST(payload);
    int statusLed = HTTP_LED_ERROR_PIN;

    // httpCode will be negative on error
    if(httpCode > 0) {
