I want to compute data in node-red based on data from several mqtt topics.
At first glance you can just put multiple mqtt nodes and use the "join" node, and this works on first deploy or first startup, but when redeploying (deploying only changed flows) you get errors on each message until each topic has published a new value:
"TypeError: Cannot read properties of undefined (reading 'split')"
I suspect this has to do with shared subscriptions under the covers. All my topics are retained so the data is there, it is just lost on redeploy of the flow.
RXJS has the operator combineLatest which is exactly what I want, but it seems complex to weave that in just for this.
I can of course work around this with a compute node to store the value in a flow variable for each mqtt node, but this is rather cumbersome.
Am I missing a technique here that makes this simple? Or is this actually just not easily possible right now in node-red?