1. Help Center
  2. Guru Hub 2
  3. Commissioning & Troubleshooting

Config Script building

Information required before you start

Understanding a template for configuring a hub

Below is a template of a config file. We use the .json file type to configure the top units as the hubs understand what they are. A free notepad editor will be sufficient to edit the file. (Notepad++ is by far the most versatile). The config files entries are blank (identified by nulls or false), and through these attributes is where you need to identify what is being commissioned against a top unit. We will start by breaking down the various lines of the config file.
{

“config”: [

“set general font_controller ReportingInterval null”,

“set general font_controller ZigbeeAllowJoining true”,

“set general font_controller AwaitingConfiguration false”,

“set account1 font_account AccountActive true”,

“set account1 font_account PrimaryRelay 0”,

“set account1 font_account SecondaryRelay null”,

“set account1 font_account ShutOffMode 2”,

“set account1 font_account ReportingInterval null”,

“set account1 metering UnitOfMeasure 0”,

“set account1 metering MeteringDeviceType 5”,

“set account2 font_account AccountActive false”,

“set account3 font_account AccountActive false”,

“set account4 font_account AccountActive false”,

“set account5 font_account AccountActive false”,

“digimesh network (Ch) (Pan) (Link Key)”

“set account1 font_account Meter mbus/0”,

null],

“end” : []

}

General config file overview

The general overview of the config file is this:
Each line in the config file consists of a command identifier, a place where the command is set, the cluster and attribute where the value needs to be set.
For example:
“set general font_controller ReportingInterval null”,
Where “set” is telling the Hub to write the value. general is the place where the cluster exists, “font_controller” is one of the four sets of main clusters on the Hub and “reporting_interval” is the attribute inside that cluster. “Null” is the value to be set (normally a numeric value in this instance).

The lines explained

Line 3 “ReportingInterval”

  • This denotes how often you would like the hub to report ANALOGUE input to Guru Pay. This is normally set to “null” because this particular “RepotingInterval” is for analogue inputs only. Available options are null and numeric values of
    • “300”

    • ”1800”

    • ”3600”

    • ”7200”

    • ”14400”

    • ”21600”

Line 4 “ZigbeeAllowJoining” 

  • This option is to allow the Hub to let other Hubs use it as a pathway back to the gateway. Available options are
    • “True”
    • “False”
Line 5 “AwaitingConfiguration” 
  • This is a state that is shown on the screen if the account has not been configured, this should stay as “false”. Available options are
    • “True”
    • “False”
    Line 6 “AccountActive” 
  • This Should be set to “true” on any account you are wishing to configure. Available options are
    • “True”
    • “False”
  • Line 7 “PrimaryRelay”
  • This allows you to set the relay that the shut-off valve is connected to.
    • The physical relay on the Hubs are numbered 1, 2 and 3, however, the Commissioning app uses 0, 1 and 2.
    • So in this case relay, 1 is 0 on the app and so forth.
  • Line 8 “SecondaryRelay”
  • This line is to configure a second relay on the account you are commissioning. Please do not confuse this with the second utility account relay. There is no correlation. You will most commonly find this as “null”
  • Line 9 “ShutOffMode” This command will tell the hub how you want the valve to act when it has power. Most commonly this is set to “2” which is “Primary off enables”, The options are
    • “0” = “None”
    • “1” = “Primary on enables”
    • “2” = “Primary off enables”
    • “3” = “Dual pulsed on”
    • “4” = “Dual pulsed off”
  • Line 10 - “ReportingInterval” – This is normally set to “1800” as it is how often you would like the specific account being commissioned to send reports back to Guru Pay.
    • Please note this value is in seconds.
    • Available options are null and numeric values of “300”
      • ”1800”
      • ”3600”
      • ”7200”
      • ”14400”
      • ”21600”
  • Line 11 – “UnitOfMeasure” – This is the unit that the Meter sends through to the Hub. The options are
    • “0” = kW
    • “1” = m3/h
    • “2” = ft3/h
    • “3” = cdf/h
    • “4” = US gl/h
    • “5” = IMP gl/h
    • “6” = BTU/h
    • “7” = litres/h
    • “8” = kPa (gauge)
    • “9” = kPa (absolute)
    • “10”= mcf/h
    • “11”= none
    • “12”= mcf/h
    • “13”= MW
  • Line 12 – “MeteringDeviceType” – This specifies the meter type connected to the Mbus terminals, associated with the account you are commissioning. The options are
    • “0” = Electricity
    • “1” = Gas
    • “2” = Water
    • “3” = Thermal (Deprecated)
    • “4” = Pressure
    • “5” = Heat
    • “6” = Cooling
    • You will most of the time want 5 here.
  • Line 13 to 16 – “account(x) font_account AccountActive” -  These are the main account active lines if you are not configuring any further accounts on the hub then you can set all of these lines to “false” – The (x) is the account number. If you are configuring any further accounts, follow the same convention as below where (x) is the value required.
    • “set account(x) font_account AccountActive (x)“,
    • “set account(x) font_account PrimaryRelay (x)“,
    • “set account(x) font_account SecondaryRelay (x)“,
    • “set account(x) font_account ShutOffMode (x)“,
    • “set account(x) font_account ReportingInterval (x)“,
    • “set account(x) metering UnitOfMeasure (x)”,
    • “set account(x) metering MeteringDeviceType (x)”,
    • “set account(x) font_account Meter mbus/(x)“,
  • Line 17 – This line is slightly different to the others because it sets multiple values at the same time on the ZigBee network stack. See below for a breakdown:
    • “Digimeshnetwork 11 0xab2a  $0x8fa64882bad720a04ba3392d1519b”
      Image Placeholder
    • Each Preamble, Short PAN ID,  and encrypted link key is unique to every 868Mhz gateway.
  • Line 18 – “Meter mbus/X” – Where X is MBus address - This is where the MBus of the Heat meter is set. This is very useful if all MBus addresses are the same on every meter throughout the site. However, in some cases meters will only use the last two digits of their serial number. This line can be removed altogether if the latter is the case.
    • During the configuration file composition, you will need to make sure that each line starts with a “and ends with a “, as shown below:
      “set general font_controller ReportingInterval null”, 
    • If there are any other forms of punctuation in the lines, then the config file will fail.

Basic composition of a config file

In every case, a configuration file needs to be made up in the same way when it comes to formatting. As you can see there are parentheses used in many ways and when you open with a parenthesis you need to close in the same way at the exact opposite place in the script.
For example, all commands in the script are between
{ 

“config”: [

(COMMANDS INSERTED HERE)

null],

“end” : []

}
This MUST remain the same in every configuration if any of these identifiers are missing the config file will not run correctly.

How each line is built?

When we look at each line in the config file there is a certain format in which each line needs to be made. Below is a line from the config file that has been broken down to explain the order of the commands.
If we take each entry in a line as a tier, then things become straight forward.
Image Placeholder

Tier 1

This is the primary command required this will either be set or ZigBee.

Tier 2

This identifies whether you want to set a hub value, an account value, or a ZigBee value.

  • Available options are:
    • general
    • account1
    • account2
    • account3
    • account4
    • account5
    • network <- used with the Tier 1 command of ZigBee

Tier 3

This identifies the cluster that contains the attribute you want to change.

  • Available options are:
    • font_controller
    • font_account
    • metering

Tier 4

This is the attribute of the Tier 3 cluster.

  • Available options are:
    • ReportingInterval < used with font_controller
    • ZigbeeAllowJoining < used with font_controller
    • AwaitingConfiguration < used with font_controller
    • AccountActive < used with font_account
    • PrimaryRelay < used with font_account
    • SecondaryRelay < used with font_account
    • ShutOffMode < used with font_account
    • ReportingInterval < used with font_account
    • UnitOfMeasure < used with metering
    • MeteringDeviceType < used with metering
    • AccountActive < used with font_account
    • AccountActive < used with font_account
    • AccountActive < used with font_account
    • AccountActive < used with font_account
    • Meter < used with font_account