From 45b7dc8e212487778c327d2631db78367f5b6c03 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Sat, 7 Jan 2017 22:48:51 +0000 Subject: [PATCH] graphing --- lib/mqtt/mqttClient.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/mqtt/mqttClient.js b/lib/mqtt/mqttClient.js index df6a7a3..0b442d3 100644 --- a/lib/mqtt/mqttClient.js +++ b/lib/mqtt/mqttClient.js @@ -42,8 +42,9 @@ const mqttClient = function(events) { const url = ['https://maker.ifttt.com/trigger/', mode, '/with/key/cWvECkeiyAPwmiOPBkXL2D'].join(''); if (mode !== globalMode) { - logger.info('Sending..'); + logger.info('Go for change state'); globalMode = mode; + logger.debug('Global Mode now A:', globalMode); /* Request(url, function (error, response, body) { logger.debug(response, body); }); */ @@ -95,7 +96,8 @@ const mqttClient = function(events) { if (globalMode === 'FanOff') { logger.info('Fans off, temp should be <= 19.5'); - mode = (parseFloat(this.livingRoom.temp) <= 19.5) ? 'FanOn' : 'FanOff'; + // mode = (parseFloat(this.livingRoom.temp) <= 19.5) ? 'FanOn' : 'FanOff'; + mode = (parseFloat(this.livingRoom.temp) <= 20.5) ? 'FanOn' : 'FanOff'; } else { logger.info('Fans on, temp should not be less than 22.5'); mode = (parseFloat(this.livingRoom.temp) <= 22.5) ? 'FanOn' : 'FanOff';