Scenarios

Scenarios are the primary tool for flexible configuration and automation of device operation.

An example of using scenarios is greenhouse automation. When the air temperature in the greenhouse drops below the set level, the heating system will automatically turn on. The irrigation system will automatically turn on according to a schedule or soil moisture sensor values.

Ready-made scenarios are available to users; they can also create new ones.

Installation

There are two types of scenarios: simple and professional.

Simple scenarios are pre-installed extensions available to users out of the box.

Professional scenarios are those that the users create.

Go to the Market section and select the Extensions tab to see the available scenarios.

The available scenarios

To read the scenario description, click on the information icon to the right of its name. The information icon

To install a scenario, click on the download icon next to its name.

The download icon

To update an installed scenario, click on the reload icon next to its name.

To delete a scenario, click on the trash icon next to its name.

The update and delete icons

Сreating and configuring the scenario

To create a new scenario, go to the Scenarios screen. The “Create scenario” field and a drop-down list with downloaded extensions from the market are available in the upper right corner of the screen. Select the required extension.

The “Create scenario” field

Consider configuring a scenario using the “Daylight control” extension as an example.

The General tab of a scenario setup window consists of the following fields:

  1. The scenario's title is displayed on the scenario page in the platform interface. This title is for the user only and does not have to be unique.
  2. Scenario's name - the unique name under which the scenario is used in the system.
  3. City - select the locality to use the scenario. This information is necessary to determine the exact time of sunrise and sunset based on geographic coordinates.
  4. Switchers - selection of devices and sensors involved in the scenario. You can select multiple items.

The General tab of a scenario setup window

On the Advanced tab, you can configure additional items:

  • messages that are sent to the user when switching the state to true and false,
  • setting a time offset to turn on the sensor for a certain number of minutes before sunset.

The Advanced tab of a scenario setup window

Click the “Save” button after completing all settings.

The scenario setup window

After running the scenario, you will have access to a configuration line with the sensor on/off thresholds.

The scenario configuration line

Thresholds

Thresholds differ depending on the type of simple scenario.

The scenario thresholds

For the Daylight control scenario, the threshold is the total number of hours per day when the premises should be illuminated. For example, if it is recommended that the plants in the greenhouse be illuminated for 20 hours a day, the user needs to specify this period as a threshold value. The scenario will consider the time of sunrise and sunset and provide additional artificial lighting so that this recommendation is implemented throughout the year.

The scenario thresholds

Scenario control in the user interface

In the user interface, go to the “Add widget” field and select the “Toggle” widget to manually enable and disable the created scenario.

The “Add widget” field

Specify the name and background color in the settings.

The widget settings

Click on the “Entity” item.

Select entity window

Select one of the available options for the widget. This could either be starting/canceling a scenario or enabling/disabling a threshold in this example.

Select entity window

The scenario control widget will be displayed in the user interface. You can manage the scenario without going to the admin panel.

The scenario control widget

Similarly, by selecting and configuring the “Input” widget, you can add scenario threshold control to the user interface. This example shows the number of hours the room is illuminated.

Select entity window

The widget settings

After configuring the widget, you can use it to configure thresholds in the user interface.

Configuring thresholds

The user's changes to the scenario settings will also be automatically displayed in the admin panel.

The admin panel

Pro scenarios

You can create your scenarios using the JavaScript programming language. All the simple scenarios available in the system are written similarly.

To create a professional scenario, go to the Scenario screen, and in the “Create scenario” drop-down list, click “Create Pro Scenario”.

The “Create Pro Scenario” button

In the editor that appears, specify the name of the new scenario.

The "Pro Scenario” editor

Pay attention to ready-made templates - you can use one of them when creating a scenario.

The ready-made templates

Write the code of the new scenario.

The "Pro Scenario” editor

Use the 2Smart documentation when creating professional scenarios:

results matching ""

    No results matching ""