Linksper can enable a full synchronization with a MongoDB database. MongoDB is a database environment used to build applications on top. It can be hosted locally along with the BOS but also in the Cloud making it easy to provide a Cloud gateway to access BOS data.

The synchronization is 100% handled by the BOS from the Console app.


Collection organization

MongoDb is a database composed of collections, each collection containing documents. You can see a document as a file stored in folders (simplified vision (wink) ). Each document sores information using a JSON format.

Linksper dedicates one collection to store all the assets except the Data assets. They are subdivided for each data type (Points, Schedules, Alarms, References) into their own collection. This is meant to allow you to subscribe more easily to a certain type of data.

We also have a collection dedicated to send commands to the BOS.



Document content

Each document is basically a JSON file. We need to differentiate three types of document:

  • Document from the Assets collection, they contain:
    • An id field to uniquely identify the document. These id will come from the BOS and match internal asset id in the BOS: Device asset, Equipment asset, Model asset...
    • A tags object, containing all the information about the asset. We will use it intensively to query assets.
  • Document from the Points/Schedules/References collections, they contain:
    • An id field to uniquely identify the document. These id match the respective Data asset id in the BOS.
    • A deviceId field to associate the Data asset to a container such as a Device asset, Equipment asset, Model asset. The deviceId value will always match one of these assets. (There is no link at all with the concept of "device")
    • A tags object, containing all the information about the Data asset. We will use it intensively as well.
    • A status field indicating the live Linksper statuses from the BOS. You can subscribe to it to receive real-time changes.
    • A value field indicating the live value from the BOS. You can subscribe to it to receive real-time changes.
    • A timestamp field indicating the latest update
  • Document from the alarms collection
    • An id field to uniquely identify the document. Not so much used.
    • An uuid field This is is the alarm event uuid from the BOS. See Linksper DataType. Better to use this unique identifier.
    • A sourceId field. This the Data point identifier which the alarm is coming from.
    • A alarmTransition field. See Alarm data type for more information.
    • Many fields including tags information.



Synchronization mechanisms

Static information exchange

On the initialisation phase, the BOS will create a document per shared asset. This applies for:

One document per asset is created. Each document contains several fields. Each field is a metadata, a tag on the asset.

Learn in depth about Static information exchange.

Real-time exchange

The following types of Data assets are exchanged:

  • Points
  • Schedules
  • Alarms


Learn in depth about Real-time data exchange


Commands

A third party can request the BOS to change a value (examples: switch-on a light or change a setpoint)


Learn in depth about Send commands to the BOS


Historical Data exchange

Historical data are produced at the BOS level. They are standardized with a 10 min interval for regular data points (temperature, energy...) and on change for event based data points (presence, door state..).



Examples