Appendices
Appendix A: JsonToolkit Fields
Field
Description
Output
Configuration Properties / Actions
enabled - prevents generation of output, execution of queries and subscription to bound values, when false
generateJson - an action to request a rebuild and update of schema output. For relative schemas this causes the Base Query to be evaluated and the results published.
forceGenerateJson - as per generateJson but forces the action regardless of current tuning settings.
clearCache - discards the last known values of bindings and cached query results.
clearOutput - sets the schema output to an empty string.
executeQueries - force an immediate execution of all the schemas queries.
Enabled
True – produce schema
False – stop schema
Status
Should state {ok} when operating correctly
Fault Cause
Should be empty
Last Updated
Timestamp of last schema cycle
Config
Name Casing Rule
Use camelCaseKey
Name Spacing Rule
Remove spaces
Date Format Pattern
Date Format Pattern allows use of a Java SimpleDataFormat Pattern to define the time formatting used when a Niagara AbsTime is encountered in by Schema. e.g from a History Query, or the Current Time Property. ISO 8601 for example is yyyy-MM-dd HH:mm:ss.SSSZ.
Numeric precision
Use 4 mostly for power meters
Numeric Precision is the number of decimal digits to show on exported floating point numbers, values will be rounded. Point facets are not used.
Use Escape Characters
when false any escape chars encountered will be unescaped - eg $20 will become a “ ” or space character.
Tuning Policy
Update Strategy: determines when json string generation occurs:\ - On Demand - Update output when the generateJson action is invoked, this could be linked to a timer or other station logic.\ - COV - updates output when any binding target changes value, using subscription. Latest known values are cached and changes will cause the schema output to be updated.
There is an in built min write time to ensure that hundreds of concurrent cov changes over a short time do not result in a deluge of json messages. For example with a setting of 5 seconds, if a change of value occurs within 5 seconds of the last, schema generation is deferred for 5 seconds. However if the max write time has been exceeded then the schema generation is forced. Note the Force Generate Json action overrides all these settings. Export Markers applied to numeric points also have a CoV Tolerance property which can be used to throttle output. The write on start and write on enabled properties are other ways to force schema generation.
Min Write Time
Max Write Time
Write on Start
Write on Enabled
Update Strategy
Overrides
This folder is where a Type Override component can be added to the schema, should it be necessary to override the default behaviour of how the schema writes converts specific datatypes to JSON. These apply to anywhere the datatype is encountered for an entire schema. Examples might be where Facets should be replaced to a locally understood value, eg ‘degC’ to ‘Celsius’, defining a different format for Simple types such as Color/RelTime, or perhaps to manage expectations for +/- INF in a target platform.
Refer to Type Override in the developer guide for further information.
Debug
Used to review the recent history of output from a json schema. Useful for occasions where the output updates rapidly such as generate json called in quick succession by a link, or a relative schema where the output is changed once per base item very quickly.
Either hit the Output History button on a schema in workbench, or right click on the Schema History Debug slot and select ‘Spy Remote’.
The History Size allows you to store more but be careful not to fill memory with json strings. Reduce this value once you have finished debugging.
Schema Output History Debug
Enabled
History Max Size
Metrics
Exposes Schema generation, query execution and COV subscription metrics. These could be logged or linked to generate alarms if needed.
These are anticipated to help with sizing / provisioning capacity from a cloud platform by estimating the traffic a station is likely to generate with a given Json Schema. They may also assist in identifying performance problems, debugging can be assisted by using the reset action.
Queries
Generation
Subscription
queryFolderExecutions
requestSchemaGenerations
subscribes
individualQueryExecutions
schemaGenerations
unsubscribes
queryFails
schemaGenerationFails
subscriptionEvents
lastQueryFailReason
lastSchemaGenerationFailReason
subscriptionEventsIgnored
lastQueryExecutionMillis
outputChanges
cacheHits
queryExecutionMillisTotal
lastOutputSize
cacheMisses
queryExecutionMillisMax
outputSizeTotal
queryExecutionMillisAvg
outputSizeMax
outputSizeAvg
resolveErrors
Queries
Publish Interval
Last Query Completed Timestamp
Base Query
Base Query Examples
This base query would return all the overridden points beneath the Drivers container:
slot:/Drivers|bql:select * from control:ControlPoint where status.overridden = 'true'
This query returns all points with the Haystack Marker Tag hvac
slot:/|neql:n:point and hs:hvac
Note: The base query publish interval causes the base query to be re-executed periodically and triggers a complete publish output (of every returned component) at the interval selected.
Note: The generateJson action may also be invoked on the Schema to cause the base query to be (re-)evaluated.
Warning: Be sure that the schema output itself is not included in the base query - this will quickly consume available Java heap memory!
Status
Fault Cause
Base Query
Publish Interval
Last Publish Count
Last Publish Time
{ } root
{ } $schema
String Value
{ } siteName
String Value
{ } buildingName
String Value
{ } point
{ } pointName
Binding
Binding Configuration
About Binding
Bound Properties, Objects and Arrays are json entities which can use the current values of an Ord target to render their values. The Fixed variants do not support binding.
Slot Selection
When picking a bound object/array, you may choose which slots from the target to include in the resultant json container. Currently the options are:
All slots
All visible slots - (hidden excluded)
Summary slots – only those with summary flag
Selected slots – manually pick the slots to include from a list
Target types
Note that when choosing the bind target for a binding you could select any type of slot, from Devices to Control Points to out slots to simple values, there is no restriction.
Bound Arrays/Objects will output the value of each of the selected slots - see Slot Selection. The default behaviour for each encountered slot type is as follows:
Note: bound objects/arrays do not recurse, only direct child slots are included.
Note: the above behavior has made a few assumptions about most expected case for example excluding the status string from certain types. All this behaviour may be overridden by program overrides.
Selection
Output
Strings
The string value unchanged
Booleans
A json boolean
Integer/Long
A json number
Double/Float decimals
AQ json number rounded to use the schemas decimal places config
Enum value
A json string that represent the enum value
AbsTime
A string representation of the date foratted as per the schema config
Control Point
A json string/number/boolean to represent the out slots value
Status Value
A json string/number/boolean to represent the value
Status
A json string to represent the value e.g {ok}
Anything else
The string representation of the value as returned from the framework. This is often the type display name
Tag Id
Naming
For binding results you may choose what the key is in the key/value pair:
Hint: A Tag Property with n:name may be used to include point names.
Selection
Output
Display Name
The Display Name of the Bound Property/Object/Array
Target Name
The name of the ord target
Target Display Name
The display name of the ord target
Target Parent Name
The name of the ord targets parent
Target Path
The absolute path of the target from the root of the component tree
Search Parents
Timestamp
{*} currentValue
Binding
Json Name Source
{*} status
Binding
Json Name Source
{ } parentName
Binding
Tag Id
Search Parents
{ } facets
Facet Property
Allows a single Facet value from a bound component to be inserted in the Schema output, for example the units of the current point.
Facet List
Inserts a list of name/value facet properties based upon a comma separated list or * for all. Facet keys should be added as follows: units,mix,max
{*} facets
Binding
Facet Csv List
Write Empty Strings for Missing Facets
{ } modbusProperties
{*} absoluteAddress
Binding
Tag Id
{ } tags
Tag List
A list of name/value properties based upon selected tags found upon a binding target.
A comma separated list specified in the Tag Id List Filter can limit the tags to be included in the output. Example: n:name,n:type or * for all. If include namespace is true then the tag dictionary prefix is added to the key (eg hs:hvac).
{*} TagList
Binding
Dictionary Namespace Filter
Tag Id List Filter
Include Name Space
Appendix B: Example Jace Json Configurations
Modbus Setup – Taken from EMS_2470Newcastle_EMSJ01
Field
Entry
Output
N/A
Enabled
True
Status
{ok}
Fault Cause
Last Updated
18-Sep-2020 01:52 PM AEST
Config
Json Schema Config Folder
Name Casing Rule
Camel
Name Spacing Rule
Remove
Date Format Pattern
yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Numeric precision
4
Use Escape Characters
false
Tuning Policy
Json Schema Tuning Policy
Min Write Time
0000h 00m 00s
Max Write Time
0000h 00m 00s
Write on Start
false
Write on Enabled
false
Update Strategy
COV
Overrides
Json Schema Override Folder
Debug
Json Schema Debug Folder
Schema Output History Debug
Schema History Debug
Enabled
true
History Max Size
50
Metrics
Json Schema Metrics
Queries
Json Schema Query Folder
Publish Interval
0000h 00m 00s
Last Query Completed Timestamp
07-Feb-2020 09:39 PM AEST
Base Query
Base Query
Status
{ok}
Fault Cause
Base Query
station:|slot:/Drivers|bql:select * from control:ControlPoint where (proxyExt.type != abstractMqttDriver:MqttStringObjectPublishExt and type != kitControl:Add and type != kitControl:Multiply)
Publish Interval
0024h 00m 00s
Last Publish Count
818
Last Publish Time
07-Sep-2020 09:42 AM AEST
{ } root
Json Schema Object
{ } $schema
Json Schema String Property
String Value
http://csiro.au/dch/bms-json/schema-draft-04.json
{ } siteName
Json Schema String Property
String Value
Newcastle
{ } buildingName
Json Schema String Property
String Value
NewcastleEnergyCentreB001
{ } point
Json Schema Object
{ } pointName
Json Schema Tag Property
Binding
slot:..
Tag Id
n:name
Search Parents
false
Timestamp
Json Schema Current Time Property
{*} currentValue
Json Schema Bound Property
Binding
slot:out/value
Json Name Source
Display Name
{*} status
Json Schema Bound Property
Binding
slot:out/status
Json Name Source
Display Name
{ } parentName
Json Schema Tag Property
Binding
slot:..
Tag Id
n:name
Search Parents
false
{ } facets
Json Schema Object
{*} facets
Json Schema Facet List
Binding
slot:
Facet Csv List
units
Write Empty Strings for Missing Facets
false
{ } modbusProperties
Json Schema Object
{*} absoluteAddress
Json Schema Bound Property
Binding
slot:proxyExt/absoluteAddress
Tag Id
Display Name
{ } tags
Json Schema Object
{*} TagList
Json Schema Tag List
Binding
slot:
Dictionary Namespace Filter
Haystack
Tag Id List Filter
*
Include Name Space
true
BACnet Setup – Taken from DCH_1020BlackMountain_JACE01
Field
Entry
Output
N/A
Enabled
True
Status
{ok}
Fault Cause
Last Updated
18-Sep-2020 01:52 PM AEST
Config
Json Schema Config Folder
Name Casing Rule
Camel
Name Spacing Rule
Remove
Date Format Pattern
yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Numeric precision
4
Use Escape Characters
false
Tuning Policy
Json Schema Tuning Policy
Min Write Time
0000h 00m 00s
Max Write Time
0000h 00m 00s
Write on Start
false
Write on Enabled
false
Update Strategy
COV
Overrides
Json Schema Override Folder
Debug
Json Schema Debug Folder
Schema Output History Debug
Schema History Debug
Enabled
true
History Max Size
50
Metrics
Json Schema Metrics
Queries
Json Schema Query Folder
Publish Interval
0000h 00m 00s
Last Query Completed Timestamp
24-Feb-2020 09:39 PM AEDT
Base Query
Base Query
Status
{ok}
Fault Cause
Base Query
station:|slot:/Drivers/BacnetNetwork|bql:select * from control:ControlPoint
Publish Interval
0024h 00m 00s
Last Publish Count
9759
Last Publish Time
26-Aug-2020 2:04 PM AEST
{ } root
Json Schema Object
{ } $schema
Json Schema String Property
String Value
http://csiro.au/dch/bms-json/schema-draft-04.json
{ } siteName
Json Schema String Property
String Value
Black Mountain
{ } buildingName
Json Schema String Property
String Value
SynergyB801
{ } point
Json Schema Object
{ } pointName
Json Schema Tag Property
Binding
slot:..
Tag Id
n:displayName
Search Parents
false
Timestamp
Json Schema Current Time Property
{*} currentValue
Json Schema Bound Property
Binding
slot:out/value
Json Name Source
Display Name
{*} status
Json Schema Bound Property
Binding
slot:out/status
Json Name Source
Display Name
{ } parentName
Json Schema Tag Property
Binding
slot:..
Tag Id
n:name
Search Parents
false
{ } facets
Json Schema Object
{*} facets
Json Schema Facet List
Binding
slot:
Facet Csv List
units
Write Empty Strings for Missing Facets
false
{ } bacnetProperties
Json Schema Object
{*} objectId
Json Schema Bound Property
Binding
slot:proxyExt/objectId
Json Name Source
Display Name
{ } tags
Json Schema Object
{*} TagList
Json Schema Tag List
Binding
slot:
Dictionary Namespace Filter
Haystack
Tag Id List Filter
*
Include Name Space
true
BACnet Setup – Taken from DCH_2470Newcastle_JACE01
Field
Entry
Output
N/A
Enabled
True
Status
{ok}
Fault Cause
Last Updated
18-Sep-2020 02:20 PM AEST
Config
Json Schema Config Folder
Name Casing Rule
Camel
Name Spacing Rule
Remove
Date Format Pattern
yyyy-MM-dd'T'HH:mm:ss.SSSXXX
Numeric precision
4
Use Escape Characters
false
Tuning Policy
Json Schema Tuning Policy
Min Write Time
0000h 00m 00s
Max Write Time
0000h 00m 00s
Write on Start
false
Write on Enabled
false
Update Strategy
Changed from On Demand to COV 2:20pm 18/09/2020 AEST
Overrides
Json Schema Override Folder
Debug
Json Schema Debug Folder
Schema Output History Debug
Schema History Debug
Enabled
true
History Max Size
50
Metrics
Json Schema Metrics
Queries
Json Schema Query Folder
Publish Interval
0000h 00m 00s
Last Query Completed Timestamp
24-Feb-2020 09:39 PM AEDT
Base Query
Base Query
Status
{ok}
Fault Cause
Base Query
station:|slot:/Drivers/BacnetNetwork|bql:select * from control:ControlPoint
Publish Interval
0024h 00m 00s
Last Publish Count
4708
Last Publish Time
18-Sep-2020 2:21 PM AEST
{ } root
Json Schema Object
{ } $schema
Json Schema String Property
String Value
http://csiro.au/dch/bms-json/schema-draft-04.json
{ } siteName
Json Schema String Property
String Value
Newcastle
{ } buildingName
Json Schema String Property
String Value
NewcastleEnergyCentreB001
{ } point
Json Schema Object
{ } pointName
Json Schema Tag Property
Binding
slot:
Tag Id
n:displayName
Search Parents
false
Timestamp
Json Schema Current Time Property
{*} currentValue
Json Schema Bound Property
Binding
slot:out/value
Json Name Source
Display Name
{*} status
Json Schema Bound Property
Binding
slot:out/status
Json Name Source
Display Name
{ } parentName
Json Schema Tag Property
Binding
slot:..
Tag Id
n:name
Search Parents
false
{ } facets
Json Schema Object
{*} facets
Json Schema Facet List
Binding
slot:
Facet Csv List
units
Write Empty Strings for Missing Facets
false
{ } bacnetProperties
Json Schema Object
{*} objectId
Json Schema Bound Property
Binding
slot:proxyExt/objectId
Json Name Source
Display Name
{ } tags
Json Schema Object
{*} TagList
Json Schema Tag List
Binding
slot:
Dictionary Namespace Filter
Haystack
Tag Id List Filter
*
Include Name Space
true
Last updated