With the rapid development of wireless communication technology, the Internet of Things (IoT) and Machine-to-Machine (M2M) are becoming essential for many applications. One of the most emblematic IoT/M2M applications is smart buildings. The current Building Automation Systems (BAS) are limited by many factors, including the lack of integration of IoT and M2M technologies, unfriendly user interfacing, high costs, using no more than one or two wireless communication networks, limited wireless transmission range, and the lack of a convergent solution. Therefore, this paper proposes a better approach of using heterogeneous wireless networks consisting of Wireless Sensor Networks (WSNs) and Mobile Cellular Networks (MCNs) for IoT/M2M smart building systems. The proposed system is an inexpensive embedded system that comprises Arduino and NodeMCU boards with several compatible sensors, actuators, and modules for controlling and collecting data over heterogeneous communication technologies (RFID, Bluetooth, Wi-Fi, GSM, LTE). All collected data is uploaded to the ThingSpeak platform, allowing the building system to be monitored via the ThingSpeak webpage or the Raniso app. One of the most significant outcomes of this research is to provide accurate readings to the server, and very low latency, through which users can easily control and monitor remotely the proposed system that consists of several innovative services, namely smart parking, garden irrigation automation, intrusion alarm, smart door, fire and gas detection, smart lighting, smart medication reminder, and indoor air quality monitoring. All these services are designed and implemented to control and monitor from afar the building via our free mobile application named "Raniso" which is a local server that allows remote control of the building via RFID/Bluetooth/Wi-Fi connectivity and cellular networks. This IoT/M2M smart building system is customizable to meet the needs of users, improving safety and quality of life while reducing energy consumption. Additionally, it helps prevent the loss of resources and human lives by detecting and managing risks.