Grid-interactive communities are an emerging solution for optimal energy dispatching, improving grid stability, and enhancing the usage of on-site renewable energy by leveraging community flexibilities. This work introduces a novel Physically Consistent Deep Learning (PCDL)-based optimization framework for day-ahead energy dispatching and thermal comfort control within grid-interactive communities. Specifically, the PCDL model is developed to capture the thermal dynamics within the community while ensuring strict adherence to physics consistency. This consistency is defined with the aim of generating physically viable solutions in response to modified system inputs. Subsequently, the PCDL model is utilized for load estimation and indoor climate prediction within a proposed scheduling and control strategy: (1) an optimal energy dispatching plan is calculated based on the day-ahead grid market; (2) a real-time model predictive control (MPC) method is applied to minimize the utilization error and indoor comfort constraint violations caused by following the scheduled energy dispatching plan. A simulation case of a residential hall community at Cornell University with on-site renewable energy resources is implemented to demonstrate the effectiveness of the proposed approach. Comparative simulations, which include the Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Gaussian Process (GP) regression models, confirm the performance advantage of capturing community thermal dynamic and control-oriented generalization ability when using the PCDL model. These results leads to notable improvements in indoor thermal comfort control, ranging between 65.4 and 68.7%, 63.6–79.3%, and 60.4–62.2% for each comparative model, respectively. Moreover, by harnessing community demand flexibility, we achieve energy cost savings between 29.5 and 39.7% compared to the baseline controller.