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

    Posts

    Recent Best Controversial
    • RE: Making my first module: issue with notifications

      @rico24 and here is an updated node_helper, that rejects connecting clients if they don’t send the right kind of identifier (ends with a digit)

      var NodeHelper = require('node_helper');
      var request = require('request');
      module.exports = NodeHelper.create({
      		initial_counter:10000,
      
              start: function() {
      			this.countDown = {} 				
      	},
      	isDigit: function(x){
      			return (x>='0' && x< ='9')  // watch out for spaces after < , forum hides it all
      	},
              socketNotificationReceived: function(notification, payload) {
                      console.log("Payload: =" + JSON.stringify(payload));
                      switch(notification){
                              case "DO_YOUR_JOB":
      				if(this.isDigit(payload.identifier.slice(-1))){
      					if(!this.countDown.hasOwnProperty(payload.identifier+this.ourpage)){
      				           this.countDown[payload.identifier]=this.initial_counter;
      					}
      				let return_payload={identifier: payload.identifier, value:(this.countDown[payload.identifier] - payload.value)}									 
                                  this.sendSocketNotification("I_DID",return_payload )
      			        console.log("Payload 2: = " + JSON.stringify(return_payload));
      			}
      			else
      				this.sendSocketNotification("I_DID_REJECTED_INVALID_IDENTIFIER",payload )
                                      break
                      }
              },
      });
      
      posted in Troubleshooting
      S
      sdetweil
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @bolish I do not know… as I said, none of my TVs support ANY commands to turn off/on…

      in my MMM-SleepWake module, I use module.hide() to hide everything, leaving a blank screen… for those devices that do not provide external control…

      posted in Tutorials
      S
      sdetweil
    • RE: node clientonly for Windows

      @mri_ice

      from the doc
      https://docs.magicmirror.builders/getting-started/installation.html#client-only

      because the system is running wayland
      you need to set the variable if not set

      "WAYLAND_DISPLAY="${WAYLAND_DISPLAY:=wayland-1}" node clientonly … rest of parms

      copied from package.json

      posted in General Discussion
      S
      sdetweil
    • RE: Making my first module: issue with notifications

      this is what that would look like… as u want pages insulated from each other as well as module instances

      module

      /* Magic Mirror
       * Module: name of module
       * 
       */
      
      //Register module
      Module.register("MMM-DutchGarbageCalendar", {
        defaults: {
              foo: "I'm alive!"
        },
      	ourpage: Math.ceil(Math.random() * 100),	
      	count:{},
        
        //Start function
        start: function (){
        this.count[this.ourpage] = 0
      },
        
        
       //getDom Function
        getDom: function() {
        var element = document.createElement("div")
        element.className = "myContent"
        element.innerHTML = "Hello, World! " + this.config.foo
        var subElement = document.createElement("p")
        subElement.id = "COUNT"
        element.appendChild(subElement)
        return element
      },
      
      
      //NotificationReceived 
      notificationReceived: function(notification, payload, sender) {
              switch(notification) {
                      case "DOM_OBJECTS_CREATED":
                              var timer = setInterval(()=>{
      		        Log.log("send socket notificationR: DO_YOUR_JOB:"+this.count[this.ourpage])
      			this.sendSocketNotification("DO_YOUR_JOB", {identifier: this.identifier+this.ourpage, value:this.count[this.ourpage]})
                                      this.count[this.ourpage]++;
                              }, 5000)
                              break
              }
      },
       
       //socketNotificationReceived
      socketNotificationReceived: function(notification, payload) {
              switch(notification) {
                      case "I_DID":
      			if(payload.identifier== this.identifier+this.ourpage){
      				var elem = document.getElementById("COUNT")
      				elem.innerHTML = "Count:" + payload.value
      				Log.log("socketReceived:" + JSON.stringify(payload))
      			}
      			else
      		        	Log.log("notification not for us");
                              break
              }
      },
      })
      
      

      helper

      var NodeHelper = require('node_helper');
      var request = require('request');
      module.exports = NodeHelper.create({
      		initial_counter:10000,
      
              start: function() {
      					this.countDown = {} 				
      				},
      
              socketNotificationReceived: function(notification, payload) {
                      console.log("Payload: =" + JSON.stringify(payload));
                      switch(notification){
                              case "DO_YOUR_JOB":
                        		if(!this.countDown.hasOwnProperty(payload.identifier+this.ourpage)){
      					this.countDown[payload.identifier]=this.initial_counter;
      				}
      				let return_payload={identifier: payload.identifier, value:(this.countDown[payload.identifier] - payload.value)}
                                      this.sendSocketNotification("I_DID",return_payload )
                                      console.log("Payload 2: = " + JSON.stringify(return_payload));
                                      break
                      }
              },
      });
      
      posted in Troubleshooting
      S
      sdetweil
    • RE: Config file

      @sanaa1369 the instructions say to copy the sample to config.js

      posted in Tutorials
      S
      sdetweil
    • RE: node clientonly for Windows

      looks like electron (browser) is confused about the os running

      posted in General Discussion
      S
      sdetweil
    • RE: Installing on a Pi Zero

      @laurafox08 sure, u install once, and can run full, server only or client only

      client only really is browser to server.

      so u can do what u want easily

      the default install config assumes everything locally…

      so, just change the config.js to allow any system on your network to connect

      address:"0.0.0.0",
      

      and initially disable any security filtering

      ipWhitelist:[],
      

      for pi0, my install script sets up chromium over server, as electron isn’t available pre built for armv6.

      if u used my script see the run-start.sh script for the chromium command syntax
      address:“0.0.0.0”,

      posted in Troubleshooting
      S
      sdetweil
    • RE: {HowTo} turn on/off your monitor (Time based, PIR/Button, App)

      @chandra move one to a different GPIO pin and change the config as required for that

      posted in Tutorials
      S
      sdetweil
    • RE: node clientonly for Windows

      @mri_ice if you look at package.json you can see the npm commands we defined in the scripts section

      i copied the wayland stuff from there.

      posted in General Discussion
      S
      sdetweil
    • RE: Tv Fire Stick second Display Sound Bluetooth

      @fufu1408 said in Tv Fire Stick second Display Sound Bluetooth:

      Can i connect Bluetooth speakers to the controller board of the TV fire stick

      seems so

      https://thehometheaterdiy.com/use-bluetooth-speakers-with-amazon-fire-tv-stick/

      posted in Troubleshooting
      S
      sdetweil
    • RE: Remote SSH Access to the Mirrors You Give Away

      @bhepler aws also provides generated keypairs.

      I just created a server the other day to host an app. I have both ssh and scp’ed to that server from windows and my mirror and my Linux machine

      posted in Tutorials
      S
      sdetweil
    • RE: A command to refresh magic mirror page

      @FrostByte as long as the change doesn’t affect a node_helper, which are only loaded at start time

      the config.js os loaded as part of the web page
      there is no notification it changed to the client browser

      posted in General Discussion
      S
      sdetweil
    • RE: module not found error loading module in MagicMirror

      @macg said in fix for black screen in 2.16 and later:

      The “strange” referred to the fact that I have no problems with MMM-DWD-WarnWeather, but others have to install the module “request”.

      did u npm install request in the mm folder, or in a module folder where there was no package.json, the latter ends up putting it in the mm/node_modules, the same as the former

      posted in Troubleshooting
      S
      sdetweil
    • RE: ipWhitelist HowTo

      @veejae addess: “localhost”, means listen ONLY inside (from myself)…

      change to address: “0.0.0.0” (listen from anywhere)

      posted in Tutorials
      S
      sdetweil
    • RE: Ads are blocking site content - how to get rid of them?

      @ember1205 I had to make my browser page bigger…
      you could zoom out ctrl-minus (on the keypad) or the -/+ on the US keyboard to the left of the backspace key)

      blocked,
      Screenshot at 2025-09-04 09-35-23.png

      zoomed out 1 click (ctrl-minus)
      Screenshot at 2025-09-04 09-35-33.png

      posted in General Discussion
      S
      sdetweil
    • RE: Bullseye

      @oberfragger yes, if you use the bullseye adjusted url (note the word master is replaced by bullseye i the url)

      bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/bullseye/raspberry.sh)"
      

      I don’t want to break the current version while we test this out…

      I just updated the instructions with this link

      posted in Troubleshooting
      S
      sdetweil
    • RE: Clean installation of MM 2.9.0 on an Orange Pi PC sbc, armbian buster

      @qu1que ok, even more manual…

      my script does all that plus pm2. and screen saver turn off…
      any os… mac, ubuntu, pi stretch, buster, pi0 thru pi 4, odroid, jetson nano, sure others…

      posted in Tutorials
      S
      sdetweil
    • RE: small outburst - opencv

      @monark yes, the complexities are increasing. in number and difficulty.

      the add on capability from MagicMirror means anyone of any skill can do just about anything.

      I support the install/update and backup/restore scripts for MagicMirror, mostly to help with some of these difficulties… nodejs for example…

      the general view is that this MagicMirror environment is a learning experience, and we shouldn’t gloss over it… but I want to help users make progress and be successful.

      but its hard with all the technical churn OS, runtimes, libraries, …

      access to camera and OpenCV, python, are outside MM, we don’t know about any of it.
      causal (maybe first/only time) developers speak what they know…

      but I feel your pain.

      posted in General Discussion
      S
      sdetweil
    • RE: NYC-Transit MMM Issues

      @nneuland you didn’t do the npm install in the module folder

      posted in Troubleshooting
      S
      sdetweil
    • RE: Problems compliments random

      @blackeaglece if u would like to try sequential,

      download my repo and copy the compliments.js file to your instance

      # get new code
      cd ~/MagicMirror/modules
      git clone https://github.com/sdetweil/MagicMirror.git  temp_mirror
      #
      cd ~/MagicMirror/modules/default/compliments
      mv compliments.js compliments.js.save
      
      cd temp_mirror/modules/default/compliments
      git checkout fixcompliments
      cp compliments.js ~/magicMirror/modules/default/compliments
      

      edit the config.js and in the compliments module config section, add
      make sure its in the config block

      config: {
           random: false,
      }
      

      then restart you mirror

      posted in Tutorials
      S
      sdetweil
    • 1
    • 2
    • 71
    • 72
    • 73
    • 74
    • 75
    • 86
    • 87
    • 73 / 87