A suggestion, pass the sensor ID. You can do it very easily by editing 98-ds18b20.js and between the lines:
var msg = { payload: value }; node.send(msg);
add a new line so you have
var msg = { payload: value };
msg.sensorid = node.sensorid;
node.send(msg);
Very simple case. Let's say you have multiple sensors and want to display the sensorid and the temperature in the debug log. Currently you would have the
ds18b20(sensor1) node->function (to add sensor1 ID to the payload)->debug
ds18b20(sensor2) node->function (to add sensor2 ID to the payload)->debug
if you pass the sensorid you could have
ds18b20(sensor1) node\
--->function (to add the ID to the payload)->debug
ds18b20(sensor2) node/
A suggestion, pass the sensor ID. You can do it very easily by editing 98-ds18b20.js and between the lines:
var msg = { payload: value }; node.send(msg);
add a new line so you haveVery simple case. Let's say you have multiple sensors and want to display the sensorid and the temperature in the debug log. Currently you would have the
if you pass the sensorid you could have
making the flow more compact and reusable.