From 38178f5aeab0f116ce56a0c43e209b369fca36fc Mon Sep 17 00:00:00 2001 From: Felix Triller Date: Mon, 22 Oct 2018 22:56:56 +0200 Subject: [PATCH 1/3] Use Home Assistant's device_class for sensors. --- lib/homeassistant.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/homeassistant.js b/lib/homeassistant.js index 05160a7610..b371e50496 100644 --- a/lib/homeassistant.js +++ b/lib/homeassistant.js @@ -75,7 +75,7 @@ const configurations = { object_id: 'illuminance', discovery_payload: { unit_of_measurement: 'lx', - icon: 'mdi:theme-light-dark', + device_class: 'illuminance', value_template: '{{ value_json.illuminance }}', json_attributes: ['battery', 'voltage'], }, @@ -85,7 +85,7 @@ const configurations = { object_id: 'humidity', discovery_payload: { unit_of_measurement: '%', - icon: 'mdi:water-percent', + device_class: 'humidity', value_template: '{{ value_json.humidity }}', json_attributes: ['battery', 'voltage'], }, @@ -95,7 +95,7 @@ const configurations = { object_id: 'temperature', discovery_payload: { unit_of_measurement: '°C', - icon: 'mdi:temperature-celsius', + device_class: 'temperature', value_template: '{{ value_json.temperature }}', json_attributes: ['battery', 'voltage'], }, @@ -105,7 +105,7 @@ const configurations = { object_id: 'pressure', discovery_payload: { unit_of_measurement: 'Pa', - icon: 'mdi:speedometer', + device_class: 'pressure', value_template: '{{ value_json.pressure }}', json_attributes: ['battery', 'voltage'], }, @@ -157,7 +157,7 @@ const configurations = { type: 'sensor', object_id: 'lock', discovery_payload: { - icon: 'mdi:lock', + device_class: 'lock', value_template: '{{ value_json.inserted }}', json_attributes: ['forgotten', 'keyerror'], }, From a8738a2dd68615e9765eea6d21ab9ca0fcc95475 Mon Sep 17 00:00:00 2001 From: Felix Triller Date: Tue, 23 Oct 2018 11:05:50 +0200 Subject: [PATCH 2/3] Unit for pressure should be hPa --- lib/homeassistant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homeassistant.js b/lib/homeassistant.js index b371e50496..d31c556690 100644 --- a/lib/homeassistant.js +++ b/lib/homeassistant.js @@ -104,7 +104,7 @@ const configurations = { type: 'sensor', object_id: 'pressure', discovery_payload: { - unit_of_measurement: 'Pa', + unit_of_measurement: 'hPa', device_class: 'pressure', value_template: '{{ value_json.pressure }}', json_attributes: ['battery', 'voltage'], From b4e7594e9a9979ca91a7254056462a79d0187d00 Mon Sep 17 00:00:00 2001 From: Felix Triller Date: Wed, 24 Oct 2018 16:25:43 +0200 Subject: [PATCH 3/3] There is no device_class lock --- lib/homeassistant.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/homeassistant.js b/lib/homeassistant.js index d31c556690..540622611c 100644 --- a/lib/homeassistant.js +++ b/lib/homeassistant.js @@ -157,7 +157,7 @@ const configurations = { type: 'sensor', object_id: 'lock', discovery_payload: { - device_class: 'lock', + icon: 'mdi:lock', value_template: '{{ value_json.inserted }}', json_attributes: ['forgotten', 'keyerror'], },