Accurate and robust forecasting is a critical challenge for the reliable operation and optimization of smart microgrids, especially as they increasingly integrate renewable energy sources and rely on edge computing infrastructure. Uncertainty from weather, rapidly changing consumption patterns, and the resource limitations of edge devices hinder the deployment of conventional forecasting models, which typically assume stationary data and require large, clean datasets. This licentiate thesis addresses these gaps by developing a comprehensive and adaptive pipeline for time-series forecasting in microgrids, with a focus on resilience to uncertainty, concept drift, data scarcity, and resource constraints. The research presents a suite of novel and scalable approaches, including clustering-based pre-processing, adaptive deep learning models, probabilistic and uncertainty-quantifying forecasting methods, federated learning, and instance-based transfer learning. These techniques are designed to deliver high predictive accuracy and adaptability under non-stationary conditions, while remaining lightweight enough for deployment on constrained edge devices. Privacy-preserving and collaborative mechanisms, such as federated and transfer learning, enable model generalization and robustness across heterogeneous, distributed microgrid environments. Building on seven peer-reviewed publications, this work establishes a unified pipeline for intelligent forecasting at the grid edge. Key contributions include: (1) dynamic drift-adaptive learning frameworks for real-time adaptation, (2) probabilistic and uncertainty-quantifying forecasting for risk-aware energy management, (3) multi-step prediction strategies for short- and medium-term forecasting, and (4) clustering-guided transfer learning to enhance prediction in data-scarce scenarios. Validation on both real-world and simulated microgrid datasets demonstrates substantial gains: for example, the proposed transfer learning approach improves short-term forecasting accuracy in data-limited buildings by up to 40%, while adaptive and federated models achieve robust performance with reduced computational and communication overhead compared to centralized baselines. Overall, this thesis advances the state-of-the-art in interpretable, scalable, and resilient forecasting for smart microgrids, supporting the transition to adaptive, decentralized, and privacy-aware energy systems capable of thriving in dynamic and uncertain environments.