Multiple Output Issue

I'm trying to join messages on the first trigger I only get one output, and the second I get 4

How to I Modify the flow so that I only get 1 output all the time?

and for the record, just starting out with Node-Red :slight_smile:

Thanks for any assistance

Here is current Flow

[{"id":"437eba92.ecec0c","type":"tab","label":"Flow 8","disabled":false,"info":""},{"id":"c400a9c4.73f2","type":"mqtt in","z":"437eba92.ecec0c","name":"Shelly-DW2-State","topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/state","qos":"0","datatype":"auto","broker":"d8008000.6ed7d","x":210,"y":180,"wires":[["21ac7796.29f1e"]]},{"id":"b8b3f864.171bc","type":"mqtt in","z":"437eba92.ecec0c","name":"Shelly-DW2-LUX","topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/lux","qos":"0","datatype":"auto","broker":"d8008000.6ed7d","x":200,"y":240,"wires":[["9cefa657.dc5788"]]},{"id":"d3497056.5407d8","type":"mqtt in","z":"437eba92.ecec0c","name":"Shelly-DW2-Battery","topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/battery","qos":"0","datatype":"auto","broker":"d8008000.6ed7d","x":210,"y":360,"wires":[["63291b89.744b64"]]},{"id":"b4c810c.ee090f","type":"mqtt in","z":"437eba92.ecec0c","name":"Shelly-DW2-Temp","topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/temperature","qos":"0","datatype":"auto","broker":"d8008000.6ed7d","x":210,"y":300,"wires":[["2e0a609c.9e5538"]]},{"id":"21ac7796.29f1e","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"state","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":180,"wires":[["1deb281.e73afd8"]]},{"id":"9cefa657.dc5788","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"lux","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":240,"wires":[["1deb281.e73afd8"]]},{"id":"2e0a609c.9e5538","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"temp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":300,"wires":[["1deb281.e73afd8"]]},{"id":"63291b89.744b64","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"battery","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":360,"wires":[["1deb281.e73afd8"]]},{"id":"1deb281.e73afd8","type":"join","z":"437eba92.ecec0c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":630,"y":280,"wires":[["da68a8e7.243088","ef8dd9ba.ff997","186e58d6.b28fc7"]]},{"id":"da68a8e7.243088","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"DoorStatus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":360,"wires":[[]]},{"id":"186e58d6.b28fc7","type":"debug","z":"437eba92.ecec0c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":200,"wires":[]},{"id":"ef8dd9ba.ff997","type":"debug","z":"437eba92.ecec0c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":160,"wires":[]},{"id":"d8008000.6ed7d","type":"mqtt-broker","name":"","broker":"192.168.1.176","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Every thing is working as it should. the first time through the join node needs 4 inputs before it will pass on joined message, after that it will add any new message to existing and then pass on. if you wish it to wait for another 4, just uncheck "every subsequent message".

you can also use wildcards and split topic , check my example

[{"id":"c400a9c4.73f2","type":"mqtt in","z":"437eba92.ecec0c","name":"Shelly-DW2-State","topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/#","qos":"0","datatype":"auto","broker":"d8008000.6ed7d","x":210,"y":180,"wires":[["21ac7796.29f1e"]]},{"id":"21ac7796.29f1e","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"$split(topic,\"/\")[-1]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":180,"wires":[["1deb281.e73afd8"]]},{"id":"1deb281.e73afd8","type":"join","z":"437eba92.ecec0c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":180,"wires":[["da68a8e7.243088","ef8dd9ba.ff997","186e58d6.b28fc7"]]},{"id":"654dbc8d.5dcccc","type":"inject","z":"437eba92.ecec0c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/state","payload":"open","payloadType":"str","x":210,"y":240,"wires":[["21ac7796.29f1e"]]},{"id":"f7078b29.590f88","type":"inject","z":"437eba92.ecec0c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/lux","payload":"250","payloadType":"str","x":210,"y":280,"wires":[["21ac7796.29f1e"]]},{"id":"4f5ef5ac.1aadfc","type":"inject","z":"437eba92.ecec0c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/temp","payload":"25","payloadType":"str","x":210,"y":320,"wires":[["21ac7796.29f1e"]]},{"id":"b145e05d.a489a","type":"inject","z":"437eba92.ecec0c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"shellies/shellydw2-XXXXXXXXXXX/sensor/battery","payload":"89","payloadType":"str","x":210,"y":360,"wires":[["21ac7796.29f1e"]]},{"id":"da68a8e7.243088","type":"change","z":"437eba92.ecec0c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"DoorStatus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":240,"wires":[[]]},{"id":"ef8dd9ba.ff997","type":"debug","z":"437eba92.ecec0c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":160,"wires":[]},{"id":"186e58d6.b28fc7","type":"debug","z":"437eba92.ecec0c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":200,"wires":[]},{"id":"d8008000.6ed7d","type":"mqtt-broker","name":"","broker":"192.168.1.176","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

i added injects just for testing

Thanks, E1cid

That worked like a charm

Always comes down to one check mark lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.