A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • LIRC Automation using PIR Sensor?

    7
    0 Votes
    7 Posts
    1k Views
    S
    @sranj u will have to write code. some module or module extension. I think. I’ve said all the words that could be used in Google searches to figure it out.
  • Reloading config defaults or module

    10
    0 Votes
    10 Posts
    1k Views
    S
    @hango the code was less than i thought replace this (last line of randomCompliment) return compliments[index] || ''; with this var f = compliments[index]; if ( typeof f == 'function') f= f() return f || ""; a compliment config entry would look like this module: "compliments", config: { compliments : { 'anytime': [ function(){return "this is a test "+ moment().format('MM DD HH:MM:SS')} ] } } all of the things can be functions, or any combo down to just 1 entry as a function. the function must return a string
  • Full Screen Module, switch between modules?

    3
    0 Votes
    3 Posts
    738 Views
    S
    @sdetweil I think you just made my day.
  • Python in module

    3
    0 Votes
    3 Posts
    510 Views
    U
    @Bugsounet I tried giving the full path too, but it did not work The python script does work on its own, there are no errors in that file
  • Help with updateDom()

    11
    0 Votes
    11 Posts
    4k Views
    ?
    better use this … start : function(){ setInterval( () => {this.updateDom()}, 1000); },
  • Send existing Notifications from a script

    15
    1
    0 Votes
    15 Posts
    4k Views
    thetobydeT
    It‘s working! Thx u!!
  • Wake word using MMM-Hotword

    1
    0 Votes
    1 Posts
    226 Views
    D
    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

    2
    0 Votes
    2 Posts
    820 Views
    S
    I am also trying to have my Amazon Photos as background images. Were you able to achieve this and if so, how?
  • Help creating background module to change on set time of the day

    2
    0 Votes
    2 Posts
    516 Views
    X
    @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

    18
    0 Votes
    18 Posts
    13k Views
    W
    @wishmaster270 , Sweet! Thanks!!
  • Hide a module by default

    4
    0 Votes
    4 Posts
    1k Views
    S
    @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!

    1
    0 Votes
    1 Posts
    22 Views
  • MMM-Facebook

    1
    0 Votes
    1 Posts
    915 Views
    R
    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
    N
    @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

    1
    0 Votes
    1 Posts
    319 Views
    VengeanceV
    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

    7
    3 Votes
    7 Posts
    1k Views
    M
    @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).
  • [installer] Make your own installer of your module

    3
    0 Votes
    3 Posts
    371 Views
    ?
    no, sam. It’s just some scripts like: Color write, question, check OS, etc see this
  • [npm library] @bugsounet/internet

    3
    1 Votes
    3 Posts
    470 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

    1
    1 Votes
    1 Posts
    160 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

    1
    0 Votes
    1 Posts
    242 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…)