Gateway device works as the core part of the home automation system, installed web front ends designed by Python, Mosquitto MQTT server and so on. Each peripheral devices in this home automation network are controlled via this core device.
Gateway and peripheral devices in home automation network
Setting the rules of how and when devices works, it enables to extend the functions on each device. For instance, to detect the motion or tilt sensor values changed, following to notice these incidents by calling or sending the e-mail to your mobile in real time.