MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED MMM-MQTTBridge not working

    Troubleshooting
    3
    5
    220
    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
      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
        MMRIZE @gkchimz last edited by

        @gkchimz
        It seems your mqttDictionaries wrong.

        G 1 Reply Last reply Reply Quote 0
        • G
          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
            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
              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
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy