Configuration

The config.json file is in the json format and currently includes four sections:

{
  "settings": { ... },
  "plugins": [ ... ],
  "devices": [ ... ],
  "rules": [ ... ]
}

The settings section

The settings section contains the configuration for the HTTP and HTTPS server. You have to set the username and password property for the authentication or disable it with setting enabled to false. In the default config just the HTTP server is enabled and configured to run on port 80.

See the config-schema for more details and all configuration options.

The plugins section

In the plugins section you have to list all plugins to load in the form of

{
  "plugin": "plugin-name"
}

where plugin-name ist the name and directory of the plugin you want to load. All plugins are installed in the node_modules directory and prefixed withpimatic-.

The devices section

The devices section should contain all devices, you want to have registered in the framework. An actuator is typically provided by a plugin, so take a look at the desired plugin for more details about the configuration of your devices. A device configuration has the form

{
  "id": "light",
  "class": "SomeSwitch",
  "name": "Light in the kitchen",
  ...
}

where the id property should be unique, the name property should be a human readable description and the class property determines the plugin and type of the device.

The rules section

The rules section can contain a list of rules in the form of:

{
  "id": "printerOff",
  "rule":  "when its 6pm then turn the printer off"
}

where id should be a unique string and rule a string of the form "when ... then ...".