Skip to content

Configuration

José Antonio Jiménez Campos edited this page Jul 14, 2023 · 19 revisions

To configure your device, it is necessary to declare all functions using a MEPLHAA script.

MEPLHAA, Marvelous Esoteric Programming Language for Home Accessory Architect: is a declarative script language that uses JSON syntax to setup and configure all information about accessories, GPIOs, buttons, relays, sensors, LEDs... that device will use, and how. Data is in "key":value pairs, and they are separated by commas. Curly braces {...} hold objects and square brackets [...] hold arrays.

The MEPLHAA script has two sections:

Section Key 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

MEPLHAA Layout

The MEPLHAA script 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.

MEPLHAA script 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 MEPLHAA script 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

Also, you can use the deprecated tool Maximilian Beck developed:

MEPLHAA Configurator Tool (Deprecated)

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

Clone this wiki locally