Smart cities are one of the most active research fields in the world, due to the various benefits and challenges associated with their implementation. A major challenge for smart cities is processing and transporting the huge volumes of data generated by the sensor network layer, which builds the fundamental physical layer. Ongoing research is needed to address the computational challenges arising in smart city environments, particularly to help ensure efficient operations around the sensor layer. To address this challenge, a novel physical layer frame- work is proposed that intelligently learns the behavior of the physical system to enable the agents to control the sensors effectively and achieve the predefined sensor(s) and environment objectives. In addition, a novel machine learning semi-supervised Bayesian learning algorithmis proposed to learn and predict the sensors' behaviors to efficiently manage the energy consumption in houses. The novel model and algorithm were used in various diverse simulations, where results demonstrated their effectiveness in managing the energy consumption in different house settings and smart city environments.