i would like to send a payload (svalue1) from node red via jason mqtt to domoticz.
At https://www.domoticz.com/wiki/Flows
are examples.
Th first example is to send Text to a virtuell Device.
inside the java function node is the following code:
Code: Select all
var dt = new Date();
var now = {
'month': dt.getMonth() + 1,
'day': dt.getDate(),
'year': dt.getFullYear(),
'hours': dt.getHours(),
'mins': dt.getMinutes(),
'msecs': dt.getMilliseconds()
};
msg.payload = {};
msg.payload.idx = 211;
msg.payload.svalue = "The time is now " + now.hours + ":" + now.mins;
return msg;
like this:
Code: Select all
var = inWirePayload;
msg.payload = {};
msg.payload.idx = 211;
msg.payload.svalue = inWirePayload;
return msg;
Im not familar with Java.
The purpose is to use the msg.payload and insert it into json string
Could somebody that using node-red to send values to domoticz held out?
Sorry ..i feel dump
