From 91b3d74e84eaab7a15bfbdd46eb502ed8c172906 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 4 Oct 2018 20:21:53 +0200 Subject: [PATCH 1/3] Add device registry for MQTT sensors --- source/_components/sensor.mqtt.markdown | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index 0b44200064aa..769e93e78f33 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -91,6 +91,35 @@ device_class: required: false type: device_class default: None +device: + description: 'Information about the device this sensor is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html). Only works through [MQTT discovery](/docs/mqtt/discovery/) and when [`unique_id`](#unique_id) is set.' + required: false + type: map + keys: + identifiers: + description: 'A list of IDs that uniquely identify the device. For example a serial number.' + required: false + type: list, string + connections: + description: 'A list of connections of the device to the outside world in the JSON format `{connection_type: connection_identifier}`. For example the MAC address of the network interface.' + required: false + type: list, tuple + manufacturer: + description: 'The manufacturer of the device.' + required: false + type: string + model: + description: 'The model of the device.' + required: false + type: string + name: + description: 'The name of the device.' + required: false + type: string + sw_version: + description: 'The firmware version of the device.' + required: false + type: string {% endconfiguration %} ## {% linkable_title Examples %} From 37d2bd66490c5e97ce0162a58dc5ba12ae68d933 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 5 Oct 2018 12:23:33 +0200 Subject: [PATCH 2/3] Update to reflect parent PR --- source/_components/sensor.mqtt.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index 769e93e78f33..394c82df3f6f 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -101,7 +101,7 @@ device: required: false type: list, string connections: - description: 'A list of connections of the device to the outside world in the JSON format `{connection_type: connection_identifier}`. For example the MAC address of the network interface.' + description: 'A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `[["mac", "02:5b:26:a8:dc:12"]]`.' required: false type: list, tuple manufacturer: From 358fa0c9ae7170478e9c394ada80f1b338624257 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 10 Oct 2018 16:04:57 +0200 Subject: [PATCH 3/3] Address comments --- source/_components/sensor.mqtt.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_components/sensor.mqtt.markdown b/source/_components/sensor.mqtt.markdown index 394c82df3f6f..81ab57d9aefc 100644 --- a/source/_components/sensor.mqtt.markdown +++ b/source/_components/sensor.mqtt.markdown @@ -101,9 +101,9 @@ device: required: false type: list, string connections: - description: 'A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `[["mac", "02:5b:26:a8:dc:12"]]`.' + description: 'A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `"connections": [["mac", "02:5b:26:a8:dc:12"]]`.' required: false - type: list, tuple + type: list manufacturer: description: 'The manufacturer of the device.' required: false