I have a water meter with a webcam connected to a raspberry. The software in raspberry sends out a mqtt payload that I want node-red to translate and update a meter in domoticz.
But I cannot figure out how to get their values in node-red so its suits to a json.htm command.
This is the output:
Code: Select all
plutonium@slackware:~$ mosquitto_sub -v -t /#
/lusa/misc-1/WATER_METER_FLOW/status {"type":"METER_VALUE","update_time":1450629599000,"value":0.00,"unit":"l/m"}
/lusa/misc-1/WATER_METER_10MIN/status {"type":"METER_VALUE","update_time":1450629899000,"value":0.00,"unit":"l/10m"}
/lusa/misc-1/WATER_METER_TOTAL/status {"type":"METER_VALUE","update_time":1450629539000,"value":36049.50,"unit":"l"}
/lusa/misc-1/WATER_METER_DRAIN/status {"type":"METER_VALUE","update_time":1450629539000,"value":168.00,"unit":"l"}
I'm stuck and do not know how I should proceed.
Code: Select all
var pwJSON = JSON.parse(msg.payload);
msg.url = "http://127.0.0.1/json.htm?type=command¶m=udevice&idx=53&nvalue="+pwJSON.value;
return msg;