Inside MajorDom v1.0: Exploring the Architecture of a New Smart Home System
In the previous article, I talked about the origin of the idea to create a new smart home. Now, I want to take a closer look at the architecture of the system.
MajorDom consists of several key components: devices, hub, cloud, bridge, mobile application, and voice assistant.
Devices play a crucial role in the system as they enable control over physical parts of the home. They communicate using radio modules and the “Merlin” protocol that receive commands from the hub, and transmit events back to it.
The hub is the central element of the system. It manages the devices and coordinates their operations. The hub holds the main database with information about users, home, rooms, and devices. Through a local HTTP server and WS server, the hub provides an API for interacting with the database and high-level controlling the devices.
The cloud is the server-side component and plays a vital role in user authentication. It stores the database of users, homes, hubs, and their access rights. Device models with a list of parameters and a firmware update system are also stored in the cloud.
The bridge is a WS server that provides communication between the hub and remote user over the internet. It enables sending commands and receiving information from the hub without being within the home's local network.
The system can have multiple bridges located in different places. Clients select the nearest or least loaded bridge to minimize communication delays.
One of the main features of the MajorDom is its fault tolerance. Despite the collapse of one or multiple bridges, the system perseveres and maintains its functionality. The remaining available bridges take on the tasks of the inactive bridges, ensuring uninterrupted data exchange between the hub and clients.
Even a complete loss of internet connection on the hub is not a problem. All the logic and command processing occur locally, ensuring independence from the internet connection and maintaining the ability to control devices within the local network. However, such scenarios are rare since the hub can be simultaneously connected via Wi-Fi and an Ethernet cable, and future support for cellular network will be added.
Smart home control is achieved through a mobile application that provides a user-friendly interface. However, in practice, the role of the mobile application often reduces to system configuration, while day-to-day device management is carried out using automatic scenarios and the voice assistant.
Like the hub, the voice assistant can work completely offline, ensuring security, privacy, and reliability of use.
Most importantly, now anyone, even those without programming experience, can install the MajorDom system. In the next article, I will share a detailed guide on how to do it.
- S.T.A.R.K - The First Voice Assistant's Framework— September 20th, 2023 · 2 min readI published a framework that allows you to build your own amazing voice assistant.
- Building a Smart Home - from Voice Assistant to MajorDom v1.0— May 26th, 2023 · 5 min readThe story of the origin of MajorDom: how I started creating my voice assistant and how it grew into a smart home system.
- How to Localize All Your iOS Apps into 20 Languages in 5 Minutes— March 1st, 2023 · 3 min readI created a console tool that automatically finds all .strings files in an xcode project and translates them into all languages.