From dd1fe56f0de57cca9a088b220ad3ad6283888b24 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Tue, 1 Dec 2020 11:23:25 +0100 Subject: [PATCH] fix: discover values after node ready --- lib/Gateway.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Gateway.js b/lib/Gateway.js index 5a1b66198ba..5d4789946dc 100755 --- a/lib/Gateway.js +++ b/lib/Gateway.js @@ -230,6 +230,13 @@ function onValueChanged (valueId, node, changed) { this.zwave.sendToSocket(this.zwave.socketEvents.valueUpdated, valueId) } + const isDiscovered = this.discovered[valueId.id] + + // check if this value isn't discovered yet (values added after node is ready) + if (this.config.hassDiscovery && !isDiscovered) { + this.discoverValue(node, valueId.id.replace(valueId.nodeId + '-', '')) + } + const result = this.valueTopic(node, valueId, true) if (!result) return