Need to Trigger a node when MQTT message is sent

Hi,

As you know, the MQTT out node does not have an output.
I want to trigger a node when the MQTT message is sent successfully.
Do you have any ideas on how to do that?

You could use an mqtt-in node to subscribe to the same topic.

6 Likes

You can also use the complete node.
e.g.

[{"id":"2b77d071ec69d1d9","type":"complete","z":"d1395164b4eec73e","name":"","scope":["7f66a6f0d5c7e66d"],"uncaught":false,"x":190,"y":2220,"wires":[["2008a35b441a7cf0"]]},{"id":"fe5f8b5b5e23d287","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":2180,"wires":[["7f66a6f0d5c7e66d","24c2943ed1a1bc3c"]]},{"id":"7f66a6f0d5c7e66d","type":"mqtt out","z":"d1395164b4eec73e","name":"","topic":"test/test1","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e8ba3ef5.22f4a8","x":400,"y":2180,"wires":[]},{"id":"24c2943ed1a1bc3c","type":"debug","z":"d1395164b4eec73e","name":"debug 2462","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":2140,"wires":[]},{"id":"2008a35b441a7cf0","type":"debug","z":"d1395164b4eec73e","name":"debug 2461","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":2220,"wires":[]},{"id":"e8ba3ef5.22f4a8","type":"mqtt-broker","name":"testb","broker":"192.168.1.25","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

Thanks for the answer

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