Builded my own home automation including energy management system, with Home Assistant, Home Logic, and MQTT.
For many years, I wanted to design and build a low-energy, self-sufficient house with integrated home automation. Rather than relying on complex off-the-shelf smart home systems, the goal was to build a system focused on reliability, simplicity, and practical day-to-day use, without any dependency on cloud services.
From the architectural design phase onward, the automation system was developed alongside the house itself. Most sensors and devices are hard-wired to improve reliability, to reduce wireless dependencies, and to keep all cabling hidden within the building structure.
Key design principles:
My home automation system is built around two core components: Home Assistant for the user interface and HomeLogic as the central automation engine. HomeLogic is an event-driven logic system that contains and executes all home automation logic.
Communication between Home Assistant and HomeLogic is handled through MQTT, which acts as the primary messaging layer.
Integration with external devices is provided by protocol- and device-specific gateway services. Multiple instances of certain services are deployed at different physical locations to improve radio coverage and system reliability.
The system runs across multiple Linux servers:
On these servers are runningHome Assistant and HomeLogic, including services that provide integration with external devices for the following technologies:
This modular design isolates failures, simplifies debugging, and makes it easy to add new functionality without touching the core system.

All windows, doors, and rooms — including the outbuilding — are equipped with sensors. The alarm supports several modes:
Modes are activated automatically using an algorithm based on presence, motion, and location of the mobile phones. But can also be manually activated. Smoke detectors integrate into the system and trigger a centralized alarm.
Additional context-aware logic improves usability:

Floor and boiler heating is controlled by the Home Energy Management System (Home EMS):
Separate from the EMS, HomeLogic also ensures frost protection in:
The cellar has its own system that maintains optimal temperature and humidity for winter fruit storage.

A local weather station continuously measures:
A forecasting algorithm analyzes trends and triggers early warnings for extreme conditions. All weather data is published to MQTT for use by other automations.
The system monitors temperature, filtration, and operating conditions. Automation includes:

Automation also manages the household water supply:
This protects both the pump and the water system as a whole.

HomeLogic includes the Home EMS, a specialized subsystem focused on intelligent energy management.
The EMS’s core objectives are to maximize self-consumption of solar energy and minimize grid usage.
In short, the EMS performs:
More details about the EMS can be found in Home EMS
High uptime is ensured through several watchdog mechanisms:
This greatly reduces manual maintenance and helps the system recover autonomously from failures.
All alerts and status updates are sent via Telegram.
If Home Assistant becomes unreachable, Telegram also acts as a fallback command interface, ensuring continuous control over critical systems.
The system includes custom hardware components to meet the specific needs of the project:
I developed a universal low-power LoRa sensor board featuring:
With a power consumption of only 5.3µA, the board can operate for up to three years on a single battery charge under typical conditions.
These sensors provide remote monitoring and control in locations where wiring is impractical.
Detailed information can be found in Universal Low-Power LoRa Sensor.

All components — from climate control and security to pool filtration, water pressure, energy management, and local weather monitoring — operate as a cohesive whole. By custom-built hardware and software, low-power sensors, watchdog mechanisms, and a robust MQTT infrastructure, the house functions as an integrated and reliable system.
Even in the event of a major failure, each subsystem can continue operating independently of the central automation system, ensuring that essential functions remain safe and reliable.