MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Putting the Screen to Sleep while Away (No CEC or PIR)



  • The monitor I chose wasn’t CEC-HDMI capable, so I was unable to turn on and off the monitor using simple commands. I wanted a way to keep it running while I was around and make sure it was saving power while I was away. I used two modules in conjunction for this: mm-pir-hide-all & MMM-NetworkScanner. I just set the configuration of MMM-NetworkScanner to send the same notification that mm-pir-hide-all expected from its associated PIR module. mm-pir-hide-all doesn’t need to be modified in any way.

    The important change to the recommended module code for the network scanner is in bold below. By doing this, the screen will go blank five minutes after your phone disconnects from your wifi, and it will start up again when your phone reconnects.

    {
            module: 'MMM-NetworkScanner',
            position: 'top_left', 
            config: {
                devices: [
                        { ipAddress: "github.com", name: "Github", icon: "globe"},
                        { macAddress: "1a:1b:1c:1a:1b:1c", name: "Server", icon: "server"},
                        { macAddress: "2a:2b:2c:2a:2b:2c", name: "Desktop", icon: "desktop"},
                        { ipAddress: "10.1.1.10", name: "Laptop", icon: "laptop"},
                        { macAddress: "4a:4b:4c:4a:4b:4c", name: "Mobile", icon: "mobile"},
                    ],
                showUnknown: false,
                showOffline: true,
                keepAlive: 300,
                updateInterval: 5,
                residents: "Mobile",
                occupiedCMD: **{notification: "USER_PRESENCE", payload: true}**,
                vacantCMD  : **{notification: "USER_PRESENCE", payload: false}**,
    
            }        
        },
    


  • @Twenty nice that you combined those modules, but i doubt that you save a lot of energy with that, as the monitor is still running.

    I would suggest you use remote control instead of mm-pir-hide-all, which is using tvservice to cut the hdmi output. This will bring most of the monitors to standby, so you can really save energy.

    {
      module: 'MMM-NetworkScanner',
      position: 'top_left', 
      config: {
        devices: [
          { ipAddress: "github.com", name: "Github", icon: "globe"},
          { macAddress: "1a:1b:1c:1a:1b:1c", name: "Server", icon: "server"},
          { macAddress: "2a:2b:2c:2a:2b:2c", name: "Desktop", icon: "desktop"},
          { ipAddress: "10.1.1.10", name: "Laptop", icon: "laptop"},
          { macAddress: "4a:4b:4c:4a:4b:4c", name: "Mobile", icon: "mobile"},
        ],
        showUnknown: false,
        showOffline: true,
        keepAlive: 300,
        updateInterval: 5,
        residents: "Mobile",
        occupiedCMD: {notification: "REMOTE_ACTION", payload: {action: 'MONITORON'}},
        vacantCMD: {notification: "REMOTE_ACTION", payload: {action: 'MONITOROFF'}},
      }        
    },
    


  • But then the monitor doesn’t turn itself back on when I get home. So that doesn’t really help.



  • couldn’t u combine that with the normal MMM-PIR sensor and using the relay option?

    connecting like here at Point 5



  • Good read! Those solutions still requires a button and/or a relay. My idea is just a minimalist approach to blanking the screen, perhaps if you have personal info on your calendar display. And you never have to think about it again, entirely automated.



  • the the main thing is you are satisfied

    🙂

    great solution anyhow