From d0d44a9f15a86ab1a28bec4acfd6ad9ef2983072 Mon Sep 17 00:00:00 2001 From: Harrie de Groot Date: Tue, 11 May 2021 00:24:47 +0200 Subject: [PATCH] HA Discovery: cover position template fix ISSUE: https://github.com/harriedegroot/nl.hdg.mqtt/issues/56 --- dispatchers/HomeAssistantDispatcher.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dispatchers/HomeAssistantDispatcher.js b/dispatchers/HomeAssistantDispatcher.js index bd391cb..b32081a 100644 --- a/dispatchers/HomeAssistantDispatcher.js +++ b/dispatchers/HomeAssistantDispatcher.js @@ -651,7 +651,7 @@ class HomeAssistantDispatcher { const payload = { name: device.name, unique_id: `${device.id}_${type}`, - value_template: '{{ value }}', + //value_template: '{{ value }}', }; const hasState = capabilities.hasOwnProperty('windowcoverings_state'); @@ -676,6 +676,7 @@ class HomeAssistantDispatcher { if (position) { const positonTopic = this.normalize ? normalize(position) : position; payload.position_topic = `${stateTopic}/${positonTopic}`; + payload.position_template = '{{ value }}', payload.position_closed = capabilities[position].min || 0; payload.position_open = capabilities[position].max || 100; if (capabilities[position].setable) {