Skip to content

Understanding CONFIG.YML

rhamblen edited this page Nov 24, 2019 · 3 revisions

config.yml

---
# Port number to listen on
port: 8080

#Default (info) - error, warn, info, verbose, debug, silly
loglevel: "info"
        
#is there an external device config file: true, false
deviceconfig: true

mqtt:
    # Specify your MQTT Broker URL here
    host: mqtt://localhost
    # Example from CloudMQTT
    # host: mqtt:///m10.cloudmqtt.com:19427

    # Preface for the topics $PREFACE/$DEVICE_NAME/$PROPERTY
    preface: smartthings

    # The write and read suffixes need to be different to be able to differentiate when state comes from SmartThings or when its coming from the physical device/application

    # Suffix for the topics that receive state from SmartThings $PREFACE/$DEVICE_NAME/$PROPERTY/$STATE_READ_SUFFIX
    # Your physical device or application should subscribe to this topic to get updated status from SmartThings
    # state_read_suffix: state

    # Suffix for the topics to send state back to SmartThings $PREFACE/$DEVICE_NAME/$PROPERTY/$STATE_WRITE_SUFFIX
    # your physical device or application should write to this topic to update the state of SmartThings devices that support setStatus
    # state_write_suffix: set_state

    # Suffix for the command topics $PREFACE/$DEVICE_NAME/$PROPERTY/$COMMAND_SUFFIX
    # command_suffix: cmd

    # Other optional settings from https://www.npmjs.com/package/mqtt#mqttclientstreambuilder-options
    # username: AzureDiamond
    # password: hunter2

    # MQTT retains state changes be default, retain mode can be disabled:
    # retain: false


keywords

port number: this is the port number used to communicate with the smartthings hub. This must match the setting in the **MQTT Bridge **device created in smartthings.

host: this is the address of the MQTT broker. If you used mosquitto, it will be the IP address where mosquitto is running. NOTE: the prefix has mqtt:// and the port is included.

username/password: if you set up your MQTT bridge with a user name and password, for sending MQTT messages, this needs to be entered here. NOTE both are case sensitive.

loglevel: outputs to the log file with various detail based upon the setting

deviceconfig: is true or false; it tells smarththings-mqtt-broker to use the devices.yml file