Thermostat - issue with event

Started by sparky, November 14, 2018, 08:09:34 PM

sparky

Felix,

I have a CT-80 which has been monitored and controlled thru the Gateway for a couple years now.  I have always noticed since installing the Gateway where the current temperature, while in Heat mode, is replaced with -1 deg Cooling, see attached.  This -1 cooling stays until the next polling.  I didn't notice it that often but after looking at the graph I see it happens quite often, see attached

This has never been an issue until now when I added one of your events which I modified to SMS me when the temperature drops below a certain temperature. 

temperatureSMSLimiter : { label:'THAlert : SMS Limited', icon:'comment', descr:'Send SMS when F<72°, once per hour', 
    serverExecute:function(node) { 
      if (node.metrics['F'] && node.metrics['F'].value < 72 && (Date.now() - node.metrics['F'].updated < 2000)) /*check if M metric exists and value is MOTION, received less than 2s ago*/
      {
        var approveSMS = false;
        if (node.metrics['F'].lastSMS) /*check if lastSMS value is not NULL ... */
        {
          if (Date.now() - node.metrics['F'].lastSMS > 1800000) /*check if lastSMS timestamp is more than 1hr ago*/
          {
            approveSMS = true;
          }
        }
        else
        {
          approveSMS = true;
        }
        
        if (approveSMS)
        {
          node.metrics['F'].lastSMS = Date.now();
          sendSMS('Temperature < 72° !', 'Temperature alert (<72°F!): [' + node._id + ':' + node.label.replace(/\{.+\}/ig, '') + '] @ ' + new Date().toLocaleTimeString());
          db.update({ _id: node._id }, { $set : node}, {}, function (err, numReplaced) { console.log('   ['+node._id+'] DB-Updates:' + numReplaced);}); /*save lastSMS timestamp to DB*/
        }
        else console.log('   ['+node._id+'] THAlert SMS skipped.');
      };
    }
  },


So the issue is now I'm getting false alerts every time the temperature reads -1 deg cooling.

I was wondering if you have ever noticed this?  You know of anything that I could try to resolve?

Thanks!

Jason

A "band aid" solution would be to check if the value is -1 and if it is to ignore that value.

     if (node.metrics['F'] && node.metrics['F'].value < 72 && node.metrics['F'].value != -1 && (Date.now() - node.metrics['F'].updated < 2000) )


Not a elegant solution but it would work at least for the short term.

sparky

#2
Thank you Jason.. I will give it a try.

Appreciate your input!

edit:  so far so good  ;D

sparky

Felix,

Jason helped me out a great deal getting rid of the irritating text messages but I still would like to know if you are experiencing the same on your thermostat readings and maybe what could be causing it.


Felix

I have seen this indeed in the past on the CT50. With me working on v9.0 I have not seen it again in over a month now, going back, I can see the -1 values in the graph.
Not sure what might have caused it.
I hope to release my 9.0 changes soon.