Are MQTT nodes allowed in Subflows?

Sorry, gotta ask to be sure.

I'm on a bit of a binge just now and am really playing with sub-flows.

I shall try it and see, but would like to be sure of my findings.

Yes, they are allowed in sub flows,
but I have since discovered there is a trap if you use them:

They don't get the new device's settings for the LWT (etc).

So not really advised for multiple machines.

Can you explain a bit more what you mean by this?

There are no restrictions on using MQTT nodes inside a subflow.


I wrote/made a subflow.

Rather than having outputs to then connect to other nodes - in this case MQTT out - I put them in the sub-flow.

It worked! Wow!

So I rolled it out over multiple machines, or: Was about to!

But when I pasted the code I saw the MQTT stuff and it has the settings from the other machine.

LWT, etc.

So at the MQTT level, its overheads would be wrong with who is sending the message, or what ever. Comms up, comms down, etc.

So I realised it isn't a good idea to put MQTT nodes in the sub-flow in this case.
It would give erroneous message.

Does that help?

Do you want me to show you with a dummy sub-flow?

so there is no "trap". So we should remove that "solved" answer - as some readers may think that is a general statement when in fact it is just in your situation, and the answer is there are no restrictions.

Well I wanted to "close" it, but I can't find how to do that.

Well that is how you close it - but it is more helpful when the additional text is correct.

There are no restrictions to using MQTT nodes inside subflows.

I always find that litigation should be the last straw :wink:


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