MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-MQTTBridge not working

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    5 Posts 3 Posters 1.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      gkchimz
      last edited by

      Hi I am trying to set this up for the first time. This is the error message i get when i start mm:

      Is anyone able to advise me please. Thanks

      | [30.09.2021 17:16.03.787] [ERROR] 0|mm | TypeError: Cannot read property 'length' of undefined 0|mm | at Class.connectMqtt (/home/pi/MagicMirror/modules/MMM-MQTTbridge/node_helper.js:54:36) 0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-MQTTbridge/node_helper.js:67:14) 0|mm | at Socket.<anonymous> (/home/pi/MagicMirror/js/node_helper.js:109:11) 0|mm | at Socket.emit (events.js:315:20) 0|mm | at Socket.emitUntyped (/home/pi/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22) 0|mm | at /home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:428:39 0|mm | at processTicksAndRejections (internal/process/task_queues.js:79:11)

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        MMRIZE @gkchimz
        last edited by

        @gkchimz
        It seems your mqttDictionaries wrong.

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          gkchimz @MMRIZE
          last edited by

          @mmrize
          Thank you for the fast response. Here is the dictionary i am using

          var mqttHook = [
            {
              mqttTopic: "home",
              mqttPayload: [
                {
                  payloadValue: "ASSISTANT_LISTEN",
                  mqttNotiCmd: ["Command1"]
                },
                {
                  payloadValue: "None",
                  mqttNotiCmd: ["Command2"]
                },
              ],
            },
            {
              mqttTopic: "myhome/test2",
              mqttPayload: [
                {
                  payloadValue: "",
                  mqttNotiCmd: ["Command2"]
                },
              ],
            },
          ];
          var mqttNotiCommands = [
            {
              commandId: "Command1",
              notiID: "ASSISTANT_LISTEN",
              notiPayload: 'BLABLABLA-1'
            },
            {
              commandId: "Command2",
              notiID: "ASSISTANT_LISTEN",
              notiPayload: 'kjkjkj'
            },
          ];
          
          
          G M 2 Replies Last reply Reply Quote 0
          • G Offline
            gkchimz @gkchimz
            last edited by

            @gkchimz
            config.js

            {
            	module: 'MMM-MQTTbridge',
            	disabled: false,
            	position: 'middle_center',
            	config: {
            		mqttServer: "mqtt://username:password@192.168.0.99:1883",
            		mqttConfig:
            		{
            			listenMqtt: true,
            			interval: 300000,
            		},
            		notiConfig:
            		{
            			listenNoti: true,
            			ignoreNotiId: ["CLOCK_MINUTE", "NEWS_FEED"],
            			ignoreNotiSender: ["system", "NEWS_FEED"],
            		},
            		// set "NOTIFICATIONS -> MQTT" dictionary at /dict/notiDictionary.js
            		// set "MQTT -> NOTIFICATIONS" dictionary at /dict/mqttDictionary.js
            	},
            },
            
            
            1 Reply Last reply Reply Quote 0
            • M Offline
              MMRIZE @gkchimz
              last edited by

              @gkchimz
              Have you set the last line of dictionary?

                module.exports = { mqttHook,  mqttNotiCommands};
              
              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy