The difference Online from Offline automation and scripting from macros

   The ability to set up the atmosphere in a room for watching a movie, a romantic evening and a holiday at the touch of just one button or at the right time is one of the sought-after functions of a smart home. In the AlphaSE home automation system, this and many other tasks can be implemented in completely different ways. In the article, we will describe the difference between Online and Offline functionality and scripts from macros.


Already from the names Online and Offline it becomes clear that some functionality works only when a smart home is connected to the Internet, the other does not depend on it in any way. The Internet server is responsible for Online automation. It is the server that sends commands to the equipment installed in the house or apartment at the right time to turn on lighting, close curtains, set temperatures, etc. Examples of Online automation are tasks configured in the Task Scheduler of your personal account. alice.smart-elec.ru , or scenarios in the Smart Home app from Yandex. If we have configured the street lighting to turn on at sunset in the Task Scheduler, it is the Smart Electronics company's server that will determine the sunset time daily at the geographical address of the hub and send a command at the right time to turn on a specific relay that controls street lighting. The advantages of Online automation include ease of configuration. It is intuitive and can be performed by the end customer independently.


The disadvantages of Online automation are:

a delay of up to 3 seconds when executing commands due to the time spent on processing data by the server and transmitting commands from it to the hub,

if there is no Internet connection, automation will not work at all, because the smart home will not receive commands from the server.

   It is for this reason that it is recommended to use Online automation only for comfort functions, avoiding mission-critical tasks. Even if the evening lights of the paths or trees do not turn on a couple of times during the year after sunset, nothing terrible will happen.


   With Offline automation, all settings are stored in AlphaSE Hub2 itself and smart home modules. For this reason, the algorithms will work without time delays and even without the Internet. If the "Cinema" button is pressed, the lighting should be turned off and the curtains closed immediately, not after 0-3 seconds. Offline automation can be implemented in 2 ways — scripts or macros. In the case of scenarios, all the necessary commands are recorded in the hub, with macros in the smart home modules. Let's take an example of the difference. When executing the "Cinema" scenario, the hub will send pre-recorded commands to the modules via the bus in turn — module 1 turn off output 1 (chandelier), module 2 turn on output 1 by 30% (wall lamp), module 3 turn off output 1 (curtains close). That is, the only device that needs to be configured to execute the scenario is the hub.


   To use the "Cinema" macro, you will need to pre-configure the smart home modules. Each module must know what it will do when it receives a command to execute a macro. At the right moment, the hub will send just one command to the bus: "All modules run the Movie macro, and the modules involved in the macro will have to switch to the desired state.


   Since the result will be the same when executing macros and scripts, and the scripts are easier to configure, we recommend using them first when automating. If there are not enough scripts, then start using macros in this case.



When using Offline automation, the following must be considered::


AlphaSE Hub2 supports only 8 scenarios,

the Light line modules do not support macros,

the Pro line modules support 16 macros,

and the Ultra line modules support 32 macros.