Document restrictions on allowed characters in MQTT discovery… (#12060)

Document restrictions on allowed characters in MQTT discovery topics.
As discussed in #30940.
This commit is contained in:
Erik Montnemery 2020-02-12 08:43:11 +01:00 committed by GitHub
parent eb57b85d78
commit 322833d68d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,8 +55,8 @@ The discovery topic need to follow a specific format:
```
- `<component>`: One of the supported MQTT components, eg. `binary_sensor`.
- `<node_id>` (*Optional*): ID of the node providing the topic, this is not used by Home Assistant but may be used to structure the MQTT topic.
- `<object_id>`: The ID of the device. This is only to allow for separate topics for each device and is not used for the `entity_id`.
- `<node_id>` (*Optional*): ID of the node providing the topic, this is not used by Home Assistant but may be used to structure the MQTT topic. The ID of the node must only consist of characters from the character class `[a-zA-Z0-9_-]` (alphanumerics, underscore and hyphen).
- `<object_id>`: The ID of the device. This is only to allow for separate topics for each device and is not used for the `entity_id`. The ID of the device must only consist of characters from the character class `[a-zA-Z0-9_-]` (alphanumerics, underscore and hyphen).
The payload must be a JSON dictionary and 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`.