Node-red-contrib-zigbee2mqtt join in a function

Hi

If I have to Zigbee devices and i'm using a zigbee2mqtt "GET" node.
one for each device, how can I then wire em to the same "Function" node and set up a message?

atm. i'm using this to get the values I want from one "GET" node.
(But how can I add data from the other "GET" node, both is using "payload"..

msg.payload = { 
    chatId: xxxxxx,
    type: "message",
    content: "## Status på Temperatur ##\r\n" +
             "Temp:\r\n" +
             "Temperatur: " + msg.payload.temperature + "*C - " +
             "Fugtighed: " + msg.payload.humidity + "% - " +
             "Fugtighed: " + msg.payload.pressure + "hPa\r\n"
};

return msg;

I don't see the need for that node since I just use MQTT.

Hi what node?
I need to grep some data from two diffrent zigbee devices and join em together in a function, so I can send a message with Telegram-bot about the data from the two devices.

@TotallyInformation means you can use the built in mqtt in and out nodes, all you need is the mqtt topics. No need for zigbee2mqtt nodes.

As to your issue you will need to use context storage in the function and some if statements to check if the data has been stored and is available.
https://nodered.org/docs/user-guide/context

Alternatively you could use a join node prior to the function node, set it to manual and join as key value.
https://cookbook.nodered.org/basic/join-streams

2 Likes