Previous Topic

Next Topic

Book Contents

Book Index

Setting Initial Configuration

 

To use the JSON config filter functionality, set the adapter configuration property deviceFilterConfigFileLocation to point to the location of the JSON config file. If the property is not set or the file is not valid, empty or not provided, filtering will be applied according the default JSON file from the bundle data storage. If the default file is empty, no filtering will be applied.

If the path to the JSON config file is wrong, or its format is not valid, the ERROR or WARNING messages will be logged and the adapter will continue working as it is, without filtering. If the structure or the data of a device template is not valid, it will be skipped and the next device template will be processed. During runtime, the matching will be performed only against the list of successfully parsed device templates.

 

Example of JSON Configuration for BACnet Devices

The following JSON array example represents three device templates of BACnet devices:

  

[

    {

        "deviceRanges": [ "901001-901003", "901006-901008", "901016-901021" ],

        "objects": {

            "analog-value": {

                "instances": [ 101 ]

            }

        }

    },

    {

        "devices": [ 901004, 901005 ],

        "deviceRanges": [ "901009-901015" ],

        "objects": {

            "analog-value": {

                "instances": [ 101, 102, 108 ]

            }

        }

    },

    {

        "devices": [ 901065 ],

        "objects": {

            "analog-input": {

                "instances": [ 0, 1, 2, 4, 7 ]

            },

            "binary-input": {

                "instances": [ 6, 8 ]

            }

        }

    }

]

Each element of the JSON array identifies a device template with two parts: device identification and device representation:

Device identification

The following elements define the set of devices that follow the template:

Previous implementations, prior to BACnet module version 1.3.0 and Edge services 10.3.0, allowed the device ranges to be an optional element of type array of inner arrays with exactly two integer numbers:
   •   The first number in the inner array denoted the low limit of the device instance range.
   •   The second number denoted the high limit of the rage and was not less than the first number.
This old formatting is still supported for backward compatibility.

Even though devices and deviceRanges elements are defined both as optional, it is mandatory that at least one of them is present.
When both elements are present, they shall be used as union.

Device representation

A device is represented by the optional JSON element objects. It specifies the objects of the BACnet devices that shall be processed by the BACnet adapter. If the element is missing, then all BACnet objects of the target devices are to be processed. Each key within the objects JSON object denotes a BACnet object type, e.g. analog-value, analog-input, binary-input, etc. Each value is another JSON object with the following data:

Previous implementations, prior to BACnet module version 1.3.0 and Edge services 10.3.0, allowed:
   •   the value of each key inside objects to be an array of int number, each number denoted an object instance ID of the corresponding object type.
   •   If the array was empty, all BACnet objects of the given type were to be processed by the adapter.
This old formatting is still supported for backward compatibility.

Only BACnet objects of types used as keys within the objects element are to be processed by the adapter.

If a device matches several device template entries in the JSON configuration, the first one that matches has top priority.