Skip to content

Commit 55bec87

Browse files
AlexMekkeringballoob
authored andcommitted
Mqtt discovery optional nodeid (home-assistant#2840)
* Add support for remote (TCP/IP) DSMR sensors (i.e. via ser2net) * Processed review comment and added ser2net config * added optional node_id to MQTT discovery
1 parent 2189bbd commit 55bec87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/_docs/mqtt/discovery.markdown

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ Configuration variables:
3737
The discovery topic need to follow a specific format:
3838

3939
```text
40-
<discovery_prefix>/<component>/<object_id>/<>
40+
<discovery_prefix>/<component>/[<node_id>/]<object_id>/<>
4141
```
4242

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

4748
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`.
4849

50+
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`.
51+
4952
### {% linkable_title Examples %}
5053

5154
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.

0 commit comments

Comments
 (0)