ok, here is what I am doing.
I have HomeSeer (z-wave hub) and Ambient Weather.
I can read both of these just fine, what I am trying to do is:
Check the thermostat to see if it is on/off
- if it is on then chart the Cooling Temp setting from the Thermostat on the chart with the inside and outside temps.
i.e. - Outside Temp - 60
Inside Temp - 80
Cooling Temp - 75, Fan On
What I want to see is a chart with all of the current Temps (Outside, Inside, Cooling (75)
if the Fan is off then set the Cooling Temp to 0 or simply not display it.
I think that my problem is the Fan returns a status of "On" or "Off" while the Thermostat returns a number - 75
Here is the function I am using -
context.data = context.data || {};
switch (msg.topic) {
case "BarnFan":
context.data.BarnFan = msg.payload;
node.warn("Fan Status Received")
msg = null;
break;
case "BarnCooling":
context.data.BarnCooling =msg.payload;
node.warn("Cooling Temp Received")
msg = null;
break;
default:
msg = null;
break;
}
if (context.data.task1 != null && context.data.task2 != null) {
node.warn("Both received")
if (context.data.task1 == "On") {
return {payload:0};
} else return {payload:context.data.BarnCooling};
} else return msg;