MQTT Interface Description

for HAUS Gatekeeper Home Premium

MQTT auto-published metrics

These metrics are published by Gatekeeper without querying them. These are published regularly (temperature is published ~once a minute) or on-change as retained values, which means, you'll always see the last known values for these metrics.

Device status

MQTT topic

Possible values

Explanation

<devicename>/status

offline

Device is offline, published by MQTT broker as the last will message set by the device.


online

Device is online.


online, upgrading

Firmware upgrade (initiated via MQTT) is in progress.


online, upgrade failed

Firmware upgrade (initiated via MQTT) failed (e.g. could not fetch binary from URI), device remains functional with firmware unchanged.


online, upgraded

Firmware upgrade (initiated via MQTT) completed successfully (in practice it is never shown as the device resets itself automatically after a successful upgrade).

Ambient temperature

MQTT topic

Possible values

Explanation

<devicename>/temperature

<value measured by the connected temperature sensor in °C>

The device is able to handle several sensors, chained on the OneWire bus, however currently only one sensor is supported. In this topic the value of the sensor with index #0 is published.



Light status (controlled by the bi-stable relay)

MQTT topic

Possible values

Explanation

<devicename>/light

on

Light is on.


off

Light is off.


auto

Light is on and going to be turned off by ALC, when the active timer counts down.

Gate status (if gate sensor is installed)

MQTT topic

Possible values

Explanation

<devicename>/gate/state

open

Gate is open.


closed

Gate is closed.


moving

Not implemented, yet.

Doorbell (if doorbell button is installed)

MQTT topic

Possible values

Explanation

<devicename>/doorbell

<random integer>

A random event ID to be processed by the doorbell client (part of the upcoming mobile app).

MQTT commands

Gatekeeper can be controlled by publishing commands in a <devicename>/command/… MQTT topic.

Most of the commands are silently executed, but some of them respond in an MQTT topic as mentioned in Explanation column.

Switching the light (controlled by the Latching Relay)

MQTT topic

Possible values

Explanation

<devicename>/command/light

on

Turn light on.


off

Turn light off.


auto

Turn light on for a certain time, controlled by the value of AutoLightControl Timer 2.

Opening the gate (controlled by Relay 1)

MQTT topic

Possible values

Explanation

<devicename>/command/gate

trigger+<device master password>

Triggering the gate by activating the momentary Relay 1 for a short time.


open+<device master password>

Opening the gate, if closed and no concurrent open or close command.


close+<device master password>

Closing the gate, if open and no concurrent open or close command.


cancel+<device master password>

Cancel OwnTracks region event triggered automatic gate opening (within 5 seconds after enter event).

Opening the door (controlled by Relay 2)

MQTT topic

Possible values

Explanation

<devicename>/command/door

trigger+<device master password>

Triggering the door by activating the momentary Relay 2 for a short time.


open+<device master password>

Triggering the door by activating the momentary Relay 2 for a short time.


close+<device master password>

Triggering the door by activating the momentary Relay 2 for a short time.



Reboot

MQTT topic

Possible values

Explanation

<devicename>/command/system

reboot+<device master password>

Rebooting the device.

Firmware upgrade

MQTT topic

Possible values

Explanation

<devicename>/command/system

upgrade+<device master password>+<URL to fw image>

Fetching the firmware image from the specified URL, then applying it. Upon successful upgrade the device is rebooted automatically. <devicename>/status topic is updated accordingly.

System info

MQTT topic

Possible values

Explanation

<devicename>/command/system

info

Publishes the hardware and firmware name and version in <devicename>/sysinfo topic.


uptime

Publishes the current uptime in <devicename>/uptime topic.


prodinfo

Publishes the full hardware information in <devicename>/prodinfo topic.


wifiinfo

Publishes local IP, MAC address, channel and RSSI in <devicename>/wifiinfo topic.

Save config to flash

MQTT topic

Possible values

Explanation

<devicename>/command/system

saveconfig+<device master password>

Saves device configuration to non-volatile memory.


saveremotes+<device master password>

Saves configured remote controllers to non-volatile memory.

Factory reset

MQTT topic

Possible values

Explanation

<devicename>/command/system

factoryreset+<device master password>

Erases all configured data and restores factory default configuration.



Force reconnection

MQTT topic

Possible values

Explanation

<devicename>/command/system

forcewifireconnect+<device master password>

Forces Wifi reconnection. Intended to be used after reconfiguring SSID/Password or device name.


forcemqttreconnect+<device master password>

Forces MQTT reconnection. Intended to be used after reconfiguring MQTT connection parameters.


restartwifiap+<device master password>

Restarts Wifi AP, provided by this device. Intended to be used after reconfiguring Wifi AP parameters.

MQTT configuration

Gatekeeper can be configured by publishing in a <devicename>/config/… MQTT topic. Parameters are set silently (if the value is valid).

If a value is not provided, Gatekeeper responds the value in an MQTT topic as mentioned in Explanation column.

Base configuration

MQTT topic

Possible values

Explanation

<devicename>/config/baseconfig

<device master password>+<key>[=<value>]

Set <key> to <value> if both are given. Publishes the currently set value in <devicename>/baseconfig topic if value is omitted.

For possible keys please see Basic parameters table in Parameter Description document.

TempSense

MQTT topic

Possible values

Explanation

<devicename>/config/tempsense/enable

true

Enables TempSense functionality.


false

Disables TempSense functionality.


<empty>

Publishes the currently set value in <devicename>/tempsense/enable topic.

AutoLightControl

MQTT topic

Possible values

Explanation

<devicename>/config/alc/enable

true

Enables AutoLightControl functionality.


false

Disables AutoLightControl functionality.


<empty>

Publishes the currently set value in <devicename>/alc/enable topic.

AutoLightControl Timer 1

MQTT topic

Possible values

Explanation

<devicename>/config/alc/timer1

<N>

Sets the timer value to <N> seconds if no unit is appended. Factory default value is 300 seconds.


<N[hms]>

[h]our, [m]inute and [s]econd units may also be used.


<empty>

Publishes the currently set value in <devicename>/alc/timer1 topic.

AutoLightControl Timer 2

MQTT topic

Possible values

Explanation

<devicename>/config/alc/timer2

<N>

Sets the timer value to <N> seconds if no unit is appended. Factory default value is 1800 seconds.


<N[hms]>

[h]our, [m]inute and [s]econd units may also be used.


<empty>

Publishes the currently set value in <devicename>/alc/timer2 topic.

GateSense

MQTT topic

Possible values

Explanation

<devicename>/config/gate/sensemode

0

Gate state sensor disabled.


1

Normal mode: sensor low level = gate open, high level = gate closed


2

Inverted mode: sensor low level = gate closed, high level = gate open


<empty>

Publishes the currently set value in <devicename>/gate/sensemode.

Gate Guard Timer

MQTT topic

Possible values

Explanation

<devicename>/config/gate/guardtimer

<N>

Sets the timer value to <N> seconds. Factory default value is 30 seconds.


<empty>

Publishes the currently set value in <devicename>/gate/guardtimer topic.

Gate Cancel Timer

MQTT topic

Possible values

Explanation

<devicename>/config/gate/canceltimer

<N>

Sets the timer value to <N> seconds. Factory default value is 5 seconds.


<empty>

Publishes the currently set value in <devicename>/gate/canceltimer topic.

Location beacons

MQTT topic

Possible values

Explanation

<devicename>/config/beacons/list

<empty>

Publishes the Beacon IDs in <devicename>/beacons topic.

<devicename>/config/beacons/details

<beacon id>

Publishes configured attributes of beacon in <devicename>/beacons/<beacon id> topic.

<devicename>/config/beacons/add

<beacon id>[,<type>][,<mac addr>][,<rssi>]

Adds a new beacon with given Beacon ID and following optional parameters:

Type (0 = Disabled, 1 = OwnTracks region events, 2 = OwnTracks location updates, 3 = Beacon connects to the Wi-fi AP provided by this device)

MAC address (hexa with semicolons)

RSSI (threshold on beacon's Wi-Fi signal strength)

<devicename>/config/beacons/delete

<beacon id>

Deletes the beacon permanently and unsubscribes from its MQTT messages.

<devicename>/config/beacons/set

<beacon id>:<bcid|type|mac|rssi|away>=<value>

Modifies the given attribute of the beacon with given Beacon ID.

Type (0 = Disabled, 1 = OwnTracks region events, 2 = OwnTracks location updates, 3 = Beacon connects to the Wi-fi AP provided by this device)

MAC address (hexa with semicolons)

RSSI: Wi-fi signal strength trigger threshold

Away: <1|true> = true, <anything else> = false

MQTT limitations

The maximum MQTT payload length supported by HAUS IoT controllers is 252 bytes. This means that topic name length + message length for a single MQTT message cannot exceed this limit. Bigger messages are discarded, however this limit is not a concern in typical applications. (Publishing the MQTT Dash config is an exception: the controller is able to publish giant MQTT messages in that case.)

MQTT Dash integration

MQTT Dash configuration can be publised from the Remote controllers menu of WebUI in JSON format.

Default MQTT topic for publishing the config is metrics/exchange, which is the default topic set in MQTT Dash. You may use any other topic, if it is set on both ends. This is useful, if a topic prefix is mandatory on a special MQTT broker.

OwnTracks integration

Currently there are 2 modes of handling OwnTracks provided location information:

  1. Relying on OwnTracks region handling: OwnTracks sends MQTT messages on entering and leaving regions defined in the app.

  2. Relying on OwnTracks provided location information: OwnTracks sends location updates in MQTT messages, and Gatekeeper evaluates whether the beacon is within Gatekeeper's own defined region.

Entering and leaving region

If a mobile handset running OwnTracks enters or leaves a Region, defined in OwnTracks Regions, it will publish an MQTT message in below topic.

The topic contains the username, OwnTracks uses to authenticate to the MQTT broker, also it contains the Device ID set in OwnTracks Preferences.

In the payload message the event (enter/leave) and the subject Region (e.g. Home) is named.

OwnTracks topic prefix is empty by default, but can be configured if needed (e.g. for MaQiaTTo cloud MQTT broker).

MQTT topic: <owntracks topic prefix>owntracks/<mqtt username>/<owntracks device id>/event

Message on entering:

{"_type":"transition","acc":15.705,"desc":"<region>","event":"enter","lat":47.0,"lon":19.0,"t":"l","tid":"t7","tst":1579172959,"wtst":1575640789}

Message on leaving:

{"_type":"transition","acc":15.705,"desc":"<region>","event":"leave","lat":47.0,"lon":19.0,"t":"l","tid":"t7","tst":1579174295,"wtst":1575640789}

Location updates

Mobile handset periodically sends location updates, which is received and processed byGatekeeper, if this mode is selected.

MQTT topic: <owntracks topic prefix>owntracks/<mqtt username>/<owntracks device id>

Message:

{"_type":"location","acc":3,”alt”:”105”,"lat":47.0,"lon":19.0,"t":"u","tid":"S2","tst":1579172959,"vac":0,”vel”:18}

Further information

For further information please see OwnTracks Integration Guide.