Hi, I just wanted to share the results of my domotics adventure over the last 15 months for fun and insight. I implemented a rather extensive Domoticz setup, and here are some key characteristics and lessons learned from the project:
Zigbee: I set up 3 Zigbee networks, each with its own Zigbee2MQTT service, supporting a total of 725 Zigbee entities and 89 devices. Due to Zigbee devices (routers) being unable to handle more than 15 messages per second, I had to split them across different networks. Lua scripts in Domoticz connect the motion sensors to lights, dynamically adjusting based on light conditions and time.
Z-Wave: The sunscreens are managed via Zwave2MQTT, which integrates with Domoticz, controlled by Lua depending on rain, sun and light conditions.
MQTT: The Zigbee networks communicate over MQTT, and Domoticz listens for messages. I was unable to create a persistent MQTT-Domoticz autodiscovery setup, so I also used the Manual MQTT connector in Domoticz, with 2 created adapters (Python) that run as SystemD services to handle Zigbee dimmers and thermostat data.
Heating: The heating system (thermostats, floor valves, and central heater) is controlled by six ESP32 units, for which I wrote custom C software. The hardware units consist of 8-channel relay kits with optocouplers, powered by 24V and 5V supplies for the ESPs. All parts is readily available at Aliexpress. Domoticz controls the heating based on thermostats, interfacing with the ESPs via MySensors. For the temperature dependent central heating, I fed back the outdoor temperature to the heater by developing a temperature/current table with an ESP's A/D converter.
Air Conditioning: I used the reverse-engineered Mitsubishi protocol (mel-ac from GitHub) and wrote an adapter in dzVents to sync Domoticz virtual switches with the AC settings. The air conditioning is switched by motion sensors and temperature.
Airflow: For the 3 Orcon airflow units, I used Lolin D1 Mini's (another GitHub project) and wrote custom software in C since the controller was based on ESPhome, which Domoticz doesn’t support.
Gate and Bells: An Arduino Nano with custom software controls the gate and bell switches. Lua scripts in Domoticz detect bell signals, triggering emails with images from the cameras and controls the gate.
Kodi: I used the Kodi API and a Python script to control Kodi via Domoticz.
Domoticz: I've embraced the saying “Automate Everything.” The system operates autonomously with almost none manual input needed.
Though wall switches can still be used in conjunction with Zigbee devices. Control is optimized based on time, temperature, light conditions, motion, sun power, sun position, rain (knmi), and phone detection. The fact that the lady of the house hasn't complained lately is a testament to the system's success !
Some Key Takeaways:
Integrating off-the-shelf commercial products with Domoticz can be frustrating, but when they use open-source protocols, it becomes much easier.
The strength of Domoticz lies in its ability to combine various data streams. For example, incorporating weather forecasts into the heating system can prevent overshoot and reduce energy consumption. I've achieved a 50% reduction in energy use through smart control.
Combining camera, email, and bell data lets you build a “Ring”-like system in no time. The possibilities with Domoticz are almost limitless.
I love Domoticz’s Lua and dzVents webIDE. Its simplicity and power made it a clear choice over Home Assistant (HA). While HA is great for standard setups, YAML is not ideal for complex conditional programming. Additionally, integrating with other software in HA tends to complicate the system unnecessarily. My current setup — Domoticz (Docker), MQTT, 3 Zigbee2MQTT services, and ZWave2MQTT (Docker) — runs on a single RPI at only 4% CPU usage.
Split Zigbee networks into a maximum of 20-25 devices, especially if you use a lot of motion sensors, which can generate up to one MQTT message per second (I have 22 motion sensors in my setup!).
Use the manual MQTT interface if you need full control, and don’t rely too much on autodiscovery. Autodiscovery can miss devices and entities. The same is true with MySensors autodiscovery, where it’s crucial to ensure that all sensors and outputs present themselves correctly during initialization.
I'm now building a database with 12 months (4 seasons) of data to feed it into a AI with the objective to further optimize energy consumption (I had a setback due to a corrupt Domoticz.db file that resulted in memory leaks, see my other posts for more detail).
I'm considering to upload all programming to GitHub. If you're interested, please let me know, as personally I'm fine with archiving them as a zip file. I'll only invest the time in setting it up if there's enough interest. Cheers !!