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.

    Want to turn off my monitor

    Scheduled Pinned Locked Moved Troubleshooting
    monitorpower-saving
    27 Posts 9 Posters 25.5k Views 7 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.
    • Mykle1M Offline
      Mykle1 Project Sponsor Module Developer @cruunnerr
      last edited by

      @cruunnerr

      No worries, mate. I hope to learn something from your answer. (which is totally amazing to me)

      Peace!

      Create a working config
      How to add modules

      1 Reply Last reply Reply Quote 0
      • R Offline
        robmcc83
        last edited by

        Thanks this is very useful information that I didn’t know before.
        I have issued the sudo tvservice -o command and it did indeed shut down my monitor.
        But what I am trying at the moment is to have it shutdown and wakeup the monitor with a usb webcam now.
        That’s what I’m struggling with.
        Cheers

        1 Reply Last reply Reply Quote 0
        • R Offline
          robmcc83
          last edited by

          One interesting thing I like about the second way is it seems easy :) lol.

          Would it be possible to say have the screen come on 6-9am in the morning Monday to Friday then come on again 4-10pm as everyone out at work or school during the day. Than say set it so that its on 8am till 10pm on a saturday and sunday when everyone is usually about.

          Thanks

          1 Reply Last reply Reply Quote 0
          • cruunnerrC Offline
            cruunnerr
            last edited by cruunnerr

            Sure, this is possible. For the beginning it seems easy, because u needn’t any optional hardware :)

            For your understanding how cronjobs works u should note the following:

            * * * * * user executive_command
            ┬ ┬ ┬ ┬ ┬
            │ │ │ │ │
            │ │ │ │ └──── Weekday (0-7, Sunday is 0 or 7)
            │ │ │ └────── Month (1-12)
            │ │ └──────── Day (1-31)
            │ └────────── Hour (0-23)
            └──────────── Minute (0-59)
            

            So for your special wish ^^it should look like this:

            # /etc/crontab: system-wide crontab
            # Unlike any other crontab you don't have to run the `crontab'
            # command to install the new version when you edit this file
            # and files in /etc/cron.d. These files also have username fields,
            # that none of the other crontabs do.
            
            SHELL=/bin/sh
            PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
            
            # m h dom mon dow user  command
            17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
            25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
            47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
            52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
            0 6,16  * * 1,2,3,4,5   root  /home/pi/monitor_on.sh
            0 9,22  * * 1,2,3,4,5   root  /home/pi/monitor_off.sh
            0 8     * * 6,7   root  /home/pi/monitor_on.sh
            0 22    * * 6,7   root  /home/pi/monitor_off.sh
            #
            

            Or if you don’t want to create the *.sh files u can also just type the directly command.
            Like this:

            0 6,16  * * 1,2,3,4,5   root  /usr/bin/tvservice -p
            0 9,22  * * 1,2,3,4,5   root  /usr/bin/tvservice -o
            0 8     * * 6,7   root  /usr/bin/tvservice -p
            0 22    * * 6,7   root  /usr/bin/tvservice -o
            

            Last thing is the extremely easiest way because u just need to modify the crontab. there is nothing else needed at all.
            Just put these commands in your crontab and u are done ^^

            1 Reply Last reply Reply Quote 0
            • R Offline
              robmcc83
              last edited by

              That’s brill your a legend, got a few hours to myself tomorrow so armed with all this information and sure be giving this a try see what the outcome is.
              Thank you so much :)

              1 Reply Last reply Reply Quote 0
              • Mykle1M Offline
                Mykle1 Project Sponsor Module Developer @Mykle1
                last edited by Mykle1

                @Mykle1 said in Want to turn off my monitor:

                { exec(‘xset dpms force on’, null); }
                { exec(‘xset dpms force off’, null); }

                These commands do work. I just tested them on my desktop machine with a monitor connected through DVI and a laptop. Displays are immediately turned off (standby) and on. Here’s the laptop.

                https://youtu.be/3ldlUPkw2nM

                Create a working config
                How to add modules

                R 1 Reply Last reply Reply Quote 2
                • R Offline
                  robmcc83 @Mykle1
                  last edited by

                  @Mykle1 that’s cool as :) what are you using for the voice command I love that its brill.

                  Mykle1M 1 Reply Last reply Reply Quote 0
                  • Mykle1M Offline
                    Mykle1 Project Sponsor Module Developer @robmcc83
                    last edited by

                    @robmcc83 said in Want to turn off my monitor:

                    that’s cool as :) what are you using for the voice command I love that its brill.

                    https://github.com/mykle1/Hello-Lucy

                    Create a working config
                    How to add modules

                    1 Reply Last reply Reply Quote 1
                    • J Offline
                      Jonae @cruunnerr
                      last edited by

                      @cruunnerr i made your tutorial, works like charm! only problem i found is: replaced print “.”, with: print (“.”), Thenks!

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jonae @Jonae
                        last edited by

                        @Jonae
                        i encounterd another problem, sometimes after display goes ON the resolution is changed. any ideas why?

                        karsten13K 1 Reply Last reply Reply Quote 0
                        • karsten13K Online
                          karsten13 @Jonae
                          last edited by

                          @Jonae

                          I had similar problems using xrandr for disabling/enabling the monitor.

                          We did a fix in mm for the above problem (coming with next release) but I don’t know if this fixes your problem too.

                          You can find the fix in this PR.

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jonae @karsten13
                            last edited by

                            @karsten13 said in Want to turn off my monitor:

                            @Jonae

                            I had similar problems using xrandr for disabling/enabling the monitor.

                            We did a fix in mm for the above problem (coming with next release) but I don’t know if this fixes your problem too.

                            You can find the fix in this PR.

                            Thank you, i updated the file, hope for the best :)

                            J 1 Reply Last reply Reply Quote 0
                            • J Offline
                              Jonae @Jonae
                              last edited by

                              so far so good, no problems. so i can call it a fix for me.

                              Thanks

                              1 Reply Last reply Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1
                              • 2
                              • 2 / 2
                              • 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