node-red-contrib-simple-thermostat
v1.2.0
Published
A node that compares msg.payload to a target value and returns a new msg.payload such as 'off' or 'on'. Supports the result of InfluxDB queries such as `SELECT MEAN(value) FROM "My meaurement" WHERE time > now() - 2m`
Downloads
81
Readme
node-red-simple-thermostat
A node that compares msg.payload to a target value and returns a new msg.payload such as 'off' or 'on'
Supports the result of InfluxDB queries such as SELECT MEAN(value) FROM "My meaurement" WHERE time > now() - 2m
An example showing use with InfluxDB:
[{"id":"6d8f6b5e.eac0ec","type":"inject","z":"881ea337.165d78","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":true,"onceDelay":0.1,"x":510,"y":400,"wires":[["4564ef42.ddd378"]]},{"id":"4564ef42.ddd378","type":"function","z":"881ea337.165d78","name":"Get most recent readings from influx","func":"msg.query = `SELECT MEAN(value) FROM\n\"My Measurement\"\nWHERE time > \nnow() - 2m`;\nreturn msg;","outputs":1,"noerr":0,"x":630,"y":440,"wires":[["6b8a41e8.34aba"]]},{"id":"6b8a41e8.34aba","type":"influxdb in","z":"881ea337.165d78","influxdb":"e23ab0d9.797fc","name":"","query":"","rawOutput":false,"precision":"","retentionPolicy":"","x":770,"y":480,"wires":[["dcf443e4.9e1238"]]},{"id":"dcf443e4.9e1238","type":"simple thermostat","z":"881ea337.165d78","name":"","target":"5","ifAbove":"OFF","ifBelow":"ON","equal":"","default":"NO READINGS","x":960,"y":520,"wires":[["b887614a.a48f88"]]},{"id":"b887614a.a48f88","type":"function","z":"881ea337.165d78","name":"","func":"node.warn(msg.payload);","outputs":1,"noerr":0,"x":1110,"y":560,"wires":[[]]},{"id":"e23ab0d9.797fc","type":"influxdb","z":"","hostname":"localhost","port":"8086","protocol":"http","database":"database","name":"influx","usetls":false,"tls":""}]