diff --git a/hardware/duino/97-duino.js b/hardware/duino/97-duino.js index 7a47580d..1302b336 100644 --- a/hardware/duino/97-duino.js +++ b/hardware/duino/97-duino.js @@ -23,8 +23,12 @@ function DuinoNode(n) { RED.nodes.createNode(this,n); this.pin = n.pin || "10"; node = this; - this.board = new duino.Board(); - + try { + this.board = new duino.Board(); + } + catch { + util.log("[duino] - Error establishing board connection!"); + } this.on("input", function(message) { if (typeof(message.payload) == "string") { diff --git a/hardware/heatmiser/100-heatmiser.html b/hardware/heatmiser/100-heatmiser.html index 8ce54a5d..c1ee3c8d 100644 --- a/hardware/heatmiser/100-heatmiser.html +++ b/hardware/heatmiser/100-heatmiser.html @@ -27,6 +27,10 @@ +
+ + +
Expects a msg.payload with a JSON object that contains settings for the Heatmiser thermostat
diff --git a/hardware/heatmiser/100-heatmiser.js b/hardware/heatmiser/100-heatmiser.js index 432d5e65..7e817d9e 100644 --- a/hardware/heatmiser/100-heatmiser.js +++ b/hardware/heatmiser/100-heatmiser.js @@ -21,10 +21,11 @@ var util = require('util'); function HeatmiserNode(n) { // TODO - holiday and hot water cases when confirmed working - var DEBUG = true; + var DEBUG = false; RED.nodes.createNode(this,n); this.ip = n.ip || "192.168.0.1"; this.pin = n.pin || "1234"; + this.pollTime = n.pollTime*60*1000 || 30*60*1000 this.multiWriteFunc = undefined; node = this; @@ -40,7 +41,7 @@ function HeatmiserNode(n) { node.multiWriteFunc = undefined; return; } - node.send(data.dcb); + node.send({topic: "", payload:JSON.stringify(data.dcb)}); }); this.hm.on('error', function(data) { if (DEBUG) { @@ -57,7 +58,7 @@ function HeatmiserNode(n) { if (!this.currentStatus) { this.read(); - setInterval(this.read, 30000); + setInterval(this.read, this.pollTime); } this.write = function(dcb) {