Passing through input message stops join node

Hello!

I was wondering whether anyone could take a look at the below and let me know what I'm doing wrong please?

I am using the join node to combine each complete message to create a key/value object. I am sending the message once I have 3 message parts (as I have 3 readings incoming). As I'm using the HTTP nodes, it's necessary for me to select 'input message pass through' on the KNX nodes to ensure that the HTTP response node works.

Unfortunately when I have 3 message parts entered into the join node, the KNX readings stop after 2. Likewise if I reduce it to 2, they stop after 1. I have narrowed down the issue to passing through the input message..... if I deselect this the join node works fine but of course the HTTP response node fails.

Is there any way around this, or alternatively, can I pass the response object to the HTTP response node without running it through the KNX node?

Cheers,
Ben

[{"id":"79f69507.cb9bc4","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"19f1ce0a.daff5a","type":"inject","z":"79f69507.cb9bc4","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":150,"y":220,"wires":[["1aa2bcd8.e85d6b","ba5098bb.2b1038","983b5976.f17428"]]},{"id":"1aa2bcd8.e85d6b","type":"knxUltimate","z":"79f69507.cb9bc4","server":"7a3e0296.83bffc","topic":"13/5/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed3","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":430,"y":200,"wires":[["d70fea34.60bab"]]},{"id":"ba5098bb.2b1038","type":"knxUltimate","z":"79f69507.cb9bc4","server":"7a3e0296.83bffc","topic":"14/0/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed4","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":430,"y":260,"wires":[["d70fea34.60bab"]]},{"id":"2bf8a04e.8b8ff8","type":"debug","z":"79f69507.cb9bc4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1010,"y":360,"wires":[]},{"id":"cbe4057f.8f04c8","type":"change","z":"79f69507.cb9bc4","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":260,"wires":[["2bf8a04e.8b8ff8","d070b28.d456ad"]]},{"id":"97d3cdc9.e6ec7","type":"debug","z":"79f69507.cb9bc4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":360,"wires":[]},{"id":"d070b28.d456ad","type":"http response","z":"79f69507.cb9bc4","name":"","statusCode":"","headers":{},"x":1050,"y":260,"wires":[]},{"id":"983b5976.f17428","type":"knxUltimate","z":"79f69507.cb9bc4","server":"7a3e0296.83bffc","topic":"11/1/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Gym","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":430,"y":320,"wires":[["28dd90bd.6f9b28","d70fea34.60bab"]]},{"id":"28dd90bd.6f9b28","type":"debug","z":"79f69507.cb9bc4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":360,"wires":[]},{"id":"d70fea34.60bab","type":"join","z":"79f69507.cb9bc4","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":650,"y":260,"wires":[["97d3cdc9.e6ec7","cbe4057f.8f04c8"]]},{"id":"4ba52dbd.ff3504","type":"http in","z":"79f69507.cb9bc4","name":"","url":"mode-query","method":"get","upload":false,"swaggerDoc":"","x":150,"y":280,"wires":[["1aa2bcd8.e85d6b","ba5098bb.2b1038","983b5976.f17428","9132ae0c.8e399"]]},{"id":"9132ae0c.8e399","type":"debug","z":"79f69507.cb9bc4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":170,"y":360,"wires":[]},{"id":"7a3e0296.83bffc","type":"knxUltimate-config","z":"","host":"192.168.6.15","port":"3671","physAddr":"15.15.22","suppressACKRequest":false,"csv":"","KNXEthInterface":"Auto","KNXEthInterfaceManuallyInput":"","statusDisplayLastUpdate":false,"statusDisplayDeviceNameWhenALL":false,"statusDisplayDataPoint":false,"name":"Local KNX-IP","localEchoInTunneling":false,"delaybetweentelegrams":"","delaybetweentelegramsfurtherdelayREAD":""}]

This might work ....

  1. Disconnect the http in from the three knx nodes (whatever they are)
  2. Connect the http in to a function node containing simply return {} (that should be enough to trigger the Inc nodes). join this function to the three knx nodes
  3. Connect the http in also to the join node
  4. Set the join node to expect 4 parts.

Now the output of the join should contain the http stuff and the knx results.

summary...

Http in -> function node & join

Function node > the three knx nodes

Join node set to 4 parts.

... Or at least give you an idea?

Hi Steve.

Thanks for this. I'd tried something similar without the additional function node but unfortunately your suggestion yields the same error on the join node:

Message missing key property 'msg.topic' - cannot add to object

I guess I can somehow add an arbitrary topic to make the http stuff acceptable to the the join node?

Out of interest, what is the function node with return {} achieving? Is there any difference between your suggestion and my earlier attempt of joining the HTTP in to the three KNX nodes and the join node?

Thanks,
Ben

That was to send a msg (an object) but NOT include the HTTP stuff.

{} is enough to trigger a msg to flow down a wire.

As i dont know the KNX nodes - I assumed they would generate a topic - so you will have to give then 3 KNX triggers a topic (if the KNX node doesn't add a topic or let you enter a topic in its UI)

I'll put together a demo flow of why i suggested this method - gimmie 2 mins.

So I tried knocking up a demo but alas it crashes node red :grimacing:

My guess is the join node doesnt like the http msg.

Only thing I can think of is this workaround...

[{"id":"ac84f07a.34c0f","type":"inject","z":"7b57d2de.05cecc","name":"Mode check","repeat":"","crontab":"","once":false,"onceDelay":"55","topic":"","payload":"true","payloadType":"bool","x":150,"y":220,"wires":[["a7c20a22.78e358"]]},{"id":"fbf3be99.f9869","type":"http response","z":"7b57d2de.05cecc","name":"","statusCode":"","headers":{"content-type":"application/json"},"x":970,"y":340,"wires":[]},{"id":"748245a4.48576c","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":170,"y":360,"wires":[]},{"id":"c998b94f.765c68","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":220,"wires":[["d2352eac.c580f"]]},{"id":"a7c20a22.78e358","type":"function","z":"7b57d2de.05cecc","name":"store msg + trigger knx","func":"var msg1 = {\n    topic: \"knx1\"\n}\nvar msg2 = {\n    topic: \"knx2\"\n}\nvar msg3 = {\n    topic: \"knx3\"\n}\n\nflow.set(\"httpmsg\", msg)\n\nreturn [msg1, msg2, msg3];","outputs":3,"noerr":0,"initialize":"","finalize":"","x":380,"y":260,"wires":[["c998b94f.765c68"],["4377ccdd.07efa4"],["98c2ee77.6f11a"]]},{"id":"4377ccdd.07efa4","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 2\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":260,"wires":[["d2352eac.c580f"]]},{"id":"98c2ee77.6f11a","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 3\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":300,"wires":[["d2352eac.c580f"]]},{"id":"77695567.d51d6c","type":"http in","z":"7b57d2de.05cecc","name":"","url":"/query","method":"get","upload":false,"swaggerDoc":"","x":130,"y":280,"wires":[["748245a4.48576c","a7c20a22.78e358"]]},{"id":"d72b4621.453c98","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":380,"wires":[]},{"id":"d2352eac.c580f","type":"join","z":"7b57d2de.05cecc","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":750,"y":260,"wires":[["f187a2f.37a7b6"]]},{"id":"f187a2f.37a7b6","type":"function","z":"7b57d2de.05cecc","name":"add to http msg","func":"var httpmsg = flow.get(\"httpmsg\");\nhttpmsg.payload = msg.payload;\n\nreturn httpmsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":340,"wires":[["fbf3be99.f9869","d72b4621.453c98"]]}]

@dceejay sorry for the tagging - is a circular crash expected when feeding a http in msg to a join node while waiting for other results (as per my first 2 screen shots above?)

@Steve-Mcl well not really, but http res and req always do have circular refs in, so whatever we are doing in join isn’t liking it. So yes please raise an issue including the failing flow. Thanks

1 Like

Sorry, I was a wee bit premature - the error is occurring in the http out node

I was effectively feeding a malformed msg into the http out...

[{"id":"ac84f07a.34c0f","type":"inject","z":"7b57d2de.05cecc","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":150,"y":220,"wires":[["a7c20a22.78e358"]]},{"id":"fbf3be99.f9869","type":"http response","z":"7b57d2de.05cecc","name":"","statusCode":"","headers":{"content-type":"application/json"},"x":790,"y":320,"wires":[]},{"id":"748245a4.48576c","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":170,"y":360,"wires":[]},{"id":"c998b94f.765c68","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":180,"wires":[["d2352eac.c580f"]]},{"id":"a7c20a22.78e358","type":"function","z":"7b57d2de.05cecc","name":"fan out","func":"var msg1 = {\n    topic: \"knx1\"\n}\nvar msg2 = {\n    topic: \"knx2\"\n}\nvar msg3 = {\n    topic: \"knx3\"\n}\n\nmsg.topic = \"http\" //add topic to http msg\nreturn [msg1, msg2, msg3, msg];","outputs":4,"noerr":0,"x":330,"y":260,"wires":[["c998b94f.765c68"],["4377ccdd.07efa4"],["98c2ee77.6f11a"],["d2352eac.c580f"]]},{"id":"4377ccdd.07efa4","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 2\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":220,"wires":[["d2352eac.c580f"]]},{"id":"98c2ee77.6f11a","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 3\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":260,"wires":[["d2352eac.c580f"]]},{"id":"77695567.d51d6c","type":"http in","z":"7b57d2de.05cecc","name":"","url":"/query","method":"get","upload":false,"swaggerDoc":"","x":130,"y":280,"wires":[["748245a4.48576c","a7c20a22.78e358"]]},{"id":"d72b4621.453c98","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":280,"wires":[]},{"id":"d2352eac.c580f","type":"join","z":"7b57d2de.05cecc","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":630,"y":320,"wires":[["d72b4621.453c98","fbf3be99.f9869"]]}]

image

...so it was my fault - still worth adding an issue dave?

@element22 this solution works better (no storing of the http msg in flow context)...

[{"id":"ac84f07a.34c0f","type":"inject","z":"7b57d2de.05cecc","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":170,"y":140,"wires":[["a7c20a22.78e358"]]},{"id":"fbf3be99.f9869","type":"http response","z":"7b57d2de.05cecc","name":"","statusCode":"","headers":{"content-type":"application/json"},"x":890,"y":280,"wires":[]},{"id":"748245a4.48576c","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":190,"y":280,"wires":[]},{"id":"c998b94f.765c68","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 1\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":100,"wires":[["d2352eac.c580f"]]},{"id":"a7c20a22.78e358","type":"function","z":"7b57d2de.05cecc","name":"fan out","func":"var msg1 = {\n    topic: \"knx1\"\n}\nvar msg2 = {\n    topic: \"knx2\"\n}\nvar msg3 = {\n    topic: \"knx3\"\n}\n\nmsg.topic = \"http\" //add topic to http msg\nreturn [msg1, msg2, msg3, msg];","outputs":4,"noerr":0,"x":350,"y":180,"wires":[["c998b94f.765c68"],["4377ccdd.07efa4"],["98c2ee77.6f11a"],["d2352eac.c580f"]]},{"id":"4377ccdd.07efa4","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 2\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":140,"wires":[["d2352eac.c580f"]]},{"id":"98c2ee77.6f11a","type":"function","z":"7b57d2de.05cecc","name":"fake KNX","func":"msg.payload = 3\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":180,"wires":[["d2352eac.c580f"]]},{"id":"77695567.d51d6c","type":"http in","z":"7b57d2de.05cecc","name":"","url":"/query","method":"get","upload":false,"swaggerDoc":"","x":150,"y":200,"wires":[["748245a4.48576c","a7c20a22.78e358"]]},{"id":"d72b4621.453c98","type":"debug","z":"7b57d2de.05cecc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":790,"y":240,"wires":[]},{"id":"d2352eac.c580f","type":"join","z":"7b57d2de.05cecc","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":650,"y":240,"wires":[["d72b4621.453c98","2dc04abf.da3446"]]},{"id":"2dc04abf.da3446","type":"change","z":"7b57d2de.05cecc","name":"","rules":[{"t":"delete","p":"payload.http","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":280,"wires":[["fbf3be99.f9869"]]}]

Hi Steve,

Thanks for your help but still no luck unfortunately and I have the same problem when using your solution so I think it's something unique to the KNX/http/join combination which you can't replicate at your end.

The only way I can get a message out of the join node is to either:

  1. Manually trigger the flow via the inject node
  2. Disconnect the http going into the join node (obviously breaks http out)

I don't know whether there's a further debug mode but it feels like the flow is stopping at the join node when it has a combination of the KNX messages and a http message (http message received directly as an input or via KNX node passing it through -- see later diagrams).

The topic error message from the join node which I posted last night was due to passing the http in to the join without a topic (it was set to use msg.topic as the key) but once I add a topic to the http in node it silently stops in exactly the same way as it does if I tell the KNX node to pass the incoming message through.

Interestingly enough, if I tell the join node to combine each payload as a key/value object then it works fine so I have further narrowed this down to the join node combining each complete message as a key value object.

Combining each payload (works):

**Combining each complete message and passing HTTP via KNX - set within KNX node (doesn't work): **

Taking HTTP around KNX node to rule that out - KNX node told not to pass incoming message (doesn't work)
I'll have to upload this in another post.

What I can't get my head around, using the last diagram as an example, is that if I tell the join node to send the message after 4 message parts, it stops after (presumably) three messages (HTTP, Bed3, Bed4). If I change the join node to 3, it sops after (presumably) two messages (HTTP and Bed3). Here I can only go off what I can see on the screen so it may not be entirely accurate but the flow is definitely stopping with that identifiable pattern.

It's plausible that I'm barking up the wrong tree but I currently think it's a combination of joining the complete message as an key/value object, when there is any http in data involved (res/req).

Cheers,
Ben

[{"id":"ec867455.57c7a","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"6c4d2df4.1c29f4","type":"inject","z":"ec867455.57c7a","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":310,"y":40,"wires":[["874c8939.75a4e","bedced6d.183fa","68684504.a0fd14"]]},{"id":"874c8939.75a4e","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"12/1/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Kitchen","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"yes","x":500,"y":40,"wires":[["7f2c2e61.92b018"]]},{"id":"bedced6d.183fa","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"12/3/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Snug","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"yes","x":490,"y":100,"wires":[["7f2c2e61.92b018"]]},{"id":"c6c6c973.337b88","type":"debug","z":"ec867455.57c7a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":120,"wires":[]},{"id":"3cd7ed9a.18c8ea","type":"change","z":"ec867455.57c7a","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":80,"wires":[["c6c6c973.337b88","72348349.22af04"]]},{"id":"2627f8ff.fb3438","type":"http in","z":"ec867455.57c7a","name":"","url":"/mode-check","method":"get","upload":false,"swaggerDoc":"","x":290,"y":120,"wires":[["874c8939.75a4e","bedced6d.183fa","68684504.a0fd14"]]},{"id":"7f2c2e61.92b018","type":"join","z":"ec867455.57c7a","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"devicename","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":730,"y":80,"wires":[["f5d93fdb.39c638","3cd7ed9a.18c8ea"]]},{"id":"f5d93fdb.39c638","type":"debug","z":"ec867455.57c7a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":730,"y":120,"wires":[]},{"id":"72348349.22af04","type":"http response","z":"ec867455.57c7a","name":"","statusCode":"","headers":{},"x":1110,"y":80,"wires":[]},{"id":"68684504.a0fd14","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"13/4/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed1","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"yes","x":490,"y":160,"wires":[["7f2c2e61.92b018"]]},{"id":"d43967ea.10b1b8","type":"comment","z":"ec867455.57c7a","name":"THIS WORKS - COMBINING EACH PAYLOAD","info":"","x":670,"y":220,"wires":[]},{"id":"dbfe6bcb.d2914","type":"inject","z":"ec867455.57c7a","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":310,"y":440,"wires":[["a1bb5ba6.9e4b18","a02ab074.aa7368","61289a07.dd061c"]]},{"id":"a1bb5ba6.9e4b18","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"13/5/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed3","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"yes","x":490,"y":420,"wires":[["c68f5db6.44a568"]]},{"id":"a02ab074.aa7368","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"14/0/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed4","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":490,"y":480,"wires":[["c68f5db6.44a568"]]},{"id":"af43a624.729f8","type":"debug","z":"ec867455.57c7a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":520,"wires":[]},{"id":"57487284.1f8374","type":"change","z":"ec867455.57c7a","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":480,"wires":[["af43a624.729f8","a16668ae.d9cc18"]]},{"id":"b8b8cd0f.36cdd","type":"debug","z":"ec867455.57c7a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":730,"y":520,"wires":[]},{"id":"a16668ae.d9cc18","type":"http response","z":"ec867455.57c7a","name":"","statusCode":"","headers":{},"x":1130,"y":480,"wires":[]},{"id":"61289a07.dd061c","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"11/1/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Gym","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":490,"y":540,"wires":[["c68f5db6.44a568"]]},{"id":"c68f5db6.44a568","type":"join","z":"ec867455.57c7a","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":730,"y":480,"wires":[["b8b8cd0f.36cdd","57487284.1f8374"]]},{"id":"37980b7a.f44b44","type":"http in","z":"ec867455.57c7a","name":"","url":"mode-query","method":"get","upload":false,"swaggerDoc":"","x":290,"y":520,"wires":[["a1bb5ba6.9e4b18","a02ab074.aa7368","61289a07.dd061c"]]},{"id":"7cc05eee.876838","type":"comment","z":"ec867455.57c7a","name":"THIS FAILS - COMBINING EACH COMPLETE MESSAGE WHILST PASSING HTTP VIA KNX NODE","info":"","x":810,"y":600,"wires":[]},{"id":"3771936.cd91b6c","type":"change","z":"ec867455.57c7a","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"webtopic","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":900,"wires":[["abe44d62.c2aff8"]]},{"id":"5d86c415.2a6f9c","type":"inject","z":"ec867455.57c7a","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":310,"y":740,"wires":[["48152228.20892c","60d67dda.e28474","a6c30098.7f22f"]]},{"id":"48152228.20892c","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"13/5/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed3","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":490,"y":720,"wires":[["abe44d62.c2aff8"]]},{"id":"60d67dda.e28474","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"14/0/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Bed4","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":490,"y":780,"wires":[["abe44d62.c2aff8"]]},{"id":"435256db.86099","type":"debug","z":"ec867455.57c7a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":820,"wires":[]},{"id":"f06c61c4.0c1e1","type":"change","z":"ec867455.57c7a","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":780,"wires":[["435256db.86099","4dc7f296.d94aac"]]},{"id":"607a0b92.2fe7e4","type":"debug","z":"ec867455.57c7a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":730,"y":820,"wires":[]},{"id":"4dc7f296.d94aac","type":"http response","z":"ec867455.57c7a","name":"","statusCode":"","headers":{},"x":1130,"y":780,"wires":[]},{"id":"a6c30098.7f22f","type":"knxUltimate","z":"ec867455.57c7a","server":"7a3e0296.83bffc","topic":"11/1/7","outputtopic":"","dpt":"20.102","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"","listenallga":false,"name":"Gym","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":490,"y":840,"wires":[["abe44d62.c2aff8"]]},{"id":"abe44d62.c2aff8","type":"join","z":"ec867455.57c7a","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":730,"y":780,"wires":[["607a0b92.2fe7e4","f06c61c4.0c1e1"]]},{"id":"5196e004.4d748","type":"http in","z":"ec867455.57c7a","name":"","url":"mode-query2","method":"get","upload":false,"swaggerDoc":"","x":290,"y":820,"wires":[["48152228.20892c","60d67dda.e28474","a6c30098.7f22f","3771936.cd91b6c"]]},{"id":"1464c1d8.6f250e","type":"comment","z":"ec867455.57c7a","name":"THIS FAILS - TAKING HTTP AROUND KNX NODE","info":"","x":680,"y":960,"wires":[]},{"id":"7a3e0296.83bffc","type":"knxUltimate-config","z":"","host":"192.168.6.15","port":"3671","physAddr":"15.15.22","suppressACKRequest":false,"csv":"","KNXEthInterface":"Auto","KNXEthInterfaceManuallyInput":"","statusDisplayLastUpdate":false,"statusDisplayDeviceNameWhenALL":false,"statusDisplayDataPoint":false,"name":"Local KNX-IP","localEchoInTunneling":false,"delaybetweentelegrams":"","delaybetweentelegramsfurtherdelayREAD":""}]

This is the third flow as referenced in my previous post where I tried taking the HTTP in around the KNX nodes but that didn't seem to make any difference.

Questions...

  • What is the error you get?
  • Do the KNX nodes add a topic to the message (a topic is needed to join messages)?
  • Is the join set for 4 parts?
  • Why are you setting headers in a change node & not just setting them in the http out node?

NOTE:
As described in previous post, the joining causes the HTTP In msg to be added to the payload and causes a circular error - try adding a change node before the HTTP Out to delete the http in msg from payload (as i did in last working example)

EDIT...
To clarify: this response is to the "I tried taking the HTTP in around the KNX nodes" version of your flow in the prior post (not the other other post :wink: )

Hi Steve,

I am not getting an error that I can visibly see. The symptoms are:

  1. The join node does not output anything (I can see this from the debug)
  2. When telling the join to wait for three messages, only two KNX reads are undertaken (in the below pic, read on the Gym node means that it hasn't read yet -- unlike Bed3 and Bed4). As described earlier, if I change the amount of messages the join node is waiting for, the amount of KNX reads which are taken changes accordingly.

image

Yes. They use the group address as default (13/5/7 for example). I know this is working as in the example where I sent the HTTP in directly to the join node, the join node returned an error stating that no topic was present.

Yes.

I followed the example flow within the HTTP documentation but I don't think this is relevant -- the message isn't getting past the join node.

Sure -- same result. There is no output from the join node.

Understood and thanks. My post was flagged for review so they ended up in the wrong order :wink:

OK, so the issue is that sometimes you dont get 3 replies - thus holding up the join node?

If so, are you expecting that the join node should release after an amount of time so you can send 2 of the 3 messages?

I only don't get three replies when there is HTTP involved. At present the join node is waiting for responses from all the KNX nodes.

If I trigger the KNX nodes from a manual input, I immediately get three responses, these get passed to the join node which outputs the three objects as it's payload. In this example the join node is waiting for three responses:

If I trigger the KNX nodes from the HTTP in node, I only get two responses and no output/debug from the join node. In this example the join node is waiting for three responses:

In this extended example, I have changed the join node to wait for 2 responses only. You can see that once triggered via the HTTP in node, I only get 1 KNX response:
(image in next post)

This is leading me to believe that something that the HTTP in node is adding to the flow is jamming up the join node. To explore this theory a little further, I have disabled the KNX nodes from passing through the HTTP data "input msg passthrough". In this test, the message passes the join node OK but clearly I have lost the required HTTP data needed to complete the HTTP response node:
(image in next post)

In my other examples, I tried taking the HTTP in data around the KNX node and setting the KNX nodes not to pass through any data. When setting the join node to then expect 4 inputs (3x KNX, 1x HTTP) it still stalled exhibiting similar symptoms. I can't get away from the HTTP data causing the join node to kill the flow (sometimes upstream which is bizarre).

Thanks for all your help with this as I'm at a total loss!

Cheers,
Ben

What happens if you use the function node between HTTP IN and the KNX nodes?

image

The point of the function node was to send clean messages to the KNX nodes - rulling out your theory

The function node can simply be a 2 output function that contains

msg.topic = "http" //dont forget to set the topic on the http msg (for the join node)
return [{"payload":true},msg];//return 2 messages (http msg goes out of output 2)

... linking output 1 to the KNX nodes (i.e. sending just payload true to the KNX nodes)
... linking output 2 to the join node (i.e. sending just the HTTP In msg to the join node)

Hi Steve,

I have done this but I think it's similar to telling the KNX nodes not to pass through the incoming message, and then linking the HTTP also to the join node (4 inputs). I guess your approach is more thorough and conclusive so thank you.

I have implemented your function node and proven that output 1 is simply sending true and output2 is sending the full message with a http topic. Unfortunately this yields the same result; when the join node is set to receive 4 messages (3x KNX, 1x HTTP) the flow stops after 2x KNX node reads and there is no output from the join. Similarly when the join node is set to three messages, the KNX mode reads stop after 1.

For fun I also tried setting the join node to wait for 5 messages and in this scenario, all three KNX node readings are taken but there is no output from the join node.

The KNX reads stopping depending on how many messages the join node is expecting is interesting so I initially thought the issue was somewhere there but as soon as you take the HTTP out of the equation, the join node works perfectly (as detailed earlier). The HTTP in data (not sure whether this is the req/res) seems to be stopping the join node, at a point linked to the number of messages the join node is expecting.

Cheers,
Ben

Hi Steve,

Further to the above, I took the KNX nodes entirely out of the picture to try and narrow the problem down. I simply created an HTTP in, connected to your function node, set two topics and then joined them.

In the example below, if I manually inject a payload, the flow works and I get a combined key/value object out of the join node. If I call the http in node absolutely nothing happens... there isn't even an output from the HTTP in node with the res/req where normally a HTTP in would output that with nothing connected. If I break the flow to the join node, then initiating the flow from the HTTP in works (up to the join node where it's broken, obviously).

Assuming there's nothing wrong with my flow, I am beginning to lean towards the HTTP in and the join node not playing nicely.... to the extent that the HTTP in node isn't doing anything if there's a join in the flow (admittedly this doesn't answer how we got some KNX readings before but goes some way to narrowing things down).

[{"id":"b51e5ba0.4e885","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"10d85f99.17fa48","type":"http response","z":"b51e5ba0.4e885","name":"","statusCode":"","headers":{},"x":1130,"y":320,"wires":[]},{"id":"34799786.571688","type":"join","z":"b51e5ba0.4e885","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":930,"y":320,"wires":[["10d85f99.17fa48","584621b0.a4bc6"]]},{"id":"70be2264.90bddc","type":"change","z":"b51e5ba0.4e885","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"http","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":360,"wires":[["fa698b34.2d46a8","34799786.571688"]]},{"id":"fa698b34.2d46a8","type":"debug","z":"b51e5ba0.4e885","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":850,"y":420,"wires":[]},{"id":"584621b0.a4bc6","type":"debug","z":"b51e5ba0.4e885","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1050,"y":260,"wires":[]},{"id":"f45c8ae8.d3d5a8","type":"debug","z":"b51e5ba0.4e885","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":240,"wires":[]},{"id":"b107986b.a54cb8","type":"inject","z":"b51e5ba0.4e885","name":"Mode check","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"55","x":330,"y":300,"wires":[["4d3c6427.5b2e24","f45c8ae8.d3d5a8"]]},{"id":"4d3c6427.5b2e24","type":"function","z":"b51e5ba0.4e885","name":"fan out","func":"msg.topic = \"http\" //dont forget to set the topic on the http msg (for the join node)\nreturn [{\"payload\":true},msg];//return 2 messages (http msg goes out of output 2)","outputs":2,"noerr":0,"x":540,"y":320,"wires":[["645dc2a5.e7ef9c"],["70be2264.90bddc"]]},{"id":"c62a9c51.edf588","type":"debug","z":"b51e5ba0.4e885","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":420,"wires":[]},{"id":"645dc2a5.e7ef9c","type":"change","z":"b51e5ba0.4e885","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":280,"wires":[["c5cc6813.4fca4","34799786.571688"]]},{"id":"c5cc6813.4fca4","type":"debug","z":"b51e5ba0.4e885","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":870,"y":240,"wires":[]},{"id":"415aa5e2.1e25cc","type":"http in","z":"b51e5ba0.4e885","name":"","url":"test","method":"get","upload":false,"swaggerDoc":"","x":340,"y":340,"wires":[["4d3c6427.5b2e24","c62a9c51.edf588"]]}]

Hi Steve,

I have a solution!!

I have isolated the HTTP in node from the join node and have instead saved the joined message using context (flow.combined). I am then inserting that "flow.combined" into the HTTP payload flow.... and it works!

It's a bit nasty. I've introdcued an arbitrary 2 second timer but even so, if there's a delay on the KNX bus and the readings don't come back and get saved in time, then I'll return old or no data in the HTTP flow.

I'm still really keen to get this working properly using the join node so any further ideas you have would be greatly appreciated but I'm pleased that I've narrowed down the problem with your help.

Cheers,
Ben

1 Like

Your workarounds are very similar to one of my proposals (using context and delays) that I decided against posting (until all other avenues were exhausted).

I can't understand why your knx nodes act up when they are triggered by the http node.

If you trigger the 3 knx nodes directly (inject) are they 100% reliable?