I think you can do that but it’s going to be painful since the mirror will listen and react to everything people say near him. The magic word (jarvis, mirrror mirror,etc…) is a safeguard to that behavior.
Read the statement by Michael Teeuw here.
Posts
-
RE: Almost done need to active my mirror by Phrase
-
RE: Almost done need to active my mirror by Phrase
In config.js
{ module: "MMM-AssistantMk2", position: "top_right", config: { // --- ESSENTIALS / modifying for your environment might be needed. deviceLocation: { coordinates: { // set the latitude and longitude of the device to get localized information like weather or time. (ref. mygeoposition.com) latitude: 45.6307, // -90.0 - +90.0 longitude: -72.9563, // -180.0 - +180.0 }, }, recipes: ["hide_and_show_all_modules.js","playlist.js","volume.js"], defaultProfile: "default", // If you have several profiles and want to set one of them as default profile, describe here. profiles: { "default" : { // profile name. profileFile: "default.json", // profile file name. lang: "fr-CA" //currently available (estimation, not all tested): // de-DE, en-AU, en-CA, en-GB, en-US, en-IN // fr-CA, fr-FR, it-IT, ja-JP, es-ES, es-MX, ko-KR, pt-BR // https://developers.google.com/assistant/sdk/reference/rpc/languages }, /* Add your other profiles here, if exists. "other_profile" : { profileFile: "other.json", lang: "de-DE" } */ }, record: { // Full values are in `FOR EXPERTS` section. recordProgram: "arecord", // Defaults to "arecord" - also supports "rec" and "sox" device: "plughw:1" // recording device (e.g.: "plughw:1") }, notifications: { ASSISTANT_ACTIVATED: "HOTWORD_PAUSE", ASSISTANT_DEACTIVATED: "HOTWORD_RESUME", }, play: { // Full values are in `FOR EXPERTS` section. playProgram: "mpg321", // recommended. }, // --- OPTIONAL / not important but customizable for your usage responseVoice: true, // If available, Assistant will response with her voice. responseScreen: true, // If available, Assistant will response with some rendered HTML responseAlert: true, // If available, Assistant will response with Alert module of MM // Sometimes, any response might not be returned. responseAlert is useful for displaying error. screenZoom: "80%", // Adjust responseScreen to your mirror size. screenDuration: 0, // milliseconds. How long responseScreen will be shown after speech. //If you set 0, Screen Output will be closed after Response speech finishes ASAP. youtubeAutoplay: true, //If set as true, found Youtube video will be played automatically. pauseOnYoutube:true, //If set as true, You cannot activate Assistant during youtube playing. //Recommended for the performance (Because permanent hotword detecting might make performance lower) youtubePlayerVars: { // You can set youtube playerVars for your purpose, but should be careful. "controls": 0, "loop": 1, "rel": 0, }, youtubePlayQuality: "default", //small, medium, large, hd720, hd1080, highres or default useWelcomeMessage: "", //Try "brief today" as this value. You can use this value to check module working when MM is starting. onIdle: { //timer: 1000*60*30, // if you don't want to use this feature, just set timer as `0` or command as "" //command: "HIDEMODULES", timer: 0, command: null, }, onActivate: { timer: 0, //command: "SHOWMODULES" command: null, }, }, }, -
RE: Volume control
Last time I bug you with that I promise.:smiling_face_with_halo:
I fixed it that way
case this.config.notifications.VOLUME_DOWN: var vol = parseInt(this.currentVolume) - curUpDownScale if (vol < 0) vol = 0 this.sendSocketNotification(this.config.notifications.VOLUME_SET, vol) break case this.config.notifications.VOLUME_UP: var vol = parseInt(this.currentVolume) + curUpDownScale if (vol > 100) vol = 100 this.sendSocketNotification(this.config.notifications.VOLUME_SET, vol) breakBy adding the parseInt to make sure that it’s an integer.
All working fine now!!
Thank again, really like your module!
-
RE: Volume control
@Sean
Just to let you know.
the ‘-M’ did not fixed the volume problem. I found out ,using the console, that the variable, for an unknown reason, when I use ‘VOLUME_SET’ followed by ‘VOLUME_UP’ it append the current volume number and the updownscale instead of doing the addition.
using volume_set 50 and updownscale 10
Console:
Block curUpDownScale: 10 vol: "5010"But when I use ‘VOLUME_SET’ followed by ‘VOLUME_DOWN’ it work with no issue. Also in that order I can use ‘VOLUME_UP’ after…
I also realized that the vol number is not between double quote
Block curUpDownScale: 10 vol: 40Still looking to find where it breaks
-
RE: Almost done need to active my mirror by Phrase
The way I did it is by using MMM-Assistantmk2, hotword and google voice reco. There is an already build ‘recipe’ in Assistantmk2 that do what you want.
The module is hide_and_show_all_modules.js
var recipe = { transcriptionHook: { "HIDE_ALL_MODULES": { pattern: "Go to sleep", command: "HIDEMODULES" }, "SHOW_ALL_MODULES": { pattern: "Wake up", command: "SHOWMODULES" }, }, command: { "HIDEMODULES": { moduleExec: { module:()=>{ return [] }, exec: (module, params, key) => { module.hide(1000, null, {lockString:"AMK2"}) } } }, "SHOWMODULES": { moduleExec: { module:()=>{ return [] }, exec: (module, params, key) => { module.show(1000, null, {lockString:"AMK2"}) } } }, }, } exports.recipe = recipeIn your config.js file , within the MMM-AssistantMk2 section, there is a line where you have to put all your ‘recipes’
recipes: ["hide_and_show_all_modules.js","playlist.js","volume.js"],When I say ‘Jarvis Go to sleep’ my screen goes black and then when I say ‘Jarvis Wake up’ all my modules appear.
For the record I’m french :smiling_face: so the phrases there are not the one I’m using, it may need some test so you don’t use google reserved words.
-
Volume control
Re: MMM-Volume
@Sean
Hello, just got the volume part to work but when I tested it I got a strange behavior.
first my code:
This is the content of my recipe file in MMM-AssistantMK 2
(https://github.com/eouia/MMM-AssistantMk2/)var recipe = { transcriptionHook: { "volume_down": { pattern: "Baisse le volume", command: "volume_down" }, "volume_up": { pattern: "Monte le volume", command: "volume_up" }, "volume_set": { pattern: "Volume ([0-9]{1,2}[0]?|100) %", command: "volume_set" }, }, command: { "volume_down": { notificationExec: { notification: "VOLUME_DOWN", } }, "volume_up": { notificationExec: { notification: "VOLUME_UP", } }, "volume_set": { notificationExec: { notification: "VOLUME_SET", payload: (params, key) => { return params[1]; } } }, }, } exports.recipe = recipeWhen I call to Up/down volume it work fine (with a 10 updownscale) It break when I call VOLUME_SET to set it to a specific level (let say 30) and then if I call VOLUME_UP it goes straight to 100 but If I call VOLUME_DOWN first it will work perfectly and go to 20.
I missed something?
Thank you!
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
Hello again, I’m trying to use the embeded calls “SWD_…” but there is something I’m not getting.
var recipe = { transcriptionHook: { "playlist_sylvain": { pattern: "liste sylvain", command: "playlist_1" }, "playlist_lewis": { pattern: "liste lewis capaldi", command: "playlist_2" }, "playlist_pause": { pattern: "arrêt lecture", command: "playlist_pause" }, "playlist_play": { pattern: "démarre lecture", command: "playlist_play" }, }, command: { "playlist_1": { notificationExec: { notification: "SWD_URL", payload: { url:["https://www.youtube.com/embed/0-rG98j2DWE?list=PLa51J4RKCoTXCfr-qubj2FUgPADypF3Gk&autoplay=1"], } } }, "playlist_2": { notificationExec: { notification: "SWD_URL", payload: { url:["https://www.youtube.com/embed/bCuhuePlP8o?list=RDEMsPjiovzEgfLLK2w1FvFTOg&autoplay=1"], } } }, "playlist_pause": { notificationExec: { notification: "SWD_PAUSE", } }, "playlist_play": { notificationExec: { notification: "SWD_PLAY", } }, }, } exports.recipe = recipeLists are starting correctly but when calling SWD_PAUSE it’s doing nothing and SWD_PLAY restart the list at beginning. Any clue?
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
Yes, I restarted my Pi and normal link is playing video now
https://www.youtube.com/embed/JGwWNGJdvx8?autoplay=1~~My playlist is still not working
https://www.youtube.com/embed/0-rG98j2DWE?list=PLa51J4RKCoTXCfr-qubj2FUgPADypF3Gk?autoplay=1~~scratch that it’s working!!! :-) something must needed a refresh in the services
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
Ok I finally got that you were talking about magic mirror, yes it’s 2.8.0. But does it affect smartwebdisplay? I thought the module was independent.
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
Good news, I was able to make it work thanks to you! But…there is a but… The youtube link with autoplay is not working :-(
This simple url
https://www.youtube.com/embed/JGwWNGJdvx8?autoplay=1Will give you ‘video unavailable’ error, remove the autoplay tag and it will show (not play).
Trying to find out how to make it work and I will post my config as soon as I get the hang of it.
See ya!
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
Thank for answering! :-)
Yes the Assistant is https://github.com/eouia/MMM-AssistantMk2
I will test with your recommendation and let you know if I’m able to make it work.
See ya!
-
RE: I am givning up.. new install
@otto said in I am givning up.. new install:
cannot load mixer controls: Ogiltigt argument
Did you tried the command I gave you? Thoses a just to validate that your mic is working, after you can work on alsamixer. The basic command are great tools to make sure stuff is working as you want.
Maybe a long shot but did you tried the following solution provided here?
https://askubuntu.com/questions/765396/alsamixer-cannot-open-mixer-invalid-argumentIt seems alsamixer can be tricky to config and some files need to be created manually (sound is muted by default at install).
-
RE: I am givning up.. new install
Before doing any reinstall check where is your mic with lsusb
Mine is a webcam so I got the following:
Bus 001 Device 012: ID 046d:0826 Logitech, Inc. HD Webcam C525Then I confirmed it was seeing my mic with arecord -l
pi@raspberrypi:~/MagicMirror/config $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: C525 [HD Webcam C525], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0So my device is plughw:1,0
Try this to record 3 seconds and play it
arecord -D plughw:1,0 -d 3 test.wav && aplay test.wavIf sound is faint you can adjust the ‘gain’ by doing the following
Open the Audio Device Settings :
Open the Menu in the top left corner->Preferences -> Audio Device SettingsI also tried with a 9$ amazon mic but the sound and recording was really crappy.
Good luck!
-
RE: Magic Mirror Black Screen after "pm2 start mm"
Had the same problem, change directory to MagicMirror and execute npm start. Hope it help
-
RE: MMM-SmartWebDisplay : display web contents (including YouTube) on your MM
@AgP42 said in MMM-SmartWebDisplay : display web contents (including YouTube) on your MM:
through notification by any other module
Hello,
First: Good job, module is very nice and easy to implement.
I have a little problem to understand how to change URL by notification from another module. I am using MMM-Assistant2 with a recipe but I’m not sure how to configure it. A little help would be greatly appreciated.
config.js:
{
module: ‘MMM-SmartWebDisplay’,
position: ‘bottom_left’, // This can be any of the regions.
config: {
// See ‘Configuration options’ for more information.
logDebug: false, //set to true to get detailed debug logs. To see them : “Ctrl+Shift+i”
height:“200px”, //hauteur du cadre en pixel ou %
width:“300px”, //largeur
updateInterval: 0, //in min. Set it to 0 for no refresh (for videos)
NextURLInterval: 0, //in min, set it to 0 not to have automatic URL change. If only 1 URL given, it will be updated
displayStateInfos: false, //to display if the module is on autoloop, or stop.
displayLastUpdate: true, //to display the last update of the URL
displayLastUpdateFormat: ‘ddd - HH:mm:ss’, //format of the date and time to display
url: [“https://www.youtube.com/embed/9xXww6Yyl34?list=PLa51J4RKCoTXCfr-qubj2FUgPADypF3Gk”], //source of the URL to be displayed
scrolling: “no” // allow scrolling or not. html 4 only
}
},Recipe (playlist.js)
var recipe = {
transcriptionHook: {
“playlist_sylvain”: {
pattern: “liste sylvain”,
command: “playlist_1”
},
},
command: {
“playlist_1”: {
moduleExec: {
module: [“MMM-SmartWebDisplay”],
exec: (module, params, key) => {
module: ({url: [“http://www.google.com”]}) //test url
}
}
},
},
}
exports.recipe = recipeWhat I am missing?
Thank you!