Asset Monitoring

What is asset monitoring?

Asset monitoring is a solution template within ClearBlade which is designed to be customizable for various use-cases like: Tracking & Monitoring Railcars, Monitoring Industrial Equipments, Tracking people, etc. An example statement of one of the problems it can solve is shown below:

Send an SMS to the Manager if the attribute door of the asset_type Gondola is open. (Note: the attribute door is a user defined attribute & the type Gondola is a user defined asset_type).

Watch the Asset Monitoring Demo

Setup

The following actions need to be performed, before starting to use a Portal.

  • Create a new user in the system with an Authenticated Role. This user is used to log into the Portal.
  • Some development tasks may be involved if the user intends on having their own custom devices. For example: design a normalizer custom to the device.
  • Make sure the following stream services are running by checking in the ClearBlade Console. AssetHistory, AssetLocation, AssetStatus, RulesEngine, Normalizer & ActionEmitter.# Quick Tutorial

    Quick Tutorial

This readme covers on how to use the AssetModel Portal as an administrative User. The way to work with this system for the first time is to carryout the following tasks as mentioned, in the given order. In this readme we cover various sections including:

Homepage

On the homepage of the Asset Monitor portal there is a map that shows the location of the assets (gondola) and areas (gondola storage).

Toolbar

  1. Monitor
    • Assets : Maintains the details of all assets
    • Areas : Maintains the details of all areas
  2. Status
  3. Users

Contains the list of users and their data in the system. Users can be added, edited, and deleted from here.

  1. Administration

This is where you can edit all of the assets, areas, rules, and events.

How to Create an Asset Type?

An asset type is a profile of default and custom attributes that can be created and applied to one or more assets.

Fill in the values for the asset type.

Value Definition
ID The asset type’s unique ID
Name Name of the asset type
Icon Upload an image for the asset marker that will appear on the map
Description Description of the asset type

Attributes

Click + Add to add each attribute.

Value Definition
Name Attribute label
Type Data type of the attribute’s appearance
View The display tool of the attribute’s data
View Settings JSON object customizing the ‘View’
Edit How the ‘View’ data will be edited
Edit Settings JSON object customizing the ‘Edit’
History When checked, the history of changes is recorded ‘Historical Data’ under ‘Assets’ in the ‘Monitor’ tab

Make sure to click ‘Submit’ to save all changes before moving on. The asset type should appear in the table on the left. Click on the asset type name to edit it. Mark the checkbox(es) of the asset types and click ‘Delete Row’ to delete asset types.

How to Create an Asset?

An asset is the device to be monitored.

Fill in the values for the asset.

Value Definition
Type Assign an asset type that is created previously
ID The asset’s unique ID
Name Name of the asset
Parent Asset A primary asset that has been created previously
Longitude The longitude of the asset’s location the map
Latitude The longitude of the asset’s location the map
Owners Email of the user(s) managing the asset
Location updated Timestamp of the asset’s location update
Last updated Timestamp of the asset’s most recent update
Description Description of the asset
Image An image of the asset to be kept on record and can be viewed in an asset’s ‘Details’ under ‘Monitor’

All values after ‘Image’ are based on the attributes defined in the asset type.

Click Add Marker to mark the longitude and latitude coordinates on the map in the ‘Edit Location’ pane.

Make sure to click ‘Submit’ to save all changes before moving on. The assets should appear in the table on the left. Click on the assets name to edit it. Mark the checkbox(es) of the assets and click ‘Delete Row’ to delete assets.

How to Create an Area Type?

An area type is a profile of default and custom attributes that can be created and applied to one or more areas.

Fill in the values for the area type.

Value Definition
ID The area type’s unique ID
Name Name of the area type
Icon Upload an image for the area marker that will appear on the map
Description Description of the area type

Attributes

Click + Add to add each attribute.

Value Definition
Name Attribute label
Type Data type of the attribute’s appearance
View The display tool of the attribute’s data
View Settings JSON object customizing the ‘View’
Edit Edit area view, which shows up when we edit the area type
Edit Settings JSON object customizing the ‘Edit’
History When checked, the history of changes is recorded ‘Historical Data’ under ‘Areas’ in the ‘Monitor’ tab

Make sure to click ‘Submit’ to save all changes before moving on. The area type should appear in the table on the left. Click on the area type name to edit it. Mark the checkbox(es) of the asset types and click ‘Delete Row’ to delete area types.

How to Create an Area?

An area is a physical location in either cartesian (xyz) or polar (latitude/longitude) coordinates. It supports single points, polygon shapes, and named places (Austin, TX).

Fill in the values for the area.

Value Definition
Type Assign an area type that is created previously
Geometry Type The types of model view of the location (GPS, Indoor Model, and Indoor Area)
ID The area’s unique ID
Name Name of the area
Parent Area A primary area that has been created previously
Longitude The longitude of the area’s location the map
Latitude The longitude of the area’s location the map
Polygon Input an array of cartesian coordinates. Example: [{"x":167.15952331104467,"y":13.79853098728273,"z":-509.4261787433696}
Assets The assets assigned to the area
Last updated Timestamp of the area’s most recent update
Image An image of the asset to be kept on record and can be viewed in an asset’s ‘Details’ under ‘Monitor’
Description Description of the area
Owners Email of the user(s) managing the area

All values after ‘Owners’ are based on the attributes defined in the area type.

Click Add Marker to mark the longitude and latitude coordinates on the map in the ‘Edit Location’ pane.

Make sure to click ‘Submit’ to save all changes before moving on. The areas should appear in the table on the left. Click on the areas name to edit it. Mark the checkbox(es) of the areas and click ‘Delete Row’ to delete areas.

How to Create an Action Type?

An action type is defined as a type of action which a user would invoke when a particular event is created. It is a pre-requisite to have atleast one action type defined to be able to create an Event Type.

Note: As of v1.7.1, the only supported action type is Sending SMS

Fill in the values for the action type.

Value Definition
ID The action type’s unique ID
Name Name of the action type

Fields

Value Definition
Name Name of the field
Label Displayed label of field
Input Type Data type input accepted by field
Placeholder Default input of field
Required? A checked box requires a user to input data before proceeding
Allow Multiple? A checked box allows for multiple inputs
Own Row? A checked allows for the field to be in a separate row from other fields

Make sure to click ‘Submit’ to save all changes before moving on. The action types should appear in the table on the left. Click on the action type name to edit it. Mark the checkbox(es) of the action type and click ‘Delete Row’ to delete action types.

How to Create an Event Type?

An Event type is used by a user to create a category of events which can help create an event when a certain rule fires. Event Types are associated with Actions Types & Rule Types.

Fill in the values for the event type.

Value Definition
ID The event type’s unique ID
Name Name of the event type
Severity Connected to certain alarm states
Priority Connected to responses to event types
Action Types Assign an action type that is created previously
Description Description of the event type
Has Lifecycle? A checked box allows for the event to have open and closed states
Open State Give the open state a name if the Has Lifecycle? box has been checked. You can add multiple open states by clicking Add + and delete by click the X
Closed State Give the close stated a name if the Has Lifecycle? box has been checked. You can add multiple closed states by clicking Add + and delete by click the X

Make sure to click ‘Submit’ to save all changes before moving on. The event types should appear in the table on the left. Click on the event type name to edit it. Mark the checkbox(es) of the event type and click ‘Delete Row’ to delete event types.

How to Create a Rule Type?

A rule type is used by a user to create a category of rules which can be fired off of certain conditions. User must also select a list of associated event types. These event types can be used while creating rules.

Fill in the values for the rule type.

Value Definition
Name Name of the rule type
Include Timeframe? A checked box allows for timeframe option to appear in rule creation
Event Types Assign an asset type that is created previously. Use Cmd+Click to select multiple event types

Proximity Conditions

Asset Entity: section allows user to select which assets and asset types the rule type can apply on.

Value Definition
Asset Prefix A prefix to make the rules created as downstream of this rule type user readable
Filter Options Allows user to filter Asset Types
Asset Assign a previously created asset
Allow Types? A checkbox which allows user to select an asset type when creating a new rule of this rule type
Allow Asset? A checkbox which allows user to select an asset when creating a new rule of this rule type
Asset Suffix A suffix to make the rules created as downstream of this rule type user readable

Relationship: section allows user to select criteria’s for various relationships

Assign labels to:

  • Greater Than (or Equal To)
  • Less Than (or Equal To)
  • (Not) Equal To

Then give it a value (integer) and its units

Entity: section allows user to select which type of entities the rule type can apply on.

Refer to Asset entity above

Duration

Mark the Include Duration? box for the ability to allow duration in rule creation

Occupancy Conditions

Refer to Proximity Conditions and use area as the entity instead of asset.

State Conditions

The only difference is the relationship section.

Value Definition
Attribute The name of the attribute
Display Name Label of the attribute
Boolean/String/Number Choose the attribute’s data type. The rest of the fields will be based on the choice

Boolean

Value Definition
True Label Name of the ‘true’ field
False Label Name of the ‘true’ field
Suffix A suffix to make the rules created as downstream of this rule type user readable

String

Value Definition
Match Label Name of the ‘true’ field
No Match Label Name of the ‘true’ field
Attribute Value Give the attribute a value to match
Suffix A suffix to make the rules created as downstream of this rule type user readable

Number

See Relationship under ‘Proximity Occupancy”

Choose AND or OR to create more conditions. Make sure to click ‘Submit’ to save all changes before moving on. The rule types should appear in the table on the left. Click on the rule type name to edit it. Mark the checkbox(es) of the rule type and click ‘Delete Row’ to delete rule types.

How to Create a Rule?

A rule is one of the most important parts of this template. Rules allows users to manage and monitor Assets and Areas. Let us learn about rules through an example:

Requirement: A user needs to define a rule which sends the Manager a text message if the door of any asset of type gondola is left open (where 'isOpen' is an attribute custom to gondola asset type)

In order to create this rule, the user needs to perform the following before even starting to create a rule:

  • Create an action type of send_sms, as shown in the above section
  • Create an event type of door open and close and associate the above action type to it, as shown in the above section
  • Create a rule type to include the above events and select the condition of type State After performing the above tasks, the user can start creating a rule using the below information:
  • Select appropriate values for the condition(s) of the rule.
  • Select the appropriate event type and name the event. A new event will be created every time the rule is successfully executed. A rule is associated with an event-type and list of actions.
    • Note: This Closing Rule section will only show up if the selected event type has a life-cycle. In such a scenario the user has the ability to select the Closing Rule for the event.
  • Select the appropriate action type and name the action which will be created and bound to the specific event & rule, which are created.

    Testing the end-to-end workflow

  • Create a rule

  • The Rules Engine stream service must be ACTIVE. It waits on topic(s) depending on which entity is selected by the user during its creation, it can be a single asset, or a group of assets or a single area or a group of areas.

  • The Normalizer, custom for every use-case, must be ACTIVE. It processes every incoming message and publishes them on the rule’s topic, along with other topics.

  • The rule engine processes every published message which comes in and tests against every user created rules on them. Events & actions are created after the rules fire.

  • The action_history collection stores the state of the action, success or failure.

  • So for end-to-end testing, one can send a message on the topic which the normalizer listens on and then look for updates in the events page and actions page.