Skip to content

Configuration

David Dix edited this page Dec 16, 2019 · 19 revisions

To configure your device, it is necessary to create a JSON string that contains all information about accessories, GPIOs, buttons, relays, sensors, LEDs, displays...

The JSON data has two sections:

Section Name Description
Config "c" Section containing all the objects & name / value pairs for configuration of the device
Accessories "a" Section containing all the accessory objects controlled by the device

JSON Layout

The JSON configuration is made of up two distinct sections:

{
  "c": {
    // Configuration options
  },
  "a": [
    // Accessories
  ]
}

Refer to the Config and Accessories for details on the options available for each of these sections.

JSON can be written in multiple lines, but it is highly recommended to use only a single line because it will result in a smaller in size and use less device memory.

NOTE: If you make changes in your JSON that involve accessory types, number of used accessories or change the order of them, you must check Reset HomeKit ID from within setup mode and remove your device from HomeKit; and then you must pair it again.

See here some examples and templates

TODO: Add a full Examples section to the Wiki

Also, you can use the tool Maximilian Beck is developing:

JSON Configurator Tool (Beta)

Not all keys are mandatories, and default values will be applied when optional keys are not present. You can use a JSON validator to check your string.

TODO: Add a seperate section on configuration tools

Clone this wiki locally