MQTT Room Presence

The mqtt_room sensor platform allows you to detect the indoor location of devices using MQTT clients.


To use this device tracker in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
  - platform: mqtt_room
    device_id: 123testid

Configuration Variables


(string)(Required)The device id to track for this sensor.


(string)(Optional)The name of the sensor.

Default value: Room Sensor


(string)(Optional)The topic that contains all subtopics for the rooms.

Default value: room_presence


(integer)(Optional)The time in seconds after which a room presence state is considered old. An example: device1 is reported at scanner1 with a distance of 1. No further updates are sent from scanner1. After 5 seconds scanner2 reports device1 with a distance of 2. The old location info is discarded in favor of the new scanner2 information as the timeout has passed.

Default value: 5


(integer)(Optional)The time in seconds after which the state should be set to not_home if there were no updates. 0 disables the check.

Default value: 0


Example JSON that should be published to the room topics:

  "id": "123testid",
  "name": "Test Device",
  "distance": 5.678

Setting up clients

This component works with any software that is sending data in the given format. Each client should post the discovered devices in its own subtopic of the configured topic. Instead of developing your own application, you can also use any of these already existing clients: