mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 08:16:53 +00:00
Use device_class
This commit is contained in:
parent
3c61e1ddcf
commit
985e58d622
@ -44,12 +44,12 @@ A motion detection device which can be represented by a [binary sensor](/compone
|
||||
|
||||
- Configuration topic: `homeassistant/binary_sensor/garden/config`
|
||||
- State topic: `homeassistant/binary_sensor/garden/state`
|
||||
- Payload: `{"name": "garden", "sensor_class": "motion"}`
|
||||
- Payload: `{"name": "garden", "device_class": "motion"}`
|
||||
|
||||
To create a new sensor manually. For more details please refer to the [MQTT testing section](/component/mqtt_testing).
|
||||
|
||||
```bash
|
||||
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/binary_sensor/garden/config" -m '{"name": "garden", "sensor_class": "motion"}'
|
||||
$ mosquitto_pub -h 127.0.0.1 -p 1883 -t "homeassistant/binary_sensor/garden/config" -m '{"name": "garden", "device_class": "motion"}'
|
||||
```
|
||||
Update the state.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user