Due to global warming and climate changes, buildings including residential and commercial are significant contributors to energy consumption. To this end, net zero energy building (NZEB) has become a progressively popular concept where the annual sum of power generation and consumption is zero. However, occasionally, there exists a mismatching between demand and supply in NZEB due to consumer behaviour and weather conditions disturbing the overall management of the smart grid. To overcome such hurdles, precise prediction of energy usage is a key strategy among others. Therefore, in this study, an efficient hybrid AI-based framework is proposed for accurate forecasting of power consumption and generation that is mainly composed of three steps. Initially, the optimal pre-processing procedure is applied for data refinement. Next, for the spatiotemporal features, a convolutional long short-term memory (ConvLSTM) is used that learns discriminative patterns from the past power knowledge, followed by a bidirectional gated recurrent unit (BDGRU) that extracts on temporal aspects. Eventually, feature descriptors are then passed to multilayer perceptron layers to perform the forecasting. After extensive experiments over the household and photovoltaic energy data, we concluded that our model substantially reduced the errors of 0.012 and 0.045 in terms of mean square error (MSE) on hourly data as compared to the recent state-of-the-art techniques (SOTA).(c) 2022 Elsevier B.V. All rights reserved.