Read the statement by Michael Teeuw here.
MMM-MQTTBridge not working
-
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)
-
@gkchimz
It seems your mqttDictionaries wrong. -
@mmrize
Thank you for the fast response. Here is the dictionary i am usingvar 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' }, ];
-
@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 }, },
-
@gkchimz
Have you set the last line of dictionary?module.exports = { mqttHook, mqttNotiCommands};