Documentation for removal of discovered device (#6276)

* Update discovery.markdown

* Minor change
This commit is contained in:
emontnemery 2018-09-24 10:22:33 +02:00 committed by Fabian Affolter
parent 05463dbf80
commit d13cd890b8

View File

@ -22,7 +22,6 @@ Supported by MQTT discovery:
- [Sensors](/components/sensor.mqtt/)
- [Switches](/components/switch.mqtt/)
To enable MQTT discovery, add the following to your `configuration.yaml` file:
```yaml
@ -49,6 +48,8 @@ The discovery topic need to follow a specific format:
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`.
An empty payload will cause a previously discovered device to be deleted.
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 Support by third-party tools %}
@ -79,6 +80,12 @@ Update the state.
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/binary_sensor/garden/state" -m ON
```
Delete the sensor by sending an empty message.
```bash
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/binary_sensor/garden/state" -m ''
```
Setting up a switch is similar but requires a `command_topic` as mentioned in the [MQTT switch documentation](/components/switch.mqtt/).
- Configuration topic: `homeassistant/switch/irrigation/config`