Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

To increase the information content of notifications, users can uses use macros. At the time of sending the notifications, macros will be replaced with the corresponding information: Time, sensor name, its value, and so on.

http://www.connexit.biz

The macros is are indicated by the percent sign and the number corresponding to the contained information.
the  contained information.

The following macros are available:

Macros

Specification

Illustration sample

%1

A verbal description of the triggered logic.

if

    'Onboard Temperature' (id=201001) in state 'high alarm';

and    'Onboard Voltage DC' (id=203001) in state 'high alarm';

then

    'Power-1' (id=304001) changes to state 'on' immediately, once;

    'Simple_Mail' (id=601001) changes to state 'on' immediately, once;

%2

The state of the logic

circuit

scheme elements included in the IF conditions, at the time when the

circuit

logic is triggered.

'Onboard Temperature' (id=201001) in state 'high alarm';

'Onboard Voltage DC' (id=203001) in state 'high alarm';

%3

Trigger time of the logic

circuit

scheme.

11:32:28 2017/06/13

%4

Name of the logic

circuit

scheme.

'Logic_Temp_01'

%5

The name of the sensor, the change in the state of which led to the activation of the logic

circuit

. Here is displayed the name of the sensor, from which the logic

circuit

is triggered.

'Onboard Temperature'

%6

The state of the sensor that triggered the logic

circuit

scheme.

'high alarm'

%7

The sensor value or its logic level at the time of the triggering of the logic

circuit

scheme.

'27.60'

%8

The ID of the sensor that triggered the logic

circuit

scheme.

'201001'

%9

Units of measurement, if the sensor has such a parameter.

°C

%A

The sensor value or its logic level at the time of the triggering of the logic scheme. No quotation marks.

27.60

Macros parameterization

Макросы %5Macros %5, %6, %7 имеют возможность параметризации по идентификатору элемента %7, %A have the option of parameterization by ID of the element {id}. Т.е. для этих макросов возможно указать конкретный элемент, для которого будет вычислен макрос.

В качестве параметра, определяющего элемент, передается ID элемента. ID помещается в фигурных скобках {id} непосредственно после имени макроса.

Пример вычисления макросов:

...

 Those. For these macros, it is possible to specify an element for which the macro will be calculated.

The element ID is passed as the parameter that defines the element. ID is placed in curly brackets {id} immediately after the name of the macro.

Example of computing macros:

Macro

Description

Example

%5{id}

Имя датчика с заданным идентификатором

The name of the sensor with the given id.

%5{

201001} выдаст имя датчика

201999} will give the sensor name: 'Onboard Temperature'

%6{id}

Состояние датчика с заданным идентификатором

Status of the sensor with the given id.

%6{

201001} выдаст состояние датчика

201999} will issue a sensor state: 'normal'

%7{id}

Значение измеренной величины датчика с заданным идентификатором.

The measured value of the sensor with the given id

%7{

201001} выдаст значение датчика

201999} will give the sensor value: '26.50'

...

%A{id}

The measured value of the sensor with the given id without quotation marks

%A{201999} will give the sensor value: 26.50

If an element with the specified id is not found, a string is inserted into the message text — 'id=xxxx not found'.

...

In case the {id}

...

Макрос детализации модуля, группы и системы

Макрос %8 может использоваться для определения идентификатора датчика при срабатывании логической схемы по изменению состояния группы, модуля или системы. Этот макрос можно использовать в качестве параметра идентификатора в макросах %5, %6 и %7.

Пример использования макроса для обработки модуля.

Создадим такую логическую схему:

Image Removed

При срабатывании в состояние 'Alarm' модуля 'Autodetect', будет осуществлено управление реле и отправлено сообщение на электронную почту.

...

titleСостояние модуля, группы и системы

...

parameter is not set, the value of the element that triggered the logic scheme will be inserted into the message text.

Detail macro of the module, group, and system

The macro %8 can be used to determine the ID of the sensor when the logic scheme is triggered by a change in the state of the group, module, or system. This macro can be used as an identifier parameter in macros %5, %6, %7 and %A.

An example of using a macro for processing a module.

Let's create such a logical scheme:

...

When the 'Alarm' state of the 'Autodetect' module is activated, the relay will be managed and a message sent to the e-mail.

Info

Module, group and system state

The module (group, system) goes into the 'Alarm' state if at least one of the connected sensors (analog or discrete) is in the 'Alarm', 'High alarm' или or 'Low alarm' state.

Модуль The module (группаgroup, система) переходит в состояние 'Warning', если хотябы один из его подключенных датчиков (аналоговых или дискретных) находится в состоянии system) goes into the 'Warning' state if at least one of the connected sensors (analog or discrete) is in the 'Warning', 'High warning' или or 'Low warning' и при этом модуль не находится в состоянии state and the module is not in the ' Alarm '.Модуль

The module (группаgroup, система) переходт в состояние 'Normal', если все его подключенные датчики находятся в состоянии system) goes to the 'Normal' state if all еру connected sensors are in the 'Normal' .

Рассмотрим какую информацию можно получить с помощью макросов.

...

Макрос

...

state.

Consider what information you can get with the help of macros.

Macro

Result of the macro

Explanation

%1

if

    module 'Autodetect' (id=2021) in state 'alarm';

then

    'Power-1' (id=304001) changes to state 'on' immediately, once;

    'Power-2' (id=304002) changes to state 'off' immediately, once;

    'Simple_Mail' (id=601001) changes to state 'on' immediately, once;

Словесное описание сработавшей логической схемы. При переходе модуля

Verbal description of the triggered logic. When the 'Autodetect'

в состояние

module is switched to the 'alarm'

немедленно (и однократно, без повторов) включается реле

state, the 'Power-1'

, отключается реле

relay is turned on immediately (and once, without repeats), the 'Power-2'

и отправляется почтовое уведомление

relay is turned off and the 'Simple_Mail'

. Модуль переходит в состояние 'alarm', если хотябы один из его элементов находится в состоянии 'alarm'

notification is sent. The module goes into the 'alarm' state if at least one of its elements is in the 'alarm' state.

%2

module 'Autodetect' (id=2021) in state 'alarm';

Состояние элементов логической схемы, на момент срабатывания схемы, включенных в условия IF. Описан модуль вызвавший срабатывание схемы и его состояние

The state of the elements of the logic scheme included in the IF conditions at the time when the is triggered. The module that triggered the logic and its state are described.

%3

16:14:41 2017/06/13

Время срабатывания логической схемы

The response time of the logic scheme.

%4

'Logic_Analog_Sensors'

Название логической схемы

The name of the logical scheme.

%5

'Autodetect'

Имя датчика (модуля), изменение состояния которого привело к срабатыванию логической схемы

The name of the sensor (module), the change in the state of which led to the activation of the logic scheme.

%6

'alarm'

Состояние датчика (модуля), инициировавшего срабатывание логической схемы

The state of the sensor (module) that initiated the triggering of the logic scheme.

%7

%A

'not supported'

Значение величины, измеряемой датчиком или его логический уровень на момент срабатывания логической схемы. Модуль не имеет такого поля, поэтому здесь выводится

Measured sensor value or its logic level at the time when the logic is triggered. The module does not have this field, so 'not supported' is displayed here.

%8

'107002'

Идентификатор датчика, инициировавшего срабатывание логической схемы. Здесь указывается именно идентификатор датчика, который содержится в модуле и который вызвал срабатывание модуля. В данном случае это датчик протечки воды. Использование этого макроса в качестве параметра позволяет определить сработавший внутри модуля датчик.

The id of the sensor that triggered the logic scheme. Here is the sensor ID, which is contained in the module and which caused the module to operate, is indicated. In this case, it is a water leakage sensor. Using this macro as a parameter allows you to determine the sensor that has worked inside the module.

%5{%8}

'Analog-2-WATER'

Имя датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработал модуль

The name of the sensor by ID. We request it by the id of the sensor from which the module is triggered.

%6{%8}

'alarm'

Состояние датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработал модуль

Sensor status by id. We request it by the id of the sensor from which the module is triggered.

%7{%8}

%A{%8}

'1'

Значение величины датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработал модуль

1

The sensor value by id. We request it by the id of the sensor from which the module triggered.

%5{201002}

'Analog-1-TEMPERATURE'

Имя датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры

The name of the sensor by ID. We request one of the arbitrary sensors, in this case, it is a temperature sensor.

%6{201002}

'high warning'

Состояние датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры

Sensor status by id. We request one of the arbitrary sensors, in this case, it is a temperature sensor.

%7{201002}

%A{201002}

'28.50'

Значение величины датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры.

...

28.50

The value of the sensor by ID. We request one of the arbitrary sensors, in this case, it is a temperature sensor.


From this information, it is seen that the water leakage sensor 'Analog-2-WATER' has acted in the 'alarm' , при этом он перевел модуль state, it has transferred the 'Autodetect' также в состояние module to the 'alarm' , что и вызвало срабатывание логической схемы и отправку уведомления.

Макросы в групповых уведомлениях

При необходимости в наблюдении за состоянием элементов, предпочтительнее использовать не механизм логических схем, а групповые уведомления. Т.к. при большом числе наблюдаемых элементов групповые уведомления позволяют значительно сократить число логических схем (т.к. не используют их) и упростить настройку устройства. Логические схемы обосновано использовать при сложных реакциях на события, например при управлении внешней нагрузкой, реле.

Рассмотрим использование макросов в групповых уведомлениях. О создании групп и групповых уведомлений подробнее можно прочитать тут: /wiki/spaces/DocRU/pages/44204034.

Для примера, создадим группу элементов включающую в себя все датчики температуры в системе.

Image Removed

Зададим уведомление которое будет отправляться при переходе группы в состояния 'Normal' и 'High alarm'.

Image Removed

Рассмотрим информацию которую можно получить используя макросы в тексте уведомления.

...

Макрос

...

state, which triggered the logic scheme and sent the notification.

Macros in group notifications

If it is necessary to monitor the state of elements, it is preferable to use not a mechanism of logic schemes, but group notifications. Because with a large number of observed elements, group notifications can significantly reduce the number of logic schemes (since they do not use them) and simplify device configuration. Logic schemes are reasonable to use when complex reactions to events, for example when controlling an external relay.

You can read more about creating groups and group notifications here: Using group notifications.

For example, create a group of elements that includes all temperature sensors in the system.

...


Let's set a notification that will be sent when the group switches to the 'Normal' and 'High alarm' states.

...

Such information can be obtained using macros in the text of the notification.

Macro

Macro result example

Comment

%1

do not use this macro for group notifications

Because the logic is not used here, then this macro does not make sense.

%2

do not use this macro for group notifications

Because the logic is not used here, then this macro does not make sense.

%3

16:14:41 2017/06/13

Время срабатывания, соответствует моменту перехода группы в наблюдаемое состояние

The response time corresponds to the moment of transition of the group to the observed state.

%4

'Group_Temperature_Only'

Название группы

Group name.

%5

'vt470-0192-temperature'

Имя датчика (модуля), инициировавшего срабатывание. Изменение состояния этого датчика привело к изменению состояния группы и отправке уведомления

The name of the sensor (or module) that initiated the state change. Changing the state of this sensor has led to a change in the state of the group and sending a notification.

%6

'high alarm'

Состояние датчика (модуля), инициировавшего срабатывание

The state of the sensor (or module) that initiated the state change.

%7

%A

'27.30'

Значение величины, измеряемой датчиком или его логический уровень на момент срабатывания

27.30

The value is measured by the sensor or its logical level at the time of operation.

%8

'201003'

Идентификатор датчика, инициировавшего срабатывание. Здесь указывается именно идентификатор датчика, изменение состояния которого привело к изменению состояния группы и отправке уведомления

The identifier of the sensor that initiated the state change. Here, it is the sensor identifier that is indicated, a change in the state of which led to a change in the group state and sending a notification.

%5{%8}

'vt470-0192-temperature'

Имя датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработало групповое уведомление. В данном случае работа макроса аналогична

Sensor name by ID. We are requesting the sensor ID from which the group notification worked. In this case, the macro is similar to %5.

%6{%8}

'high alarm'

Состояние датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработало групповое уведомление. В данном случае работа макроса аналогична

Sensor state by ID. We are requesting the sensor ID from which the group notification worked. In this case, the macro is similar to %6.

%7{%8}

%A{%8}

'27.30'

Значение величины датчика по идентификатору. Запрашиваем по идентификатору датчика от которого сработало групповое уведомление. В данном случае работа макроса аналогична

27.30

Sensor value by ID. We are requesting the sensor ID from which the group notification worked. In this case, the macro is similar to %7.

%5{201002}

'Analog-1-TEMPERATURE'

Имя датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры. Макрос позволяет например вывести данные других датчиков группы

Sensor name by ID. We request one of any sensors, in this case, it is a temperature sensor. The macro allows for example to display the data of any sensors of the group.

%6{201002}

'high warning'

Состояние датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры. Макрос позволяет например вывести данные других датчиков группы

Sensor state by ID. We request one of any sensors, in this case, it is a temperature sensor. The macro allows for example to display the data of any sensors of the group.

%7{201002}

%A{201002}

'28.50'

Значение величины датчика по идентификатору. Запрашиваем один из произвольных датчиков, в данном случае это датчик температуры. Макрос позволяет например вывести данные других датчиков группы

28.50

Sensor value by ID. We request one of any sensors, in this case, it is a temperature sensor. The macro allows for example to display the data of any sensors of the group.