Hi Sam,
I take a look at that code. I can read it. ;) But can’t find the answer.
This are my thougts. From start() I send
this.sendSocketNotification('CONFIG', this.config);
The this.config
payload is needed at the node_helper.js at two places. One to figure out the csv file and do the MQTT stuff.
CSVToJSON({ ignoreEmpty: true, trim: true })
.fromFile(CSVfile)
.then((jsonObj) => {
//console.log(jsonObj);
this.subscriptions = (jsonObj); //JSON.parse
this.setconfig(payload);
})
I forward the this.config
to the MQTT function. The array subscriptions
is available there. At the MQTT function:
self.sendSocketNotification('MQTT_PAYLOAD', {
topic: topic,
value: value,
subs: self.subscriptions
)};
These payloads arrived within the function at the module file. But I can not use the payload outside of that specific function.
I am not a programmer as you can see…just using reverse engineering and read a lot of configurations. I am almost there, I think.
Regards,
Bert