Our sponsor:


March 05, 2018 | Niels Laan | Controllers, Domoticz



Now that we have added some devices, we can automate some things. You can do this with scenes and events that I will deal with later.
With a scene you can, among other things, create groups so that you can bundle different lighting together. You can switch this on and off with 1 button at the same time.


Met bovenstaande scene's kun je dus gemakkelijk iets aan of uit laten zetten maar wil je echt serieus met domotica aan de slag dan wil je natuurlijk wat ingewikkeldere regels maken. Domoticz heeft hiervoor de blocky programmeer mogelijkheid. Je kunt dan door middel van puzzels een regel maken. Het leuk hiervan is dat dit voor vrij wel iedereen te begrijpen is en de mogelijkheid eindeloos zijn.

Het maken van regels is verdeelt in de volgende onderdelen:


Dit is het startpunt (DO) van de regel. Zo vind je hier de IF en ELSE opties.


Here you will find the trigger options such as greater than, set after x seconds and the ON/OFF/OPEN/CLOSE/etc.


All puzzles that have to do with time. You will also find here the sunrise and sunset option to automatically turn your lights on / off when it gets dark.


Here you will find the section to send an email / sms and push message.


If you are going to build an alarm, you can use this puzzle to have it turned on and off.

User variables:

The options to work with variables.

Write to log:

With this handy puzzle you can add an extra login to the Domoticz log, useful if you want to see what happens to your rules.


Last but not least the device part. Here you will find all your devices that you can use.

Example rules/events:

Below I give a few examples of a number of rules:

Light on when opening a door:

First, I take the IF/DO puzzle from the control section. Then I take the first puzzle from the logic part.

Even better is of course that the lamp only comes on when the sun goes down. You can easily do this by adding the time> sunrise puzzle. I use an AND to meet both conditions.

As you can see in the examples above, it is simple to make rules. The possibilities are endless and I see no limitations. All elements such as an IF/IF, multiple triggers and use of variables are present. There is even a possibility (for the real pros) to program LUA and Python now. The only point I want to make is that the interface looks a bit messy. For example, you cannot divide your rules into folders and I had to remove all puzzles that are not being used before they could be saved.


Niels Laan

Founder of this blog and passionate home automation nerd. All articles from Niels

More of: