@shinebright should produce one note per each mqtt message, check your settings once more or try to install on clean mm setup.
Read the statement by Michael Teeuw here.
Posts
-
RE: MMM-MQTTbridge
-
RE: Distance between glass and monitor
@evgeniy88 put the LCD as close to the mirror as possible.
Even 3mm will decrease the quality of transmitting picture.
It is better to leave only metal bound for LCD (usually, all LCD has the metal base frame) -
RE: Compliments from MQTT sensor
Possible with this one https://forum.magicmirror.builders/topic/12230/mmm-mqttbridge/1?_=1595102138148
Based on the predefined rules, send the Notifications to Compliments module
-
RE: User Friendly Magic Mirror?
@tripalreno4 here is how to make the user-friendly web interface to connect you RPi to WiFi network.
https://lemariva.com/blog/2019/02/raspberry-pi-cups-printer-server-using-docker. Follow until CUPS installation.After installation, your RPi will create its own wifi access point (AP) if no known wifi identified by RPi.
When AP created, User connects to it, goes to
http://192.168.27.1 and enter his wifi credentials using simple web interface (scan->select->enter password).
Worked for me.
I have made some visual adjustment and it looks like:

-
RE: MMM-MQTTbridge
@oberpiller said in MMM-MQTTbridge:
Is it possible to get variables (from “arrays”) into the mqttMsgPayload variable of NotiDictionary.js?
nope. I will think about it.
should it work somehow like that:
In notiMqtt dict should be specified whether we are using variable or not and, if yes, use it:var notiMqttCommands = [ { commandId: "Command 1", mqttTopic: "myhome/kitchen/light/set", useVariables: true, //added new setting to the dict to mqttMsgPayload: ARTICLE_INFO_RESPONSE //if useVriables=true, put here the variable name. If useVariable=false or not stated - mqttMsgPayload will send "ARTICLE_INFO_RESPONSE" in its payload. }, ]; -
RE: MMM-MQTTbridge
@chimera said in MMM-MQTTbridge:
eg: swimming pool temperature, only updates if it changes, garden sprinkler last run, only updates when it’s run, etc
As far as I understood you, you need to issue some NOTI during the MM/Module startup, right?
How would be the best option to do that? One possible solution is to have a file with the list of topics (e.g. “swimmingpool/temp/status”, “gardenspirnkler/run/status”) to which MQTTbrdige will send the mqtt-messages at startup.
Will this solve your problem with the integration of MM to your smart home? -
RE: Minimal depth of a frame for the magic mirror
@stepan minimal depth is limited by the depth of the LCD monitor behind it
-
RE: MMM-AssistantMk2 (v3)
@electros said in MMM-AssistantMk2 (v3):
I think I should look for another microphone, the assistant doesn’t really understand what I’m saying
One possible solution for mic
Working on getting a good hardware solution for MMM-AssistantMK2
-
RE: MMM-MQTTbridge
here is fribse’s great tutorial for simple integration of MM into Home Assistant ecosystem.
Following the logic from his post, user can expand it and control everything on its MM:https://community.home-assistant.io/t/magicmirror-integration-into-home-assistant-with-mqtt/177246
-
RE: MMM-AssistantMk2 (v3)
@Bugsounet got it. thanx for quick reply. will test shortly
-
RE: MMM-AssistantMk2 (v3)
@Bugsounet said in MMM-AssistantMk2 (v3):
MMM-AssisantMk2 v3.1.1-1
Excellent updates!
@Bugsounet could you please explain in a few words the functionality of these two features:- ADD: ASSISTANT_WEB server for activate with keyword
- MOTIFY : search KEYWORD/ TRYTOSAY translation script to improve performance
I have looked briefly on module’s wiki and did not found what do they mean.
-
RE: MMM-MQTTbridge
@fribse , finally it works for you. So the reason was the incorrect config initially as I understood.
P.S. the logfile looks a bit weird:
log means that the payload of the noti is an “object” and not other type of data.
Now I have to figure out about the noti->mqtt thing,
Exactly the same as for mqtt->noti: create an noti->mqtt dictionary and that is, literally, all.
I can see that the monitor status is reported in the log, but I can’t see what ‘notification’ is sent
here author https://github.com/Jopyth/MMM-Remote-Control#system-control wrote that Noti
USER_PRESENCE: trueorUSER_PRESENCE: falseis issued by the MMM-Remote-Control.
So configure your noti dictionary with these lines and you will get mqtt as soon as theUSER_PRESENCE: true\falsearrive. Pay attention, that the same noti could by issued by other modules, e.g.Also, you can control other modules via mqtt-noti command. Starting from hiding/showing and ending with direct control. Examples:
Within your smarthome ecosystem based on MQTT/HomeAssistant (HA) - a great modules are- MMM-NewPIR - use your PIR sensor, integrated into MM as an instance within HA ecosystem and add it states to the scenes automation.
- MMM-Youtube, - send mqtt->noti to this module and control via HA scenes e.g. turn-on news on Youtube in the morning etc.
- MMM-Volume, set and turn-on/off the volume (e.g. during the day/night time)
- Google Assistant etc.
Also, just a hint: add to
ignoreNotiSendera default “clock” module. I will add this by default to the next release. The reason: “clock” module sends notification every second. So adding “clock” to ignored list will prevent MQTTbridge from checking “clock’s” notification in dictionary every second (just to save rpi cpu usage). -
RE: MMM-MQTTbridge
@fribse said in MMM-MQTTbridge:
[16:04:30.547] [LOG] [MQTT bridge] MQTT message received. Topic: cmnd/home/bathroom/mirror, message: TURN_OFF_SCREEN
the log record above means that MMM-MQTTbridge received mqtt message at the topic
cmnd/home/bathroom/mirrorwith payloadTURN_OFF_SCREEN.The next log record
[16:04:30.639] [LOG] [MQTT bridge] MQTT -> NOTI issued: REMOTE_ACTION, payload: {action: ‘MONITOROFF’}
says that MQTTbridge issued MagicMirror’s notification
REMOTE_ACTIONwith payload{action: 'MONITOROFF'}which is exactly what you need. So this part works well.However, the further messages in log
[16:04:30.646] [LOG] Whoops! There was an uncaught exception…
[16:04:30.665] [LOG] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[16:04:30.667] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issuessays that something went wrong with the MM core. That could be the reason for not executing the command by another module.
To find out the reason, you need to localize the error. Try to disable all modules and then add modules one-by-one and find which one cause that error.
hint: to disable modules, usedisabled: truewithin each module config.Change also
listenNoti:tofalse,in MQTTbridge config if you do not need to convert Noti to Mqtt messages. So the module will not check all incoming MM’s notifications.Here is the full log within my setup, I just sent a simple message to issue noti
TESTwith payloadmessage:pi@raspberrypi:~/MagicMirror $ npm start dev > magicmirror@2.10.1 start /home/pi/MagicMirror > ./run-start.sh "dev" [23:48:05.361] [LOG] Starting MagicMirror: v2.10.1 [23:48:05.395] [LOG] Loading config ... [23:48:05.435] [LOG] Loading module helpers ... [23:48:05.444] [LOG] No helper found for module: clock. [23:48:07.792] [LOG] Initializing new module helper ... [23:48:07.794] [LOG] Module helper loaded: calendar [23:48:07.800] [LOG] No helper found for module: currentweather. [23:48:07.802] [LOG] No helper found for module: weatherforecast. [23:48:07.890] [LOG] Initializing new module helper ... [23:48:07.891] [LOG] Module helper loaded: newsfeed [23:48:08.506] [LOG] Initializing new module helper ... [23:48:08.507] [LOG] Module helper loaded: MMM-MQTTbridge [23:48:08.691] [LOG] All module helpers loaded. [23:48:08.693] [LOG] Starting server on port 8181 ... [23:48:08.705] [INFO] You're using a full whitelist configuration to allow for all IPs [23:48:08.735] [LOG] Server started ... [23:48:08.740] [LOG] Connecting socket for: calendar [23:48:08.744] [LOG] Starting node helper for: calendar [23:48:08.747] [LOG] Connecting socket for: newsfeed [23:48:08.749] [LOG] Starting module: newsfeed [23:48:08.752] [LOG] Connecting socket for: MMM-MQTTbridge [23:48:08.754] [LOG] [MQTT bridge] Module started [23:48:08.800] [LOG] Sockets connected & modules started ... [23:48:09.890] [LOG] Launching application. [23:48:26.071] [LOG] [MQTT bridge] Subscribed to the topic: home/smartmirror/bathroom/light/set [23:51:43.274] [LOG] [MQTT bridge] MQTT message received. Topic: home/smartmirror/bathroom/light/set, message: TEST:message [23:51:43.420] [LOG] [MQTT bridge] MQTT -> NOTI issued: TEST, payload: message -
RE: dead SD-card every aprox. 6 months
@almliden said in dead SD-card every aprox. 6 months:
Use RPi-images that writes to /tmpfs, or configure them to write temporary data to RAM to reduce wear on the SD-card.
How to do that?
-
RE: Working on getting a good hardware solution for MMM-AssistantMK2
@fribse
If you are of ok with basic soldering, you can follow this steps.
The cost of such very sensitive mic will be 2$.I have made this mic myself and its sensitivity is very high.
Mic is located behind the glass and sensitivity level set to 5%.
With this set-up, I can speak normally 1.5-2.5 meters in front of the glass and mic+Raspberry recognizes what I am saying well. -
RE: MMM-MQTTbridge
@fribse said in MMM-MQTTbridge:
where can I see if it even receives the message?
see the log in terminal
module produces something like this:[00:46:52.653] [LOG] [MQTT bridge] MQTT message received. Topic: cmnd/home/smartmirror/volume/set, message: VOLUME_SET:0 [00:46:52.873] [LOG] [MQTT bridge] MQTT -> NOTI issued: VOLUME_SET, payload: 0 -
RE: MMM-MQTTbridge
You have (1) mismatch in config and (2) wrong use of MMMRemoteControl syntax.
- First.
You config.js contains a line:
useMqttBridgeFormatOnly: false,
use the syntax exactly as it is written in the module’s readme. So please correct your config.js to
useMqttBridgeFromatOnly.
!!! I know about this misprint but it will be corrected in next release. As of now use as it is mentioned in readme.- Second.
notiPayload: ‘MONITOROFF’
Notifications
REMOTE_ACTION:MONITOROFFshould be issued by the MQTTbridge module with your current mqttDictionary.js.However, I have checked the MMM-Remote control module, section “examples” and have found that MMMRemoteControl requires different from your Notification’s payload. It requires format:
REMOTE_ACTION:{action: 'MONITOROFF'}So correct your mqttDictionary according to that format from MMM-Remote Control repo. As I understood, for monitor turn-off it should look like:
commandId: "MONITOROFF", notiID: "REMOTE_ACTION", notiPayload: "{action: 'MONITOROFF'}"Check the terminal log, MQTTbridge log in there (1) module start/stop (2) connection to mqtt server (3) conversion mqtt->noti.
- First.
-
MMM-MQTTbridge
TOPIC MOVED. PLEASE FOLLOW THE LINK BELOW FOR THE MODULE UPDATES, INQUIRIES, ETC
[MMM-MQTTbridge] A module to publish and receive MQTT messages.
MMM-MQTTbridge
https://github.com/Tom-Hirschberger/MMM-MQTTbridge
MMM-MQTTbridge allows you to integrate your MagicMirror into your smart home system via MQTT protocol and manage MagicMirror via MQTT messages by converting them into MM Notifications and vise verse - listen to your MM’s Notifications and convert them into MQTT mesages.
So, this module for MagicMirror do the following:
- Listens to MQTT messages from your MQTT broker and, if mqtt-message arrives, module sends MM Notifications based on the pre-configured mqtt-to-notification Dictionary rules.
- Listens to the MM Notifications within your MagicMirror environment. If Notification arrives, module sends MQTT message based on the preconfigured notification-to-mqtt Dictionary rules.

DOWNLOAD
Tom-Hirschberger/MMM-MQTTbridge
CONFIG STRUCTURE
For better understanding, we have divided config into 3 sections:
- General configurations in
config.js; - “NOTIFICATION to MQTT” dictionary rules;
- “MQTT to NOTIFICATION” dictionary rules;
GENERAL SECTION
{ module: 'MMM-MQTTbridge', disabled: false, config: { mqttServer: "mqtt://:@localhost: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 }, },GENERAL part
mqttServerset you server address using the following format: “mqtt://”+USERNAME+“:”+PASSWORD+“@”+IPADDRESS+“:”+PORT. E.g. if you are using your broker without username/password on localhost with port 1883, you config should looks “mqtt://:@localhost:1883”.
MQTT part
listenMqtt- turn on/off the listening of MQTT messages. Set tofalseif you are going to use only NOTI->MQTT dictionary to save CPU usage;interval- interval for MQTT status update, default is 300000ms.
(topics for subscription are taken from mqttDictionary.js
NOTIFICATION part
listenNoti- turn on/off the listening of NOTIFICATIONS. Set tofalseif you are going to use only MQTT->NOTI dictionary to save CPU usage;ignoreNotiId- list your NOTIFICATION ID that should be ignored from processing, this saves CPU usage. E.g. [“CLOCK_MINUTE”, “NEWS_FEED”],ignoreNotiSender- list your NOTIFICATION SENDERS that should be ignored from processing, this saves CPU usage. E.g. [“system”, “NEWS_FEED”]
NOTIFICATIONS to MQTT DICTIONARY SECTION
Should be set within
~/MagicMirror/modules/MMM-MQTTbridge/dict/notiDictionary.jsIf payloadValue is empty, the actual payload of the notification will be used as MQTT payload.
If payloadValue is specified and matches the payload received via the notification, mqttMsgPayload will be used as MQTT payload.var notiHook = [ { notiId: "CLOCK_SECOND", notiPayload: [ { payloadValue: '10', notiMqttCmd: ["Command 1"] }, { payloadValue: '20', notiMqttCmd: ["Command 2"] }, { payloadValue: '30', notiMqttCmd: ["Command 1"] }, ], }, ]; var notiMqttCommands = [ { commandId: "Command 1", mqttTopic: "myhome/kitchen/light/set", mqttMsgPayload: '{"state":"OFF"}' }, { commandId: "Command 2", mqttTopic: "myhome/kitchen/light/set", mqttMsgPayload: '{"state":"ON"}' }, ];MQTT to NOTIFICATIONS DICTIONARY SECTION
Should be set within
~/MagicMirror/modules/MMM-MQTTbridge/dict/mqttDictionary.jsIf payloadValue is empty, the actual payload of the MQTT message will be used as notification payload.
If payloadValue is specified and matches the payload received via MQTT, notiPayload will be used as notification payload.var mqttHook = [ { mqttTopic: "dahoam/test", mqttPayload: [ { payloadValue: "ASSISTANT_LISTEN", mqttNotiCmd: ["Command 1"] }, { payloadValue: "", mqttNotiCmd: ["Command 2"] }, ], }, { mqttTopic: "dahoam/test2", mqttPayload: [ { payloadValue: "", mqttNotiCmd: ["Command 2"] }, ], }, ]; var mqttNotiCommands = [ { commandId: "Command 1", notiID: "ASSISTANT_LISTEN", notiPayload: 'BLABLABLA-1' }, { commandId: "Command 2", notiID: "ASSISTANT_LISTEN", notiPayload: '' }, ];TESTED ENVIRONMENT
- Raspberry Pi 3 B+;
- Clean Updated Upgarded Raspbian Buster;
- MagicMirror ^2.10.1;
- mqtt-broker eclipse-mosquitto run in docker on the same RPi;
- mqtt-client on Windows10.
CREDITS