Error message is:
Uncaught ReferenceError: require is not defined at config.js:15
Read the statement by Michael Teeuw here.
Posts made by acimail01
-
RE: How to load config data from file?
-
RE: How to load config data from file?
no, it is the kiosk mode. but I also tried the serveronly mode.
-
RE: How to load config data from file?
Here’s my attempt that does not work:
this line causes the error: var myfs = require(‘fs’)
what am I doing wrong ?pi@raspberrypi:~/MagicMirror $ cat my.json { "clockmodule": { "showDate": true, "displayType": "both" } }
and config.js
var myfs = require('fs') //var myconfig = JSON.parse(myfs.readFileSync('./my.json', 'utf8')) var config = { .... modules: [ { module: "clock", position: "top_left", //showDate: myconfig.module_clock["showDate"], //displayType: myconfig.module_clock["displayType"], },
-
How to load config data from file?
Is it possible to load a config value from a file (yml, json or other)?
modules: [ { module: "clock", position: "top_left", // This can be any of the regions. config: { displayType: #LOAD_VALUE_FROM_FILE# } } ]
-
RE: Execute shell commands when AssistantMk2 starts or stops
@Sean said in Execute shell commands when AssistantMk2 starts or stops:
TANT_RESPONSE_END
thank you!
MMM-NotificationTrigger did the trick.{ module: "MMM-NotificationTrigger", config: { triggers:[ { trigger: "ASSISTANT_RESPONSE_END", fires: [{ fire:"MY_COMMAND1", exec: "sleep 1; ls -al" },], }, { trigger: "ASSISTANT_UNDERSTOOD", fires: [{ fire:"MY_COMMAND2", exec: "sleep 1; ls -h" },], }, ] } },
-
Execute shell commands when AssistantMk2 starts or stops
Hello,
I have the modules MMM-Hotword and MMM-AssistantMk2 installed. And it works that far.
Now I want to execute a shell command when the wizard starts to speak and execute another shell command when the wizard is quit.
How should I proceed? -
Possible to combine MM-ProfileSwitcher and MMM-pages ?
Hello,
Is it possible to create several Profiles with several pages each?ist es möglich MMM-ProfileSwitcher and MMM-pages so zu kombinieren, dass man mehrere Profile mit mehreren Seiten hat? Oder gibts es andere Module für diese Lösung ?