A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • Module Refresh at Midnight

    7
    0 Votes
    7 Posts
    681 Views
    S

    @jmwyds or
    millis in a day is

    24*60*60*1000
  • Updating Compliments using a spreadsheet

    14
    1 Votes
    14 Posts
    3k Views
    S

    @emrah_asl said in Updating Compliments using a spreadsheet:

    fs.writeFile("modules/default/compliments/remotefile.json", compliments, function(err) {
    my code in node_helper.js (under compliments folder) are creating file on root normally when you start mm with npm start

    don’t make this node_helper.js as MM has a special use for that…
    make it createCompliments.js

    then the best thing is use the full path for the file

    fs.writeFile("/home/pi/MagicMirror/modules/default/compliments/remotefile.json", compliments, function(err) {

    how do you start MM?

    pm2 start 0 (and it starts on boot too…) If you used the automated install script u would have been prompted to set this up.
    (if u want to add it now, you can run the fixuppm2.sh script from here
    https://github.com/sdetweil/MagicMirror_scripts
    just one line to copy/paste
    )

    now, if you use pm2, it launches MM by using the installers/mm.sh script. you can add your

    node modules/default/compliments/createCompliments.js

    to the mm.sh and all will continue as normal.

    The second problem , my magic mirror fires electron.js error when I try to create file.

    i don’t understand this.

    npm start fires electron.js

    npm reads the package,json file and looks for the command requested

    "scripts": { "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js",

    the ‘start’ command executes that line.

  • Merging Two Forks MMM-homeassistant-sensors

    3
    0 Votes
    3 Posts
    361 Views
    S

    @sdetweil Bummer, oh well, no better way for me to learn…thanks for verifying!

  • LIRC AUTOMATION

    4
    0 Votes
    4 Posts
    667 Views
    S

    @sranj ok, so u receive the trigger in the node_helper, and need to launch/exec/spawn your python pgm

    so you need the child_process library
    https://nodejs.org/en/knowledge/child-processes/how-to-spawn-a-child-process/

    PIR uses the same library to launch the tvservice command, or vgencmd to blank the screen

  • LIRC Automation using PIR Sensor?

    7
    0 Votes
    7 Posts
    551 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
    789 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
    461 Views
    S

    @sdetweil I think you just made my day.

  • Python in module

    3
    0 Votes
    3 Posts
    387 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
    2k Views
    ?

    better use this …

    start : function(){ setInterval( () => {this.updateDom()}, 1000); },
  • Send existing Notifications from a script

    15
    0 Votes
    15 Posts
    2k Views
    thetobydeT

    It‘s working! Thx u!!

  • Wake word using MMM-Hotword

    1
    0 Votes
    1 Posts
    144 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
    652 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
    372 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
    9k Views
    W

    @wishmaster270 , Sweet! Thanks!!

  • Hide a module by default

    4
    0 Votes
    4 Posts
    930 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
    666 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
    815 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
    220 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
    848 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).