 ESP8266HTTPUpdateServer httpOTAUpdate;
 WiFiServer telnetServer(23);
 WiFiClient telnetClient;
+MDNSResponder::hMDNSService hMDNSService;
 
 // Additional CSS style to match Hass theme
 const char HASP_STYLE[] = "<style>button{background-color:#03A9F4;}body{width:60%;margin:auto;}input:invalid{border:1px solid red;}input[type=checkbox]{width:20px;}</style>";

  espWifiSetup(); // Start up networking

  if (mdnsEnabled)
  {
    MDNS.begin(haspNode); // Add mDNS hostname
    // MDNS.addService("http", "tcp", 80);
    if (debugTelnetEnabled)
    {
      MDNS.addService("telnet", "tcp", 23);
    }
    MDNS.addServiceTxt("arduino", "tcp", "app_name", "HASwitchPlate");
    MDNS.addServiceTxt("arduino", "tcp", "app_version", String(haspVersion));
    MDNS.addServiceTxt("arduino", "tcp", "mac", WiFi.macAddress());
    MDNS.update();
  }

  if ((configPassword[0] != '\0') && (configUser[0] != '\0'))
  {
    httpOTAUpdate.setup(&webServer, "/update", configUser, configPassword);


  if (debugTelnetEnabled)
  { // Setup telnet server for remote debug output
    telnetServer.setNoDelay(true);
    telnetServer.begin();
    debugPrintln(String(F("TELNET: debug server enabled at telnet:")) + WiFi.localIP().toString());
