Loxone: Integrating the KL MZ multi-zone presence sensor

Learn how to integrate the KL MZ multi-zone presence sensor into Loxone, with all settings on the sensor and on the hub.

Applies to KL MZ · Sensor firmware 1.4.3 and newer · As of 11/30/2026

Contents

The Miniserver and the sensor are connected to the same MQTT broker. The sensor reports every change in presence immediately. The Miniserver takes it over via Loxone's own MQTT (from Config 15.3, not Miniserver Gen. 1) and evaluates it at most every 2 seconds. Presence and zones become 1/0 and can be used like digital signals. In addition there are the number of people, brightness, temperature, humidity and air pressure, and the siren can be switched.

Without a broker, or with a Miniserver Gen. 1, it also works through a Virtual HTTP Input (see Without a broker). The Miniserver then polls the sensor only every 10 seconds at most. That is how long it can take until, for example, the light comes on.

Replace the placeholders in this guide with your own values:

Placeholder Meaning
<Hauptthema> what is entered on the sensor under Connections → Main topic
<ZONE1> … <ZONE4> Name of the detection zone as it appears in the MQTT topic: in capital letters
<IP> IP address of the sensor, only for the HTTP method
<Zonenname> Name of a detection zone, exactly as entered under Zones → Zone names (note upper and lower case), only for the HTTP method

Requirements

  • Miniserver Gen. 2, Compact or Go with Loxone Config 15.3 or newer (for the HTTP method any Miniserver, including Gen. 1)
  • an MQTT broker on the network, e.g. Mosquitto on a NAS or a LoxBerry. The Miniserver is only a client, not a broker. Without a broker, the HTTP method remains.
  • KL MZ multi-zone presence sensor with firmware 1.4.3 or newer on the same network as the Miniserver

Setting up the sensor

  1. In the sensor's web interface under Zones → Zone names, name the detection zones you use before you enter them in Loxone (short, only letters, digits and _, no spaces or umlauts, e.g. Sofa). Do not rename them afterwards: the name is part of the topics below. Do not choose a name that looks like a field of the response (presence, detection, temperature …).

  2. Sensor web interface → Connections:

    Field Value
    Connection type MQTT Broker
    Server, port those of the broker
    Login, password only if the broker requires them
    Client id unique, only letters, digits, _
    Main topic free, only letters, digits, _
    Home Assistant off (Loxone does not read the discovery)

    Save. After a short while, the bottom of the page shows “connected”.

How long presence continues after the last detection is set on the sensor (main page, Room timeout and Timeout per zone), not in Loxone.

Setup

  1. Select Network Periphery → Add network device → MQTT. Properties:

    Property Value
    Broker address IP address of the broker
    Broker port the same as on the sensor, usually 1883
    Client ID free, but different from the sensor's
    Username / password only if the broker requires them
  2. Select the MQTT object and add one Subscription for each value. A subscription delivers text. Follow it with the Command Recognition block (input T, output Lv):

    Topic of the subscription Command Recognition Lv
    stat/<Hauptthema>/PRESENCE \1 84 = someone there (True), 70 = nobody (False)
    stat/<Hauptthema>/ZONES/<ZONE1> (likewise <ZONE2> …) \1 84 = zone occupied, 70 = free
    stat/<Hauptthema>/DETECTION \v Number of people
    tele/<Hauptthema>/LWT \s1\1 110 = reachable (Online), 102 = not reachable (Offline)

    Turn 84/70 into the values 1/0, e.g. with the Formula block and the formula MAX(0;(I1-70)/14). An empty message (zone without an area) also results in 0. For LWT, \s1 skips the first character, because both words start with O.

    Example: if the zone on the sensor is called Sofa, the topic is stat/<Hauptthema>/ZONES/SOFA.

  3. Brightness, temperature, humidity and air pressure are only available in the JSON: subscribe to tele/<Hauptthema>/STATE and follow it with one Command Recognition for each value:

    Value Command Recognition
    Brightness in lx \i"brightness": \i\v
    Temperature in °C \i"temperature": \i\v
    Humidity in % \i"humidity": \i\v
    Air pressure in hPa \i"pressure": \i\v

    Enter the patterns exactly as shown, with the space after the colon. The values arrive at the Publish interval of the sensor (on the sensor under Connections).

  4. Drag the Formula blocks onto a program page and connect presence or a zone to the input of the block that is to react (e.g. the lighting control). Save to the Miniserver.

At most 16 subscriptions per Miniserver. It evaluates changes every 2 seconds at the earliest. The broker keeps presence, number of people and zones ready, so after a restart of the Miniserver they are back right away.

Quick test

  1. Go into the room: in the live view, presence jumps to 1 after 2 seconds at most, and so does the zone you are standing in. Leave the room: after the timeout, both are at 0.
  2. The Command Recognition behind the subscription to LWT shows 110 (reachable).

Without a broker: Virtual HTTP Input

This method does not need a broker and also works on the Miniserver Gen. 1. However, the Miniserver polls the sensor only every 10 seconds. The sensor needs a fixed IP address for this (permanently assign the address in the router). Check in the browser whether the sensor responds: http://<IP>/measurements returns a line like

{"presence": true, "detection": 1, "zones": {"Sofa": true}, "temperature": 21.5, "pressure": 1014.6, "humidity": 49.9, "brightness": 184.6}

Under zones there are only the detection zones for which an area has been drawn. The order of the fields is not fixed. The patterns below can handle that. Step 2 under “Setting up the sensor” (broker) is not needed for this method.

  1. In Loxone Config, select Virtual Inputs in the Periphery tree and add a Virtual HTTP Input. Properties:

    Property Value
    URL http://<IP>/measurements
    Polling cycle 10 (seconds, the smallest permitted value)
    Timeout 4000 (ms, permitted 10…8000)
    Number of allowed timeouts 5

    If Authentication is switched on at the sensor under System, the URL is http://<IP>/measurements?login=<Login>&password=<Passwort>.

  2. Select the HTTP input and add a Virtual HTTP Input Command for presence:

    Property Value
    Command Recognition \i"presence": \i\1
    Use as digital input off
    Correction: Input value 1 102
    Correction: Display value 1 0
    Correction: Input value 2 116
    Correction: Display value 2 1

    Enter the pattern exactly as shown, with the space after the colon. Background: in the JSON, presence is the word true or false. \i…\i jumps to the position after the given text, \1 reads the character code of the next letter: 116 for t (true), 102 for f (false). The correction turns these into 1 and 0.

  3. For each detection zone you use, add a further command with the same correction (102 → 0, 116 → 1):

    Property Value
    Command Recognition \i"<Zonenname>": \i\1

    Example for the zone Sofa: \i"Sofa": \i\1. Here the name is as you entered it, not in capital letters.

  4. Add further commands as you like, here without a correction:

    Value Command Recognition Result
    Number of people \i"detection": \i\v e.g. 2, 0 = nobody detected
    Brightness in lx \i"brightness": \i\v e.g. 184.6
    Temperature in °C \i"temperature": \i\v e.g. 21.5
    Humidity in % \i"humidity": \i\v e.g. 49.9
    Air pressure in hPa \i"pressure": \i\v e.g. 1014.6

    \v reads the number that follows the text. The number of people applies without timeout. For “light on/off”, use presence.

  5. Drag the commands onto a program page and connect presence or a zone to the input of the block that is to react (e.g. the lighting control). Save to the Miniserver.

Quick test: in the command, open the editing window of the Command Recognition. It shows the sensor's response, that is, the JSON line from above. Go into the room: in the live view, presence jumps to 1 after one polling cycle at the latest, and so does the command of the zone you are standing in. Leave the room: after the timeout and one polling cycle, both are at 0.

Optional

Switching the siren

With MQTT, add a Publish object:

Property Value
Topic cmnd/<Hauptthema>/SIREN
Value ON or OFF
Retain off

Without a broker, a Virtual Output switches the sound over HTTP:

  1. Select Virtual Outputs and add a Virtual Output:

    Property Value
    Address http://<IP>

    Only the address, with no path after it.

  2. Below it, add a Virtual Output Command:

    Property Value
    Command for ON /siren?turn=on
    Command for OFF /siren?turn=off

    If authentication is switched on at the sensor, append &login=<Login>&password=<Passwort> to both commands.

  3. On the program page, connect the command to the output that is to trigger the siren (e.g. alarm system). You choose the sound itself on the sensor (main page, Sound).

Whether the siren is currently sounding is returned by http://<IP>/siren ({"siren": true} or false). For this, add an HTTP input with the Command Recognition \i"siren": \i\1 and the same correction as for presence.

LoxBerry with MQTT Gateway

Worthwhile if a LoxBerry is already running (the gateway and the broker have been built in since LoxBerry 3.0) or if the Miniserver Gen. 1 is to get MQTT.

  1. Enter the LoxBerry as the broker on the sensor. Server, port, user and password are found in the LoxBerry under System Settings → MQTT Gateway → MQTT Basics.
  2. On the Gateway tab under Text to Value Conversions, enter True=1 and False=0.
  3. On the Subscriptions tab, tick stat/<Hauptthema>/PRESENCE and the zones stat/<Hauptthema>/ZONES/<ZONE1> …
  4. On the Incoming Overview tab, copy the names (do not type them) and create a Virtual Input in Loxone Config for each value, with exactly this name, e.g. stat_<Hauptthema>_PRESENCE.

Limitations

  • Loxone evaluates MQTT messages at most every 2 seconds. The HTTP method polls at most every 10 seconds. That is how long it can take there until, for example, the light comes on.
  • If the sensor fails, the last value stays (even a presence of 1). With MQTT, LWT shows 102 (not reachable) after about 20–30 seconds. On the HTTP input, the Miniserver reports the failure after the set number of timeouts.
  • The HTTP method reads values and switches the siren. Other settings of the sensor cannot be changed this way.
  • Zone names: the topic and the patterns contain the zone name. After renaming on the sensor, Loxone no longer finds the zone. In that case, also enter the new name in Loxone. A zone without a drawn area is not in the HTTP response and sends an empty message over MQTT. Create subscriptions only for zones with an area.
  • The factory name Detection 1 contains a space (in the topic DETECTION 1). Therefore rename the zones beforehand (see “Setting up the sensor”).
  • Shortly after a restart of the sensor, temperature, humidity, air pressure and brightness are not yet set (null). What Loxone then displays depends on the Miniserver.
  • HTTP method: the IP address is fixed in the URL. If it changes, nothing arrives any more. With login, the password is in plain text in the URL.

Verification status

This guide is based on the documentation from Loxone and LoxBerry.

Next

Manual

KL MZ presence sensor

Mounting, connecting to Wi-Fi, drawing zones.

Smart home

All systems

An overview of the guides for all twelve systems.

Support

Help and contact

Phone, email and contact form.