You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Summary

MongoDB Connector it is the component which is responsible for managing connection, sending, receiving messages from a Mongo database in a Niagara station.

Implementation

  1. Open the btibMongoDb palette.



  2. Drag and drop the MongoDbRTConnector to Services > Btib Service > External Connectors > Realtime Connectors folder.



  3. Double-click on the connector fill-in your connection information, then hit save.

 Properties

  • Status: Connector status
  • Fault Cause: The explanation in case of an issue with the connector.
  • Enabled: Enable/Disable the connector.
  • Last Attempt: Date time of the last connection attempt.
  • Last Success: Date time of the last successful attempt
  • Last Failure: Date time of the last failure attempt.
  • Auto Provision: Create and manage devices automatically.
  • Use Data Retention : Enable data retention for this connector.

  • Data Retention Duration : The amount of time which data will be persist and resent since..

  • Data Send Retry Duration : The amount of time to wait before retry sending data

  • Connection String: Mongo connection string.
  • Database Name: Name of the database.
  • Connection timeout: Number of milliseconds for mongo client to wait before giving up (increase this value if your jace has high connection latency).
  • Devices Collection: The collection where the device information/tags will be stored.
  • Points Collection: The collection where the point's data/tags will be stored.
  • References Collection: The collection where the point's data/tags will be stored.
  • External Messages Collection: The collection where the connector will listen for external event see Get Started with MongoDB and Niagara for more information on how it works.
    • This the document format that should be used to change a value in Niagara: 
      Message json object
          {
              deviceId:"<DeviceId>"
              pointId: "<PointId>",
      		type: "<MessageType>" // POINT_ACTION, SEND_HISTORIES
              payload:{
                  action: "<PointAction>",
                  value: <Value>
              }
          }
        • <DeviceId>: the device id in which the point is associated
        • <PointId>: the id of the point where the action will executed
        • <MessageType>: The type of the message. ex: Point_ACTION, SEND_HISTORIES
        • <PointAction>: the point action ex: SET,AUTO,EMERGENCY, AUTO_EMERGENCY, OVERRIDE
        • <Value>: the point value it should match the point type (Bool point value = true/false)

      An ACK field will be added to the document once the message has been received by the connector, but it doesn't mean that the value has been applied to the point level. If the value is correctly applied, then you should see the change in the point's collection. This is how we avoid loops and how we are certain that the value was correctly applied to the field.

  • Native Timestamp: Parse the timestamp to mongo ISO date.
  • Timestamp Field: Timestamp field name in the message.


 Advanced Config

  • Device Tags Destination: The destination where device tags will be sent during the initialization.
  • Point Tags Destination: The destination where point tags will be sent during the initialization.
  • Point Status Destination: The destination where the point status message will be sent.
  • Point Value Destination: The destination where the point value message will be sent.
  • Reference Destination: The destination where the reference message will be sent.
  • Alarm Destination: The destination where the alarm messages will be sent via the alarm recipient associated to this connector.
  • Default Variables: The default variables to be used by the messages template.
  • Custom Variables: Set of user defined variables to be used by the messages template.
  • Point Status Message Template: The status message template used to construct the message to be sent by the connector.
  • Point Value Message Template: The value message template used to construct the message to be sent by the connector.
  • Commands Policy: The commands policy either single or multi message.
  • Message Type: The type of the message (Default: POINT_ACTION).
  • Command Set Object: The json format that contains the commands if the command policy is multi message.
  • Command Device Id: The sformat path to extract the device id from the external  message.
  • Command Point Id: The sformat path to extract the point id from the external  message.
  • Command Action: The sformat path to extract the command action from the external  message.
  • Command Value: The sformat path to extract the value from the external  message.
  • Command Duration: The sformat path to extract the command duration in seconds from the external  message.
  • Start Date: Start timestamp of the history (Optional).
  • End Date: the end date for the history (Optional).
  • Delta: Apply delta for the history (Default: false).
  • History Message Variable: Set of predefined variables to use in the history message template.
  • History Message Template: The template message to use for the history message.
  • Invalid Value Policy: What to do when an invalid value detected.
  • Json Message Policy: The policy to use for value that contains json text


Actions

  • Ping : Ping the mongodb cluster.


Fault Causes

  • Unable to connect : verify the your connection parameter (Hostname, port ...), you can try to ping.