Polyelectrolyte microcapsules loaded with fluorescent dyes have been proposed as biosensors to monitor local pH and ionic strength for diagnostic purposes. In the case of charged microcapsules, however, the local electric field can cause deviations of ion densities inside the cavities, potentially resulting in misdiagnosis of some diseases. Using nonlinear Poisson-Boltzmann theory, we systematically investigate these deviations induced by charged microcapsules. Our results show that the microcapsule charge density, as well as the capsule and salt concentrations, contribute to deviations of local ion concentrations and pH. Our findings are relevant for applications of polyelectrolyte microcapsules with encapsulated ion-sensitive dyes as biosensors.