A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • Wake word using MMM-Hotword

    Jun 27, 2020, 11:51 AM
    0 Votes
    1 Posts
    182 Views
    I want my Magic Mirror to only listen to a wake word before it starts listening to other commands. Can anyone show me how to do it with MMM-Hotword? At the moment, my Magic Mirror can listen and detect all registered hotwords in the models.
  • Alexa Photo's Background Slideshow

    Jul 18, 2019, 6:56 PM
    0 Votes
    2 Posts
    727 Views
    I am also trying to have my Amazon Photos as background images. Were you able to achieve this and if so, how?
  • 0 Votes
    2 Posts
    415 Views
    @xTITUS-MAXIMUSx nvm… after reviewing my mistakes I actually got it working Module.register("MMM-CSSswitch", { defaults: { morning_start: 5, morning_stop: 12, noon_start: 12, noon_stop: 23, }, //Do I still need to load the custom.css? getStyles: function() { return ["MMM-CSSswitch.css"]; }, // Define start sequence. start: function() { Log.info("Starting module: " + this.name); // Schedule update interval. var self = this; self.updatecssswitch(); setInterval(function() { self.updatecssswitch(); }, 5000); }, updatecssswitch: function() { var currentTime = new Date().getHours(); var body = document.querySelector('morning'); if ( currentTime >= this.config.morning_start && currentTime < this.config.morning_end ) { document.body.className = "morning"; } else if ( currentTime >= this.config.noon_start && currentTime < this.config.noon_stop ) { document.body.className = "noon"; } else { document.body.className = "night"; } } }); CSS .morning { background-image: url("morning.png"); margin: 0; height: 100%; width: 100%; } .noon { background-image: url("noon.jpg"); margin: 0; height: 100%; width: 100%; } .night { background-image: url("night.jpg"); margin: 0; height: 100%; width: 100%; } Big thanks to @Piranha1605 and his github for a template.
  • Gesture control with APDS-9960

    Jan 30, 2017, 5:09 PM
    0 Votes
    18 Posts
    11k Views
    @wishmaster270 , Sweet! Thanks!!
  • Hide a module by default

    May 29, 2020, 7:43 PM
    0 Votes
    4 Posts
    1k Views
    @Burnallover getDom() needs to return something, but u don’t want your content displayed. so hidden: false, suspend: function(){ this.hidden=true }, restore: function(){ this.hidden=false }, notificationReceived: function(notification, payload, source){ // this comes before the first call to getDom() if(notification === "ALL_MODULES_STARTED") this.hidden=true; }. getDom: function (){ var wrapper=document.createElement('div') if(this.hidden==false){ //create normal content } return wrapper; },
  • This topic is deleted!

    May 29, 2020, 3:07 PM
    0 Votes
    1 Posts
    22 Views
  • MMM-Facebook

    May 23, 2020, 10:30 AM
    0 Votes
    1 Posts
    786 Views
    Greetings, almost 2 years since my last contribution here and thanks to Covid19 #stay_home am back again with lots of great ideas :) I want to create a facebook notifications module using this simple idea: 1- login to mbasic.facebook.com through iframe (simple to user and more secure than typing account details in config.js plus I can’t find any API for that yet. 2- parse the very basic html tags https://mbasic.facebook.com data and extract : <strong class="bj">Notifications< span aria-label="X new">(X)</span></strong> Messages< span aria-label="X unread">(X)</span> Friends< span aria-label="X new requests">(X)</span> <strong class="bj">Pages< span aria-label="XX new alerts">(XX)</span></strong> and so on… 3- Create a Facebook like notification bar/icons with red counter bubble of parsed X number for each notification. 4- regular check/update the page to get the new count and send.notification to the Alert module (playing some notify sound). the module config would be like that: session.login:"true", /*set for the first time(login) only*/ sound.notify:"true", /*enable sound notification through local file (omx or vlc to play) or through send.notification Alert module if current X the notification number higher than old X */ update.interval:"10", /* minutes maybe*/ style:"2", /* kinda optional for view style 0 horizontal 1 vertical 2 themed...etc The great news is all facebook notifications, messages, page messages, page notifications, friend request…etc are enclosed in simple html tags can be parsed easily also we can skip the iframe part here and login from any iframe module the login data will be saved to mirror cache… but the bad news is I don’t know how (very newbie in JS coding from scratch). Kindly help me creating such great and useful module I’ve seen some tutorials in parsing data using node.JS but it’s kinda hard to me Thanks in advance
  • 0 Votes
    5 Posts
    1k Views
    @Sean Ah ofcourse, thanks for the explanation! My function does not have dependencies. I’ll use good old eval to fix this! My use case is that I need to use a different function based on the language setting of the mirror. These functions live in a separate folder and I import them in the node_helper.js file (together with some other arrays and objects I need based on language). For now I’ll use this solution, maybe in the future I build in a build step in my module so I can import the files directly into my main module file. https://github.com/ngnijland/MMM-text-clock/pull/2
  • Getting .mov to work as icons

    May 19, 2020, 3:34 AM
    0 Votes
    1 Posts
    278 Views
    Re: Changing icons of the modules Current Weather and Weather Forecast I was reading this old post and when replying it suggested I create a new one. I am playing with the default weather and forecast modules. I got my hands on some really nice animated weather icons but they are in .mov format. I have attempted to convert them to something like .gif but the quality output is terrible. In the original post @trividar was seeking an answer, not sure if they got it? Any advice?
  • MMM-NotificationReceived

    May 13, 2020, 3:44 PM
    3 Votes
    7 Posts
    1k Views
    @bhepler I use Geofency. You have to define the areas in the app and enter webhook addresses for entry and exit events. In my case, a JSON payload is posted to a self-hosted webserver (with encryption and basic auth).
  • 0 Votes
    3 Posts
    310 Views
    no, sam. It’s just some scripts like: Color write, question, check OS, etc see this
  • [npm library] @bugsounet/internet

    May 14, 2020, 9:37 AM
    1 Votes
    3 Posts
    400 Views
    it’s just my personal npm libraries :) I have 3 more … but i have to Make readme file (too lazy actually) :p
  • [npm library] @bugsounet/screen

    May 14, 2020, 9:50 AM
    1 Votes
    1 Posts
    134 Views
    @bugsounet/screen I created this library if you want to manage for screen in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for managing your screen Installation npm install @bugsounet/screen Sample with screen contructor const Screen = require("@bugsounet/screen") this.config = { delay: 10 * 1000, turnOffDisplay: true, ecoMode: true, displayCounter: true, detectorSleeping: true, governorSleeping: true, rpi4: false, linux: false } var debug = true this.screen = new Screen(this.config, callback, debug, detectorControl, governorControl) this.screen.start() setTimeout(() => { this.screen.state() } , 5 * 1000) setTimeout(() => { this.screen.stop() } , 15 * 1000) function callback(noti, value) { if (noti == "SCREEN_TIMER") console.log ("Turn off in", value) else console.log("Screen Notification:", noti) } function detectorControl(noti) { console.log("detectorControl Notification:", noti) } function governorControl(noti) { console.log("governorControl Notification:", noti) } constructor of screen Screen(screenConfig, callback, debug, detectorControl, governorControl) screenConfig {} delay - Time before turns off the display. (in ms). turnOffDisplay - Should the display turn off after timeout? ecoMode - send a notification to hide all module after timeout? displayCounter - send a notification with count-down before sleeping detectorSleeping - send a notification to manage detector when screen is off governorSleeping - send a notification to manage governor when screen is off rpi4 - rpi4 support (use dpms) linux - linux support (use dpms) callback (notification,value) SCREEN_TIMER - Display the count down before sleeping mode (require displayCounter) SCREEN_SHOWING - return notification for showing modules or other (require ecoMode) SCREEN_HIDING - return notification for hiding modules or other (require ecoMode) SCREEN_STATE - return object with actual screen state object value: running: return true if screen main script with count down is running locked: return true if screen function is locked power: return true if your display is On { running: true, locked: false, power: true } detectorControl [optional] require @bugsounet/snowboy or compatible require detectorSleeping and only work with activate() or start() function SNOWBOY_START - return notification for start your detector SNOWBOY_STOP - return notification for stop your detector governorControl [optional] require @bugsounet/governor require governorSleeping and only work with activate() or start() function GOVERNOR_WORKING - return notification to change your governor to working configuration GOVERNOR_SLEEPING - return notification to change your governor to sleeping configuration debug if you want debuging information, just set to true Functions activate(): activate main screen script with count down (use it with first use) it force turn on display when escape the script (ctl + c) start(): start screen script with count down stop(): stop screen script reset(): reset count down wakeup(): wake up the screen lock(): lock the screen (start/stop/reset/wakeup will be ignored) unlock(): unlock the screen wantedPowerDisplay(wanted): comparate actual screen state and apply it if not set. wanted value is boolean: true: turn on screen false: turn off screen setPowerDisplay(set): like wantedPowerDisplay() but you force to apply it set value is boolean: true: force turn on screen false: force turn off screen state(): return state of screen in object Notes turnOffDisplay work only with activate() or start() function you can use only wantedPowerDisplay() or setPowerDisplay() without main script !
  • [npm library] @bugsounet/cast

    May 14, 2020, 9:42 AM
    0 Votes
    1 Posts
    215 Views
    @bugsounet/cast I created this library if you want to cast youtube in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for casting YouTube (or other ?) in webview tag Installation npm install @bugsounet/cast Sample with cast contructor const Cast = require("./index.js") this.config = { castName: "MagicMirror_Cast", port: 8569 } var debug = true this.cast= new Cast(this.config.cast, callback, debug) this.cast.start() setTimeout(() => { this.cast.stop() } , 30 * 1000) function callback(noti, castLink) { if (noti == "CAST_START") console.log("Open this link:", castLink) if (noti == "CAST_STOP") console.log ("Cast End") } /** Note: Open the castLink in a webview tag **/ /** needed useragent= "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1" **/ constructor of cast Cast(castConfig, callback, debug) castConfig {} castName - Name of your device for reconize it in Cast apps port - server port callback (notification, castlink) CAST_START - return the url for start casting in a webview frame CAST_STOP - return end of casting debug if you want debuging information, just set to true Functions start() : start cast listener stop() : force stop cast server Notes Actually only YouTube works but may be other (in another update…)
  • [npm library] @bugsounet/governor

    May 14, 2020, 9:17 AM
    0 Votes
    1 Posts
    181 Views
    @bugsounet/governor I created this library if you want to set a CPU governor in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for setting you prefered CPU governor Installation npm install @bugsounet/governor Sample with governor contructor const Governor = require("@bugsounet/governor") this.config = { useCallback: true, sleeping: "powersave", working: "ondemand" } var debug = true this.governor = new Governor(this.config, callback, debug) this.governor.start() function callback(governor) { console.log(governor) } constructor of governor Governor(governorConfig, callback, debug) governorConfig {} useCallback- return callback confirmation (false by default) sleeping- set your prefered governor on sleeping mode working- set your prefered governor on working mode Available governor: conservative ondemand userspace powersave performance callback {} callback return object with status: { "actived" : true, "wanted" : "ondemand", "actual" : "ondemand", "error": null } actived: confirm with true if governor is set wanted: your wanted governor to set actual: your actual governor error: display error if detected debug if you want debuging information, just set to true Functions start() : start governor with working setting working(): start governor with working setting sleeping(): start governor with sleeping setting
  • [npm library] @bugsounet/pir

    May 14, 2020, 9:12 AM
    1 Votes
    1 Posts
    203 Views
    @bugsounet/pir I created this library if you want use a pir sensor in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-Assistant2Display single node routine for PIR sensor read Installation npm install @bugsounet/pir In the ending of installation, if you use electron you can do electron rebuild step. Do you want to execute electron rebuild ? [Y/n] Your choice: Sample with pir contructor const Pir = require("@bugsounet/pir") this.config = { gpio: 17, reverseValue: false } var debug= false this.pir = new Pir(this.config, callback, debug) this.pir.start() setTimeout(() => { this.pir.stop() } , 5000) function callback(status, err) { console.log("[PIR:CALLBACK] Status: " + status) if (err) console.log("[PIR:CALLBACK] " + err) } constructor of pir Pir(pirConfig, callback, debug) pirConfig {} gpio - BCM-number of the sensor pin. reverseValue - reverse presence detector value. callback (status,error) callback return with event status: PIR_INITIALIZED: Pir constructor is initialized PIR_STARTED: Pir start detection confirmation PIR_STOP: pir stop detection confirmation PIR_DETECTED: pir user presence detected PIR_ERROR: pir error callback error return with PIR_ERROR if error detected, it will return it with error value debug if you want debuging information, just set to true Functions start() : start pir stop() : force stop pir
  • [npm library] @bugsounet/snowboy

    May 14, 2020, 9:07 AM
    0 Votes
    1 Posts
    371 Views
    @bugsounet/snowboy I created this library if you want use snowboy in your module. This library is very simplified and ready for use in your node_helper.js This library is used in MMM-GoogleAssistant, MMM-Snowboy, MMM-AssistantMk2 Dependencies For listening keyword, you have to use a mic, so snowboy need some dependencies to use it sudo apt install libmagic-dev libatlas-base-dev sox libsox-fmt-all build-essential Installation npm install @bugsounet/snowboy In the ending of installation, if you use electron you can do electron rebuild step. Do you want to execute electron rebuild ? [Y/n] Your choice: Sample with new Snowboy contructor /** sample code for using snowboy library **/ /** @bugsounet **/ const Snowboy = require("@bugsounet/snowboy").Snowboy var config = { debug: true, snowboy: { audioGain: 2.0, Frontend: true, Model: "jarvis", Sensitivity: null }, micConfig: { recorder: "arecord", device: "plughw:1", }, } this.snowboy = new Snowboy(config.snowboy, config.micConfig, (detected) => { detect(detected) }, config.debug ) this.snowboy.init() this.snowboy.start() function detect(detected) { console.log("Make your script if " + detected + " is detected") } constructor of Snowboy Snowboy(snowboyConfig, micConfig, callback, debug) SnowboyConfig AudioGain - set the gain of mic. Usually you don’t need to set or adjust this value. Frontend - set pre-processing of hotword detection. When you use only snowboy and smart_mirror, false is better. But with other models, true is better to recognize. Model - set the name of your detector. Available: “smart_mirror”, “jarvis”, “computer”, “snowboy”, “subex”, “neo_ya”, “hey_extreme”, “view_glass” Sensitivity - Override default sensitivity value for applied model defined in Model. Value could be within a range from 0.0 to 1.0. Default sensitivity values for preconfigured models are: smart_mirror: 0.5 jarvis: 0.7 computer: 0.6 snowboy: 0.5 subex: 0.6 neo_ya: 0.7 hey_extreme: 0.6 view_glass: 0.7 alexa: 0.6 null will set default sensitivity. micConfig recorder - record program, rec, arecord, sox, parec is available. On RaspberryPi or some linux machines, arecord is better. On OSX, rec is better. If you prefer to use pulse audio, parec would be available also. device - recording device (microphone) name of your environment. (e.g. “plughw:1”) Find proper device name by yourself. (arecord -l will be help on Raspberry Pi or linux platform) callback if snowboy detect a keyword, it return it with his name debug if you want debuging information, just set to true Functions init() : initialize the constructor start() : start listening and waiting for your keyword stop() : force stop listening
  • 0 Votes
    3 Posts
    1k Views
    @bjorndegroot the last post was 2 years ago
  • 0 Votes
    3 Posts
    542 Views
    Thank you @sdetweil. I will take a look at it Thanks Again
  • Hide/show module from another module

    May 2, 2020, 2:13 AM
    0 Votes
    4 Posts
    535 Views
    @sergiozf you can pass a string as part of the hide, to prevent any other module from showing that does not provide that same string on show