 // Macros for debugging
 #ifdef DEBUG_TELNET
   #define     DEBUG_PRINT(x)    telnetClient.print(x)
+  #define     DEBUG_PRINT_WITH_FMT(x, fmt)    telnetClient.print(x, fmt)
   #define     DEBUG_PRINTLN(x)  telnetClient.println(x)
+  #define     DEBUG_PRINTLN_WITH_FMT(x, fmt)  telnetClient.println(x, fmt)
 #else
   #define     DEBUG_PRINT(x)    Serial.print(x)
+  #define     DEBUG_PRINT_WITH_FMT(x, fmt)    Serial.print(x, fmt)
   #define     DEBUG_PRINTLN(x)  Serial.println(x)
-#endif
-
-// Wi-Fi
-const char*   WIFI_SSID     = "Netgear";
-const char*   WIFI_PASSWORD = "0stem4dder";
+  #define     DEBUG_PRINTLN_WITH_FMT(x, fmt)  Serial.println(x, fmt)
+#endif
+
 #define HOST "ARILUX%s"
 char chipid[12];
+
+char          MQTT_CLIENT_ID[32];
 
 // MQTT topics
 char   ARILUX_MQTT_STATE_STATE_TOPIC[44];

  https://github.com/mertenats/Arilux_AL-LC03
*/


//#define IR_REMOTE
// TLS support, make sure to edit the fingerprint and the MQTT broker IP address if
// you are not using CloudMQTT
//#define TLS
//#define DEBUG_TELNET

#include <ESP8266WiFi.h>        // https://github.com/esp8266/Arduino
#include <PubSubClient.h>       // https://github.com/knolleary/pubsubclient/releases/tag/v2.6
#ifdef IR_REMOTE

#ifdef TLS
void verifyFingerprint() {
  DEBUG_PRINT(F("INFO: Connecting to "));
  DEBUG_PRINTLN(MQTT_SERVER);

  if (!wifiClient.connect(MQTT_SERVER, MQTT_PORT)) {
    DEBUG_PRINTLN(F("ERROR: Connection failed. Halting execution"));
    delay(1000);
    ESP.reset();
  }

  if (wifiClient.verify(fingerprint, MQTT_SERVER)) {
    DEBUG_PRINTLN(F("INFO: Connection secure"));
  } else {
    DEBUG_PRINTLN(F("ERROR: Connection insecure! Halting execution"));
