How to use the publish function from mqtt
Find comprehensive JavaScript mqtt.publish code examples handpicked from public code repositorys.
GitHub: vasinov/neural-lambda
135 136 137 138 139 140 141 142 143 144
var dataPoint = reading.values, outputTopic = config.mqtt.outputTopic + "/" + reading.device_id; if (dataPoint.t > config.alarm.maxTemp || dataPoint.p > config.alarm.maxPressure) { mqtt.publish( outputTopic, { alarm: 1, values: dataPoint } ); } else { alarm.train(trainingData);
0
7
1
+ 3 other calls in file
mqtt.connect is the most popular function in mqtt (440 examples)