• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 717 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 Sep 30, 2021, 4:50 PM

    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 Sep 30, 2021, 4:58 PM Reply Quote 0
    • M Offline
      MMRIZE @gkchimz
      last edited by Sep 30, 2021, 4:58 PM

      @gkchimz
      It seems your mqttDictionaries wrong.

      G 1 Reply Last reply Sep 30, 2021, 5:00 PM Reply Quote 0
      • G Offline
        gkchimz @MMRIZE
        last edited by Sep 30, 2021, 5:00 PM

        @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 Sep 30, 2021, 5:09 PM Reply Quote 0
        • G Offline
          gkchimz @gkchimz
          last edited by Sep 30, 2021, 5:09 PM

          @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 Sep 30, 2021, 5:55 PM

            @gkchimz
            Have you set the last line of dictionary?

              module.exports = { mqttHook,  mqttNotiCommands};
            
            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              1/5
              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