Well, I'm back again, because it broke again ... and I fixed it somehow again.
I was playing around with my sensor to get it up and running the way I want it to and resetted its node id.
It couldn't get a new node ID and I was back where I was yesterday.
Deleted everything, rebuild the complete flow, restarted everything. Nothing helped. So I added debug messages everywhere and also had a look into the raw Serial protocol here: https://www.mysensors.org/download/serial_api_20
It looks like you don't need the encode and decode, at least for me the encode after myscontroller totally destroyed the payload. Why did it work yesterday? I have no idea.
The payload looked fine now without the decode and encode according to the protocol, but it still didn't work. I noticed that the incoming TCP payload always ended with a linefeed "\n", so I added a custom function between the myscontroller and tcp output to also add a linefeed to the outgoing payload and it's working again.
Hi @sotiriszegiannis, welcome to the MySensors community!
By gateway, do you mean a MySensors gateway, or something else? I am not familiar with the term ”node red gateway”.
There can be multiple MySensors gateways on the same lan.
There can be multiple Node Red installations on the same lan.
You're welcome!
I've used node red like you are doing for some times and it works well. Since around 1-2 years I'm using home assistant as controller, and node red for the logic in automations.
Home assistant makes life much easier, as it for example takes care of filling data into influxdb automatically
This seems to evaluate to true/undefined every time, effectively resetting the array:
var global_individual_data=global.get("global_invidual_data");
if (global_individual_data===undefined) {
msg.kein_array_vorhanden="true"
global_individual_data=[];
}
even though it's later set with
global.set("global_individual_data",global_individual_data);