Solutions
...
Litmus Production Record Exter...
Creating an event monitoring c...
1. Defining the Event and Trigger condition
26 min
the purpose of the sheet event and trigger definition is to define the event as well as the trigger condition to be monitored the entries in this sheet will be used to create the unique event name and eventtrigger json key of the event configuration json structure note the sequence of steps shown in this guide is a recommendation, as it felt the most natural for the author but users are free to follow their own preferred sequence define the unique event name each event defined using the litmus production record external event configurator, needs to have a unique name the name of an event configured in the column labeled event name the user enters the desired event name into the column labeled event name important do not leave blank rows between entries or at the start a blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row the configurator will verify the event name for invalid ascii characters to learn more about which ascii characters are allowed, review the section restrictions on ascii characters allowed to be used the configurator also validate that the event name is unique invalid ascii characters if an invalid character is found, a prompt is shown to the user invalid characters are marked in red as spaces are not a visible character, they can't be marked in red, so the user can make use of the comment added to the cell as well duplicate event name check a specific event name has to be unique if the configurator does detect, that a specific event name has already be used, the user is prompted the duplicate row will have the column event name marked in red this allows the user to find the duplicate entry and correct it define the devicehub tag name used as event trigger the name of a devicehub tag name which will be monitored as trigger is configured in the column labeled devicehub tag name used as event trigger important do not leave blank rows between entries or at the start a blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row note to allow that the tag can be monitored, the tag will have to be configured on litmus edge at least once if multiple devices have the same tag configured, all can be potentially monitored for the event define the trigger condition to be able to monitor the devicehub tag for an event, the flow from the litmus solution litmus production record event processing flow does require a trigger condition t he litmus solution litmus production record event processing flow supports six different conditions trigger condition what is monitored o nvaluechange the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag for any change to the value valueequalto the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag if it is equal to the value set onvaluechangebutexclude the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag for any change to the value but will ignore the value set to be excluded onvaluechangenotincluded the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag for any change to the value but will ignore if the value contains the substring set to be not included onvaluechangeandsecondvalueequalto the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag for any change to the value and that a second trigger is equal to the set value onvaluechangeexcludezeroandsecondvalueequalto the node red flow litmus production record event processing flow will monitor the devicehub tag set as trigger tag for any change to the value except for the value 0 and that a second trigger is equal to the set value the user sets the trigger condition by selecting it from the drop down menu in the column labeled trigger condition this will add the selected string into the cell note only values available through the drop down menu can be selected define the source of the trigger value or the source of a second trigger the column labeled source of trigger value / source second trigger allows the user to define where either the value to monitor against the trigger tag originates from or define the source of a second trigger note this column does not need to be filled in, if the cell itself is greyed out the value to enter will change depending on the choice made in the column labeled trigger condition trigger condition = onvaluechange the cell will be greyed out and the user does not have to insert a value trigger condition = valueequalto / onvaluechangebutexclude / onvaluechangenotincluded the user selects one of three values from a drop down menu source of trigger value what is the source example constantvalue the trigger tag is compared ( valueequalto ) against a fixed value the tag value is monitored for any change except if the value of the tag is this fixed value ( onvaluechangebutexclude ) the tag value is monitored for any change except if the value of the tag does contain this fixed value ( onvaluechangenotincluded ) 1 program1 o9 fromflowvariable the trigger tag is compared ( valueequalto ) against the value contained in this node red flow variable the tag value is monitored for any change except if the value of the tag is the value contained in this node red flow variable ( onvaluechangebutexclude ) the tag value is monitored for any change except if the value of the tag does contain the value contained in this node red flow variable ( onvaluechangenotincluded ) note this allows users, to be able to modify this value programmatically for example based on a recipe value important the code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration triggertagvalue excludetriggervalue donotinclude fromglobalvariable the trigger tag is compared ( valueequalto ) against the value contained in this node red global variable the tag value is monitored for any change except if the value of the tag is the value contained in this node red global variable ( onvaluechangebutexclude ) the tag value is monitored for any change except if the value of the tag does contain the value contained in this node red global variable ( onvaluechangenotincluded ) note this allows users, to be able to modify this value programmatically for example based on a recipe value hint the code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration triggertagvalueevent1 excludetriggervalueevent1 donotincludeevent1 trigger condition = onvaluechangeandsecondvalueequalto / onvaluechangeexcludezeroandsecondvalueequalto the user selects one of two values from a drop down menu source second trigger what is the source example fromflowvariable the tag value is monitored for any change and the value in the node red flow variable ( onvaluechangeandsecondvalueequalto ) has to be equal to a defined value the tag value is monitored for any change except if the value is 0 and the value in the node red flow variable ( onvaluechangeexcludezeroandsecondvalueequalto ) has to be equal to a defined value note this allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow important the code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration secondcondition secondcondition fromglobalvariable the tag value is monitored for any change and the value in the node red global variable ( onvaluechangeandsecondvalueequalto ) has to be equal to a defined value the tag value is monitored for any change except if the value is 0 and the value in the node red global variable ( onvaluechangeexcludezeroandsecondvalueequalto ) has to be equal to a defined value note this allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow hint the code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration assetintrackingmode assetintrackingmode based on the trigger condition, the user selects the source from the drop down menu note only values available through the drop down menu can be selected important do not leave blank rows between entries or at the start a blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row define the trigger value or node red variable name th column labeled trigger value / variable name allows the user to define either the value to monitor the trigger tag against or define the name of a node red flow or global variable note this column does not need to be filled in, if the cell itself is greyed out the value to enter will change depending on the choice made in the column labeled source of trigger value / source second trigger and the column trigger condition source of trigger value / source second trigger = constantvalue the user defines the fixed constant value against which the trigger tag is compared source of trigger value / source second trigger = fromflowvariable / fromglobalvariable trigger condition = valueequalto / onvaluechangebutexclude / onvaluechangenotincluded the user defines the name of the node red flow or global variable which will contain the value against which the tag is compared trigger condition = onvaluechangeandsecondvalueequalto / onvaluechangeexcludezeroandsecondvalueequalto the user defines the name of the node red flow or global variable which will contain the second trigger condition define the source of the second trigger value the column labeled second trigger value / second variable name allows the user to define where the value to monitor against the second trigger originates from note this column does not need to be filled in, if the cell itself is greyed out the value to enter will change depending on the choice made in the column labeled trigger condition trigger condition = onvaluechange / valueequalto / onvaluechangebutexclude / onvaluechangenotincluded the cell will be greyed out and the user does not have to insert a value trigger condition = onvaluechangeandsecondvalueequalto / onvaluechangeexcludezeroandsecondvalueequalto the user selects one of two values from a drop down menu source of trigger value what is the source example constantvalue the second trigger is compared against a fixed value 1 fromflowvariable the second trigger tag is compared against the value contained in this node red flow variable note this allows users, to be able to modify this value programmatically for example based on a recipe value important the code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration secondtriggervalue fromglobalvariable the second trigger is compared against the value contained in this node red global variable note this allows users, to be able to modify this value programmatically for example based on a recipe value hint the code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration secondtriggervalueevent1 based on the trigger condition, the user selects the source from the drop down menu note only values available through the drop down menu can be selected important do not leave blank rows between entries or at the start a blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row define the second trigger value or node red variable name th column labeled second trigger value / second variable name allows the user to define the value to monitor the second trigger against or define the name of a node red flow or global variable note this column does not need to be filled in, if the cell itself is greyed out the value to enter will change depending on the choice made in the column labeled source of second trigger value source of second trigger value = constantvalue the user defines the fixed constant value against which the second trigger is compared source of second trigger value = fromflowvariable / fromglobalvariable the user defines the name of the node red flow or global variable which will contain the value against which the second trigger is compared define the litmus message broker prefix used for publishing the event data t he litmus solution litmus production record event processing flow will publish the event data for the defined data model items after a trigger condition has been true using the litmus message broker this allows a large degree of freedom when it comes to sending the data to litmus production record database while it is recommended to use a litmus integration to the send the event data to litmus production record database, users can also choose other methods like node red or custom docker applications to handle this task to be able to publish the event data using litmus message broker, the user needs to define the topic prefix (first part of the topic) under which the event data are published the topic prefix is configured in the column labeled topic used when publishing to message broker the user enters the desired topic into the column labeled topic used when publishing to message broker the defined prefix is used to build for each data mode litem a distinct litmus message broker topic using the unique event name, the litmus edge devicehub device name for which the event was observed ending on a combination of the devicehub tag name and the number of the item it was used to populate example litmusprorec serialno tracking asset data asset1 execprogno name item1 important do not leave blank rows between entries or at the start a blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row the configurator will verify the topic for invalid ascii characters to learn more about which ascii characters are allowed, review the section restrictions on ascii characters allowed to be used invalid ascii characters if an invalid character is found, a prompt is shown to the user invalid characters are marked in red as spaces are not a visible character, they can't be marked in red, so the user can make use of the comment added to the cell as well tip to make it easier to subscribe to the all the topics which are published by the flow from the litmus solution litmus production record event processing flow , the same topic prefix should be used for all events this way, it is possible to use a wildcard litmusprorec > on the topic prefix to make sure to not miss any events