Configuration

Configuration screen

The configuration screen has two sections. Each section is updated individually. By configuring the MQTT section before the WiFi section, the device will be able to connect to the MQTT broker immediately after it connects to the WiFi network. If the WiFi section is done first, you will then have to figure out which IP address it received from the DHCP server to be able to configure the MQTT settings.

Wifi parameters

These are the parameters to connect to the WiFi network. The hostname will be included in the DHCP request. If the name is unique on the network and the DHCP server is integrated with the DNS, you may be able to find the device using this name. Alternatively, the device may be reachable via http://hostname.local/. The hostname also affects the MQTT topics the device listens for. See the automation API for more information.

MQTT parameters

Most of the MQTT parameters should be self-explanatory. The Client ID is used to register with the MQTT broker and must be unique. Otherwise a battle over owning the name will start, resulting in unreliable service. Normally the Retain box should not be checked, as the messages produced by the device are only useful at the moment they are generated.

Last will and testament

Using the last will and testament settings will be very helpful for other MQTT clients to know when the device is online. The device sends the Online message when it connects to the broker. It instructs the broker to send the Offline message on its behalf when the connection is lost. The payload for both messages is exactly as specified. So if you want these messages to contain a JSON object, the full JSON object has to be entered in the entry field. The Will retain box should normally be checked as the online state remains valid until it is changed by a new message.