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.

    face recognizes display ON/OFF

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 5 Posters 1.8k Views 5 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.
    • S Do not disturb
      sdetweil @DJBOOB66
      last edited by

      @djboob66 look at his code, he uses the same commands

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        suvan @DJBOOB66
        last edited by

        @djboob66 Hey, have you found any code yet? I’m looking for the same thing as well. Really need help with this.

        S 1 Reply Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @suvan
          last edited by

          @suvan looking for what?

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • S Do not disturb
            sdetweil
            last edited by

            as I said before, look at the GA code that does this… its the same 4 commands as always

            https://github.com/bugsounet/screen/blob/master/index.js

            and

             async setPowerDisplay (set) {
                log("Display " + (set ? "ON." : "OFF."))
                this.screen.power = set
                this.SendScreenPowerState()
                if (this.screen.awaitBeforeTurnOff && !set) await this.sleep(this.screen.awaitBeforeTurnOffTime)
                // and finally apply rules !
                switch (this.config.mode) {
                  case 1:
                    if (set) exec("/usr/bin/vcgencmd display_power 1")
                    else exec("/usr/bin/vcgencmd display_power 0")
                    break
                  case 2:
                    if (set) exec("DISPLAY=:0 xset dpms force on")
                    else exec("DISPLAY=:0 xset dpms force off")
                    break
                  case 3:
                    if (set) exec("tvservice -p && sudo chvt 6 && sudo chvt 7")
                    else exec("tvservice -o")
                    break
                  case 4:
                    if (set) exec("echo 'on 0' | cec-client -s")
                    else exec("echo 'standby 0' | cec-client -s")
                    break
                  case 5:
                    if (set) exec("xset dpms force on")
                    else exec("xset dpms force off")
                    break
                }
              }
            

            you should try each command to see what the results are
            do this from and ssh connection to your pi, so you don’t have to fight getting the screen back on to work…

            note that most of these turn off the HDMI port, and NOT the actual monitor.
            many newer displays (since 2016) are energy star compliant and will display an upgly no input signal when the hdmi port is turned off… no way to override that

            (and these displays will NOT turn back on when the hdmi port is turned back on)

            ps… none of my displays will work with any of these commands

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            cowboysdudeC 1 Reply Last reply Reply Quote 0
            • cowboysdudeC Offline
              cowboysdude Module Developer @sdetweil
              last edited by

              @sdetweil on the PI3… I just got mine working again this is the commands that work:

              ON:
              #! /bin/bash
              sudo vcgencmd display_power 1

              OFF:
              #! /bin/bash
              sudo vcgencmd display_power 0

              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @cowboysdude
                last edited by

                @cowboysdude cool. what monitor is that with?

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                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