Read the statement by Michael Teeuw here.
MMM-Mqtt pub and sub at the same time
-
Hello,
I was wondering if any of you know how to actually subscribe and publish to a topic using this module? I currently tried adding two different instances of the module to the config file and have one set as sending and one as receiving but that just causes the module to crash and go offline.
Has anyone figured out how to do both of these at the same time? -
Have you tried copying the entire module folder and renaming the copy (for example) MMM-Mqtt2. Rename the important bits inside the folder and the important bits inside the MMM-Mqtt2.js file. Then your 2nd entry in the config.js to match the “new” module name. It’s worth a shot. :-)
-
@Mykle1 this was indeed the alternative solution I had in mind! I managed to get it to work now, but it looks a bit iffy since both instances of the module will receive the incoming data and so it will be displayed on the screen twice (which doesn’t seem to happen with outgoing data). I’m going to try see if I can manage to display it only on one of them and otherwise I’ll revert to the alternative you suggested! Thank you :)
-
-
@Mykle1 I ended up copying and renaming the entire module! Worked way better than my silly workaround. Thank you! :)
-
You’re welcome, mate. Glad it worked out for you. :-)