MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Turn monitor on/off with MMM-voice

    Scheduled Pinned Locked Moved Solved Troubleshooting
    10 Posts 2 Posters 2.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mdhenriksen
      last edited by

      Re: Want to turn off my monitor

      Hey guys! I’ve been reading some old threads and trying to make my monitor turn off and on with a voice command via MMM-voice.

      I’m NOT using a Pi, but a laptop. I’ve tried @Mykle1’s following commands: (from Hello-Lucy - which works)

      exec('xset dpms force off', null);
      exec('xset dpms force on', null);
      

      I’ve implemented the code in the node_helper.js that executes a command when a voice command is detected:

      } else if (/(CUSTOM)/g.test(data)) {
      	    exec('xset dpms force off', null);
                  this.sendSocketNotification('CUSTOM');
      

      The above code is executed when my mirror register the word “custom”.

      this.sendSocketNotification(‘CUSTOM’); is there just so I can see if the command is recognized.

      Problem: As it is right now, I can see that my mirror registers and executes the this.sendSocketNotification(‘CUSTOM’); however the exec(‘xset dpms force off’, null); does nothing. Any ideas?

      Thanks in advance!

      ? 1 Reply Last reply Reply Quote 0
      • ? Offline
        A Former User @mdhenriksen
        last edited by

        @mdhenriksen
        Your laptop works with xset dpms force off on a shell? See your energy-saving setting in your environment.

        M 1 Reply Last reply Reply Quote 1
        • M Offline
          mdhenriksen @Guest
          last edited by

          @sean said in Turn monitor on/off with MMM-voice:

          @mdhenriksen
          Your laptop works with xset dpms force off on a shell? See your energy-saving setting in your environment.

          Hey Sean! I’m on Ubuntu 18.10, so I guess it should work. I’m pretty sure Mykle1 is on Ubuntu 16.04.

          As far as I know there is no energy-saving settings really. Could you elaborate you answer maybe? :D

          ? 1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @mdhenriksen
            last edited by

            @mdhenriksen
            I’m not experienced with Ubuntu, but I think there might be DPMS manager (Screen saver, monitor on/off) on X. You’d better check using DPMS enabled.

            M 1 Reply Last reply Reply Quote 1
            • M Offline
              mdhenriksen @Guest
              last edited by

              @sean So you’re saying there might be a setting that allows for the DPMS being turned on and off, right?

              ? 1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @mdhenriksen
                last edited by A Former User

                @mdhenriksen
                What would be displayed as the result of xset -q ?

                M 1 Reply Last reply Reply Quote 1
                • M Offline
                  mdhenriksen @Guest
                  last edited by

                  @sean Hey again Sean,

                  So here’s the output of xset -q:

                  I noticed the following: Server does not have the DPMS Extension :expressionless_face: Figured that’s why it’s not working. So I’m not sure about this whole DPMS thing. Is it an extension I can install or is it something native to a computer, e.g. hardware?

                  Keyboard Control:
                    auto repeat:  on    key click percent:  0    LED mask:  00000000
                    XKB indicators:
                      00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off
                      03: Compose:     off    04: Kana:        off    05: Sleep:       off
                      06: Suspend:     off    07: Mute:        off    08: Misc:        off
                      09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
                      12: Group 2:     off    13: Mouse Keys:  off
                    auto repeat delay:  500    repeat rate:  33
                    auto repeating keys:  00ffffffdffffbbf
                                          fadfffefffedffff
                                          9fffffffffffffff
                                          fff7ffffffffffff
                    bell percent:  50    bell pitch:  400    bell duration:  100
                  Pointer Control:
                    acceleration:  2/1    threshold:  4
                  Screen Saver:
                    prefer blanking:  yes    allow exposures:  yes
                    timeout:  0    cycle:  0
                  Colors:
                    default colormap:  0x23    BlackPixel:  0x0    WhitePixel:  0xffffff
                  Font Path:
                    /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins
                  DPMS (Energy Star):
                    Server does not have the DPMS Extension
                  
                  ? 1 Reply Last reply Reply Quote 0
                  • ? Offline
                    A Former User @mdhenriksen
                    last edited by

                    @mdhenriksen said in Turn monitor on/off with MMM-voice:

                    DPMS (Energy Star):
                    Server does not have the DPMS Extension

                    I’m not expert of this kind, so I might be wrong.

                    As I know, in nowadays modern linux machine, DPMS is auto detected and enabled if ACPI is also enabled at kernel runtime. However check /etc/X11/xorg.conf.d/ in the Monitor section (Or corresponding alternatives on your environment. Again, I’m not familiar with *nix machines :D )

                    Option "DPMS" "true"
                    
                    M 1 Reply Last reply Reply Quote 1
                    • M Offline
                      mdhenriksen @Guest
                      last edited by

                      @sean Yeah, I’m trying to look into that right now, but without much luck at the moment :D

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        mdhenriksen
                        last edited by

                        SOLVED

                        This is not really a solution, but my error was that I was logged in on “Ubuntu on Wayland” which doesn’t have DPMS.

                        On the login screen of Ubuntu you can click the little gear-icon and choose what kind of Ubuntu you want to login to. Wayland is a bit restricted, so just go with “Ubuntu” and not “Ubuntu on Wayland”

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy