From a7dc69963779022a2b3e7a973c626e6a2cb1e973 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Tue, 3 Oct 2023 16:36:12 +0300 Subject: [PATCH] Bump version to 0.1.9 --- package.json | 2 +- thermostat.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a2fe44b..d92c6f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vvzvlad/node-red-contrib-rn-combined-nodes", - "version": "0.1.8", + "version": "0.1.9", "description": "", "main": "index.js", "keywords": [ diff --git a/thermostat.js b/thermostat.js index e3ec668..4ca0c3d 100644 --- a/thermostat.js +++ b/thermostat.js @@ -130,12 +130,23 @@ module.exports = function(RED) { debug_text(`W-mode: ${window_mode}`) + + + let mqtt_control = topic.split('/') + if (mqtt_control.length === 3 && mqtt_control[0] === 'control') { + if (mqtt_control[2] === node.zone || mqtt_control[2] === node.zone + "_" + node.room || mqtt_control[2] === "all") { + if (mqtt_control[1] === "window_mode_control" || mqtt_control[1] === "heat_mode_control") { + topic = mqtt_control[1] + } + } + } + if (topic === "window_mode_control" && (payload === "cool" || payload === "heat" || payload === "off")) { window_mode = payload context.set("window_mode", window_mode) } - if (topic === "control" && (payload === "on" || payload === "off" || payload === "auto" || payload === "auto-predict")) { + if (topic === "heat_mode_control" && (payload === "on" || payload === "off" || payload === "auto" || payload === "auto-predict")) { control_mode = payload context.set("control_mode", control_mode) }