Local Settings

Introduction

The Edge server may be configured by editing the localsettings.json file in /projects/droplit-edge. Settings include things such as the ecosystem the server is targeting, and which plugins to enable. The settings are organized in a JSON object with a standard structure.

Default JSON Settings Object

{
    "transport": {
        "host": "wss://edge-ws.droplit.io/edge"
    },
    "ecosystemId": "INSERT_YOUR_ECOSYSTEMID_HERE",
    "plugins": {
        "droplit-plugin-philips-hue": {
            "enabled": true
        },
        "droplit-plugin-lifx": {
            "enabled": true
        },
        "droplit-plugin-sonos": {
            "enabled": true
        },
        "droplit-plugin-wemo": {
            "enabled": true
        },
        "droplit-plugin-neopixel": {
            "enabled": false,
            "settings": {
                "numLeds": 1
            }
        }
    },
    "debug": {
        "generateHeapDump": false
    },
    "diagnostics": {
        "enabled": false,
        "port": 8888
    },
    "config": {
        "provisioningServiceEnabled": false,
        "provisioningServicePort": null,
        "MACAddressOverride": null
    }
}

Setting Definitions

ecosystemId

The ecosystem that the Edge server is connected to. This should be the raw ID, not an alias.

transport

An object used to configure options related to web socket transport.

host

Specifies the host address of the web socket server the Edge targets. The host address for the release server is wss://edge-ws.droplit.io.

enableHeartbeat

Whether to use a heartbeat with the configured web socket server. The value is a boolean, true by default. This is intended for use in debugging only and not expected for normal usage.

plugins

Configuration for the individual plugins used by the Edge server. There are two different possible syntaxes to specify the structure of this value.

The first way to specify the plugin configuration is to treat every plugin as a separate pair in an object. The configuration is specified using a key-value pair, where the key is the plugin name, and the value is an object containing the configuration for the individual settings. This object should always contain an 'enabled' key, which has a boolean value denoting whether the plugin is enabled. It may also, depending on the plugin, contain other unique key-value pairs.

{
    "plugins": {
        "droplit-plugin-philips-hue": {
            "enabled": true
        },
        "droplit-plugin-lifx": {
            "enabled": true
        },
        "droplit-plugin-wemo": {
            "enabled": false
        }
    }
}

The second way to specify the plugin configuration is to use an array. This may be simpler when a number of plugins are enabled simply using the default settings and must all be enabled. Distinct plugins can still be enabled as objects with unique settings, if desired. The previous example would translate to the following in this syntax.

{
    "plugins": [
        "droplit-plugin-philips-hue",
        "droplit-plugin-lifx",
        {
            "name": "droplit-plugin-wemo",
            "enabled": false
        }
    ]
}

name

The name of a plugin, only used with the array syntax of the plugins configuration.

enabled

Whether plugins are enabled, using a boolean value. Included pugins are enabled by default.

localServices

Configures the local services that a specific plugin is to subscribe to. The value is an array of strings representing the service names.

promotedMembers

A mapping between a custom promotion name and local service member.

debug

An object used to configure options related to debugging the Edge server. None of the contained keys are expected to be enabled for normal usage.

generateHeapDump

Configures whether a heap dump is generated on a timed interval (every half hour) using a boolean value. The value is false by default.