The critical requirements for devices connected to the Internet of Things are long battery life, long coverage range, and low deployment cost. The authors developed a machine-learning-based smart controller for a commercial buildings HVAC (heating, ventilation, and air conditioning) system using LoRa (a long-range, low-power wireless platform) and compared it with short-range RF communication in an indoor setting. Results show that LoRas coverage range was 60.4 percent more than short-range communication inside the building. The smart controller was capable of identifying when a room was unoccupied and turning off the HVAC, reducing its energy consumption up to 19.8 percent.