Contents
Homey integrates the sensor through two community apps: “MQTT Client” establishes the connection to the broker, and “MQTT Hub” creates devices from it. The device for the room gets a motion alarm (= someone in the room), the number of people, “not reachable” and, as you wish, brightness, temperature, humidity and air pressure. Each detection zone you want to use becomes a small device of its own with a motion alarm. Homey itself does not speak MQTT, and the sensor's Home Assistant discovery is not used here. You assign each topic once by hand.
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 topic: in capital letters. If the zone on the sensor is called Sofa, it reads SOFA there. |
Requirements
| Item | Version |
|---|---|
| Homey | Homey Pro or Homey Self-Hosted Server with Homey 12.4.5 or newer, not Homey Cloud |
| App “MQTT Client” |
nl.scanno.mqtt, 3.0.0 |
| App “MQTT Hub” |
org.mqtt.hub (community version by Ronny Winkler), 4.7.0 |
| MQTT broker | e.g. Mosquitto, or on the Homey the app “MQTT Broker” (nl.scanno.mqttbroker, 3.0.2) |
| Sensor | KL MZ multi-zone presence sensor with firmware 1.4.3 or newer |
The earlier “MQTT Hub” by Harrie de Groot (nl.hdg.mqtt) is no longer in the App Store. Older Homey Pro units (up to early 2019) do not get Homey 12 and therefore no MQTT Hub.
Setting up the sensor
-
Under Zones → Zone names, name the detection zones you use before you enter them in Homey (short, only letters, digits and
_, no spaces, e.g.Sofa). Do not rename them afterwards: the name is part of the topic (see Limitations). -
Sensor web interface → Connections.
Field Value Connection type MQTT BrokerServer, 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 (Homey does not read the discovery)
How long presence continues after the last detection is set on the sensor (main page, Room timeout and Timeout per zone).
Setup
-
Install both apps from the Homey App Store.
-
Settings of the MQTT Client app:
Field Value Enter IP adress or DNS Name or IP address of the broker Enter port number 1883Username for the broker / Password for the broker only if the broker requires them Use a secure connection to the broker (TLS) only if the broker requires it Check with Test, save with Save Settings.
-
Settings of the MQTT Hub app: switch both switches off. Here the hub should only receive, not send all Homey devices to the broker.
Field Value Set devices active by default off Broadcast device state changes off -
Device for the room: Add device → MQTT Hub → MQTT Device:
Field Value Device name freely selectable, e.g. Wohnzimmer AnwesenheitSelect a device class SensorWith Add capability, add one property per row. “State topic”, “Value template” and “Display name” are fields of the dialog. The entry “empty” means: leave the field blank. “Set topic” stays empty everywhere.
Select a capability State topic Value template Display name Result alarm_motionstat/<Hauptthema>/PRESENCEempty empty Presence (motion alarm on = someone in the room) measure_numberstat/<Hauptthema>/DETECTIONempty PersonenNumber of people alarm_connectivitytele/<Hauptthema>/LWT(topic) => { return topic.value !== 'Online' }empty Sensor unreachable Additionally as you wish, all from the sensor's status message:
Select a capability State topic Value template Result measure_luminancetele/<Hauptthema>/STATE$.brightnessBrightness in lx measure_temperaturetele/<Hauptthema>/STATE$.temperatureTemperature in °C measure_humiditytele/<Hauptthema>/STATE$.humidityHumidity in % measure_pressuretele/<Hauptthema>/STATE$.pressureAir pressure (hPa = mbar) Complete the wizard.
-
One device for each detection zone: repeat step 4 for each zone you want to use in flows, with only one property:
Field Value Device name e.g. SofaSelect a device class SensorSelect a capability alarm_motionState topic stat/<Hauptthema>/ZONES/<ZONE1>(or<ZONE2>…)Value template empty Example: zone
Sofa→stat/<Hauptthema>/ZONES/SOFA. A device of its own for each zone has the same flow cards as any motion sensor and can be assigned to a Homey zone (room).
Flows for presence
Create two flows (for the room with the room device, for a detection zone with its device):
| When … | Then … | |
|---|---|---|
| Flow “Someone there” | Your device: The motion alarm turned on | e.g. switch the light on |
| Flow “Nobody there” | Your device: The motion alarm turned off | e.g. switch the light off |
As a condition in other flows: The motion alarm is on/off. You do not need a wait time of your own in the flow. Presence only goes off after the sensor's timeout.
Quick test
After a few seconds, the room device's tile shows motion alarm and people like the sensor's main page (the broker delivers the last state right away). Go into the room: the alarm of the room and of the zone you are standing in turns on immediately. When you leave the room, both turn off after the timeout. Brightness and temperature arrive with the next status message, after one Publish interval at the latest. If a tile stays empty, check in the MQTT Client app whether the connection to the broker is up, and the spelling of the main topic and zone name (capital letters).
Optional
Switching the siren on and off. Add onoff to the room device (Display name e.g. Alarmton):
| Field | Value |
|---|---|
| State topic | stat/<Hauptthema>/SIREN |
| Set topic | cmnd/<Hauptthema>/SIREN |
Then, in the device settings under Advanced, switch off the switch Retain published messages. If it is on (the app's factory setting), the command stays at the broker and the sensor runs it again after every reconnection. You choose the sound itself on the sensor (main page, Sound).
Without MQTT Hub, for example on an older Homey Pro: the MQTT Client app has the trigger card “Trigger when a message is received on …” with the value as text (True/False). You can build a flow with it, but no device with a motion alarm.
Limitations
- No device type “presence sensor” of its own. Homey only knows the motion alarm. Here it stands for “someone there, moving or at rest”.
- Zones by name. Each zone device is tied to a fixed topic with the zone name. Zones are not discovered automatically. If you rename a zone on the sensor, the sensor deletes the old topic. The device then shows “off” and receives nothing any more. Enter the new topic in the device settings under Advanced → Topics or create the device again. Under the new name, the sensor only reports when the occupancy of a zone changes.
- The factory name
Detection 1is in the topic with a space (…/ZONES/DETECTION 1). Therefore rename the zones beforehand (see “Setting up the sensor”). - A detection zone without a drawn area reports nothing. Its device stays “off”.
- Values can get stuck when MQTT Client or the broker restarts. In that case, restart the MQTT Hub app (a known, open bug of the app).
-
No “not reachable” on the device itself. The app never reports a device as failed. For that there is the property
alarm_connectivity. If the sensor fails, the motion alarm stays as it was. - Both apps come from individuals without support. MQTT Client has been unchanged since 2021.
- Encryption: MQTT Client supports TLS, but not a custom CA certificate. With a self-signed broker certificate, the only option is to switch off the check.
Verification status
This guide is based on the documentation of the two apps.