MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. sdetweil
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 108
    • Topics 92
    • Posts 21,151
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Help developing first module, displaying webscraped text.

      @enderflop cool

      key here is module name = foldername = filename = register name
      and node_helper.js has to be in the same folder

      posted in Development
      S
      sdetweil
    • RE: MMM-EveryNews goes off every time when MMM-GoogleMapsTraffic is on

      @Dimasua there is a bug in GoogleMapsTraffic

      I have an updated version that seems to work, and have submitted to the author, but they have not taken the fix.

      try this
      https://github.com/sdetweil/MMM-GoogleMapsTraffic

      posted in Troubleshooting
      S
      sdetweil
    • RE: Config option with array of multiple values?

      @UncleRoger said in Config option with array of multiple values?:

      great conversation topic

      validSenders: [ { "mom@example.com", "Mom", "#ff0000" },
                      { "dad@example.com", "Dad", "#00ff00" },
                      { "son@example.com", "Son", "#0000ff" },
                    ]
      

      generally when you expand the number of items in an array to objects ({}) you start to get thinking about what happens if you decide to add another entry in the object…

      so in javascript you can NAME the elements

      validSenders: [ 
                      {  name:"Mom", color:"#ff0000",url:"mom@example.com", },
                      { url"dad@example.com", name:"Dad", color:"#00ff00" },
                      {  name:"Son", url:"son@example.com",color:"#0000ff" },
                    ]
      

      that way the code is not sensitive to the order of the elements

           validSenders.forEach(sender =>{
                   if (sender.name =="Dad") {
                        do_something(sender.url)
                   }
           })
      

      you can also use the array.filter() function

      let selected_sender = validSenders.filter(sender=>{
            if(sender.url==mailObj.sender[0].address)
                 return true
           else
                 return false
       })
      if(selected_sender.length>0){
          // we found a matching sender
      }
      

      the filter function passes each element array in turn to the function
      if you want the element in the output array return true,
      if not return false

      on the combined statements you don’t need the backslash

      if (that.config.validSenders.includes(mailObj.sender[0].address) && 
          daysAgo >= 0 && daysAgo <= that.config.daysToDisplay) {
      

      but this is THREE comparisons

      • that.config.validSenders.includes(mailObj.sender[0].address)
      • daysAgo >= 0
      • daysAgo <= that.config.daysToDisplay

      the last two CANNOT be true at the same time

      maybe what you wanted was

      if (
           that.config.validSenders.includes(mailObj.sender[0].address) && 
          (daysAgo >= 0 && daysAgo <= that.config.daysToDisplay)  
           ) {
      

      this is two outer compares (with one inner)

      posted in Development
      S
      sdetweil
    • RE: MagicMirror Newsfeed continually "loading"...

      @spblat if the module has a node_helper.js, you need to restart MM for any changes to take place

      posted in Troubleshooting
      S
      sdetweil
    • RE: How difficult would it be to change the data an existing module receives?

      @Tippon you can clone (fork) the module and add on what you want…

      there are two parts of the module… the browser/ui part MMM-Fitbit2.js
      and the helper, node_helper.js

      the MMM-Fitbit2.js cannot access hardware or files directly, so it has to call the helper

      so, you could add on access to the spreadsheet (csv)
      and send that data back as part of the response… the front end would never know

      one of my modules uses a csv

      in the node_helper
      (you have to npm install csvtojson in the module folder to be able to use it)

      const cvt = require("csvtojson");
      

      and then

                                     cvt().fromFile(payload.tmpfile) // input xls  // changed to tmpfile
           				.subscribe((jsonObj, index) => { 
                                             // handle each row
                                         })
      
      posted in Development
      S
      sdetweil
    • RE: Complete Walkthrough - Install MagicMirror on a PC - Windows 7/10

      @Uwe-Kretsen do not install under mingw, just open a command prompt/ powershell prompt and do the git clone/npm install

      u need git of course and node/npm (google how to install)

      then u need to do some more steps as the setup is for linux

      cd MagicMirror
      cd vendor
      npm install
      cd ..
      cd fonts
      npm install
      cd ..
      

      then edit package.json and change the start line
      from

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

      to

      		"start": "node_modules/.bin/electron js/electron.js",
      

      then npm start works as expected

      also, you must manually copy the MagicMirror/config/config.js.sample to the initial config.js
      also create the empty MagicMirror/css/custom.css

      posted in Troubleshooting
      S
      sdetweil
    • modules using openweather api need review

      we have received notice from Openweather, that they are shutting down the version 2.5 weather endpoint in June 2024

      see
      https://github.com/MagicMirrorOrg/MagicMirror/issues/3424

      for the weather provided by MagicMirror, you will also have to change or add the apiVersion property

      see the documentation for exact format
      https://docs.magicmirror.builders/modules/weather.html

      posted in Development
      S
      sdetweil
    • RE: Problems loading config resources

      @Envynot sounds like you are running on windows…
      .
      two extra steps

      cd MagicMirror 
      cd vendor
      npm install
      cd ..
      cd fonts
      npm install
      cd ..
      

      now u can start mm again

      posted in Troubleshooting
      S
      sdetweil
    • RE: Do you need to list moment and moment-timezone as dependencies in modules?

      @dathbe you should list them , we can change the base at any time. there have been discussions to move away from moment.

      we moved away from request, and etc,etc…

      if you do require(x)
      then you should list x in package.json

      posted in Development
      S
      sdetweil
    • RE: MagicMirror² v2.15.0 is available don't work.

      @wenike deprecated doesn’t mean no longer works… just means you “shouldn’t use it for NEW development”

      SO, if its not loaded, YOU can still load it…

      npm install valid-url

      in whatever module needs it

      posted in Troubleshooting
      S
      sdetweil
    • Upcoming Release April 1, 2026 , breaking changes, some operational changes

      Breaking changes in upcoming April release,
      We’ve structurally reorganized the system to strictly separate user data from repository data.

      The modules folder now contains only user data in the form of third-party modules. The standard modules included with MagicMirror² have been moved to a separate directory, defaultmodules.,

      The css folder now contains only data belonging to the MagicMirror repository.

      The previously located custom.css file has been moved to the config folder. This happens automatically the first time you start the new version of MagicMirror². The installer and upgrade scripts will do this too

      The way config.js is loaded has changed. This should not affect standard users. However, it may have side effects for third-party modules. The client (browser) no longer loads config.js directly from the file system but via the web server (/config).,

      Support for config.js.template files has been removed. we will not generate the final config.js like we do today.

      Instead, config.js now supports curly braced bash variables. and the .env file remains the same

      Users who previously used a template must copy its contents into config.js once
      If MagicMirror² is running as an Electron application:

      We’ve changed the default window manager in the startup script from X11 to Wayland. Most Raspberry Pi OS users are likely now using trixie or bookworm, which already ship with Wayland as the default. Running node --run start is now equivalent to node --run start:wayland. Users still using X11 must now switch to node --run start:x11.

      The kioskmode, which has been marked as deprecated for 10 years, has been removed. If the kiosksmode parameter is set in config.js, it can be removed; it is now ineffective. You may need to adjust electronOptions parameters if you used kiosksmode before.

      If you think any modules you’ve developed may be impacted, you can use the develop branch to test . see this topic about how to get the develop branch if you need to do that
      https://forum.magicmirror.builders/post/86422

      also if you test as a user and find any issues

      please use this topic for any issues you find…

      Also,

      there are substantial changes to the Calendar module to finally cleanup all the date, timezone, and Daylight savings problems. this removes the use of the moment js library

      a complete rewrite of the weather module, to move data acquisition into the node_helper and share that data between module instances (current/forecast for example) … this will help reduce the number of api calls the module makes when there are multiple instances.

      posted in Upcoming Features
      S
      sdetweil
    • RE: Weather Module LocationID Error

      @stardyze unuxpected token, means the line before doesn’t end with a comma

      posted in Troubleshooting
      S
      sdetweil
    • RE: Are you tired of editing config.js, or have trouble doing it, see my new module

      I have updated the module now to support multiple instances of the same module,
      a little config (adding name to a file) … altho the module will auto detect if multiples are being used NOW, regardless of the file

      ALSO, one lacking feature of this solution is being able to get the form exactly right… as the info is missing in the module data…

      BUT i am creating the form info ANYHOW, so it can be saved and manually edited to improve the module experience, and I will use THAT instead of constructing the info every time…

      this means u can add selection lists, and other features (very easily)
      see the two issues for instructions

      multi-module
      https://github.com/sdetweil/MMM-Config/issues/2

      and save and use schema file
      https://github.com/sdetweil/MMM-Config/issues/11

      posted in Utilities
      S
      sdetweil
    • RE: How do I delete a module?

      @r3d6

      open a terminal window
      ctrl-alt-t

      cd ~/MagicMirror/modules
      rm -rf   xxxxx
      

      where xxxxx is the module you have installed and now want to delete.

      exact letter case matters
      foo is not the same as Foo on Linux

      then do

      cd ~/MagicMirror/config
      nano config.js
      

      use the arrow keys on the keyboard to move up and down, left and right

      find the entry

      module:"xxxxx`,
      

      where xxxxx is the module u want to delete
      move the cursor to the right end of that line

      hit the enter key
      type

       disabled:true,
      

      hit Ctrl-o
      hit enter

      hit ctrl-x

      you will be back at the terminal window prompt

      do

      cd ~/MagicMirror
      

      you can now restart MagicMirror however you do that
      npm start
      or
      pm2 restart

      read the two links in my signature below
      we did the disable approach cause it’s the easiest to do, and requires the least amount of content format knowledge.

      posted in Troubleshooting
      S
      sdetweil
    • RE: MMM-cryptocoin

      @unfriendlydevice @mumblebaj

      thanks guys.

      send me text messages if u think I’ve missed some other troublesome users

      posted in Utilities
      S
      sdetweil
    • RE: How do I properly uninstall magic mirror on raspberry pi 4

      @r3d6 my bullseye script should handle either way. I updated the comments to include other systems, not just bullseye

      posted in Troubleshooting
      S
      sdetweil
    • RE: MMM-HomeAssistant-Sensors (Development) - Show your HA Sensors on your Mirror

      @Ivanov_d OR the better way, never change files supplied by mm or a module(as this breaks upgrades or fix distribution). the system is designed to support your local changes

      edit ~/MagicMirror/css/custom.css
      (if it doesn’t exist, create it)

      add all those definitions but add the module name (and a space) in front of each

      .MMM-HomeAssistant-Sensors

      notice the leading dot

      posted in Utilities
      S
      sdetweil
    • RE: Can't get update alert to go away

      @pminich weird
      do

      cd ~/MagicMirror
      git pull
      
      posted in Troubleshooting
      S
      sdetweil
    • RE: MMM-CalendarExt3

      @bicolorbore586 no config option, just set cw to display:none in custom.css

      posted in Utilities
      S
      sdetweil
    • 1
    • 2
    • 6
    • 7
    • 8
    • 9
    • 10
    • 85
    • 86
    • 8 / 86