Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion source/_docs/mqtt/discovery.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ Configuration variables:
The discovery topic need to follow a specific format:

```text
<discovery_prefix>/<component>/<object_id>/<>
<discovery_prefix>/<component>/[<node_id>/]<object_id>/<>
```

- `<component>`: One of the supported components, eg. `binary_sensor`.
- `<node_id>`: (*Optional*) id of the node providing the topic.
- `<object_id>`: The ID of the device. This will become the `entity_id` in Home Assistant.
- `<>`: The topic `config` or `state` which defines the current action.

The payload will be checked like an entry in your `configuration.yaml` file if a new device is added. This means that missing variables will be filled with the platform's default values. All configuration variables which are *required* must be present in the initial payload send to `/config`.

The `<node_id>` level can be used by clients to only subscribe to their own (command) topics by using one wildcard topic like `<discovery_prefix>/+/<node_id>/+/set`.

### {% linkable_title Examples %}

A motion detection device which can be represented by a [binary sensor](/components/binary_sensor.mqtt/) for your garden would sent its configuration as JSON payload to the Configuration topic. After the first message to `config`, then the MQTT messages sent to the state topic will update the state in Home Assistant.
Expand Down