Contents
Homey integrates the presence sensor through two community apps: “MQTT Client” establishes the connection to the broker, and “MQTT Hub” creates a device from it with a motion alarm (= presence), brightness, temperature, humidity and air pressure. With the motion alarm you start flows as with any other motion sensor, such as “light on when someone is there”. Homey itself does not speak MQTT, and the sensor's Home Assistant discovery is not used here. You assign each topic once by hand.
In the topics, <Hauptthema> stands for the value entered on the sensor under
Connections → Main topic; replace it with your value.
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 LD presence sensor with firmware 1.1.3 or KL with firmware 3.2.3 |
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
Sensor web interface → Connections. All fields are explained in the user manual.
| 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: Homey does not read the discovery |
How long presence continues after the last detection is set on the sensor (main page, Timeout).
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 -
Add device → MQTT Hub → MQTT Device:
Field Value Device name freely selectable, e.g. the room Select a device class Sensor -
With Add capability, add one property per row. “State topic” and “Value template” are fields of the dialog; “empty” means: leave the field blank. “Set topic” stays empty everywhere.
Select a capability State topic Value template Result alarm_motionstat/<Hauptthema>/PRESENCEempty Presence (motion alarm on = someone there) 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) Only the first row is needed for presence; the others as you wish.
-
Complete the wizard.
Flows for presence
Create two flows:
| When … | Then … | |
|---|---|---|
| Flow “Someone there” | Your presence sensor device: The motion alarm turned on | e.g. switch the light on |
| Flow “Nobody there” | Your presence sensor 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 device tile shows the motion alarm like the sensor's main page (the broker delivers the last state right away). Walk up and down in front of the sensor: the alarm turns on immediately. When you leave the room, it turns off after the timeout. Brightness and temperature arrive with the next status message, after one Publish interval at the latest. If the tile stays empty, check in the MQTT Client app whether the connection to the broker is up, and the spelling of the main topic.
Optional
Further values following the same pattern (for measure_string, enter Zone under “Display name”):
| Select a capability | State topic | Value template | Result |
|---|---|---|---|
measure_string |
stat/<Hauptthema>/ZONE |
empty | Name of the zone; - = nobody there or outside all zones |
alarm_connectivity |
tele/<Hauptthema>/LWT |
(topic) => { return topic.value !== 'Online' } |
Sensor unreachable |
Switching the siren on and off. Add onoff:
| 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.
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”.
-
Do not subscribe to the distances.
DETECTION_DISTand the other distances arrive up to ten times per second when people are moving. Homey would store every value. For “is someone there?”, presence is enough. - 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 row with
alarm_connectivityabove. If the sensor fails, the motion alarm stays as it was. - With older firmware (KL LD up to 1.1.2, KL up to 3.2.2), the old presence value can remain after a restart of the sensor until the first change. Please update the firmware.
- 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.