Configuration

When you edit a configuration settings, do not forget to save it before a reboot.

Config.Get

Get the device’s persistant configuration.

Argument

Optional. Path to configuration sub object.

Example

{
    "key": "<sub object path>"
}

For mqtt.server configuration:

{
    "key": "mqtt.server"
}

Config.Set

Edit the current configuration in use (runtime).

Warning

Configuration that is set with the RPC will be erased on next reboot. Save it before you reboot the device.

Argument

{
    "config": {
        "<attribute>": {
            "<subattribute>": "<value>"
        }
    }
}

Warning

First attribute “config” is required.

Example

This example override mqtt server configuration:

{
    "config": {
        "mqtt": {
            "server": "my-broker.test.ch"
        }
    }
}

Config.Save

Save current device configuration in use (runtime) to the persistent storage. This configuration will be reuse on next reboot. Previous configuration will be lost.

Arguments

Optional argument to specify if device has to reboot after saving new configuration. Do not reboot by default.

{
    "reboot": false
}