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.

    Auto on/off of the TV (not the Pi)?

    Scheduled Pinned Locked Moved Solved Requests
    17 Posts 12 Posters 19.9k Views 12 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
      MechMatt
      last edited by

      Hey Everyone,

      I was wondering if anyone had any ideas on a good way to have the monitor/tv turn on and off automatically at specific times. I know there is an auto on/off module for the raspberry pi, but I was thinking this for the screen itself.

      My mirror is set up with a non-smart tv that doesn’t have any options for auto on and off. I have a logitech harmony remote that I haven’t had a chance to try yet , but some quick googling makes me think it doesn’t have the auto start functions. Anyone have any (preferably cheap) ideas?

      1 Reply Last reply Reply Quote 0
      • zombi27Z Offline
        zombi27
        last edited by

        Hi,

        @paviro just did want you probably want :)

        https://github.com/paviro/MMM-PIR-Sensor

        With this you can either turn of the HDMI signal (maybe your monitor goes to sleep then), or you can cut off the power signal of your monitor with a simple relay.

        zombi27Z MitchfarinoM M 3 Replies Last reply Reply Quote 1
        • zombi27Z Offline
          zombi27 @zombi27
          last edited by

          *just did what you probably want :) (typo)

          @paviro / @MichMich: am i not allowed to edit my reply? there is a 120sec time limit for editing? :/

          paviroP KirAsh4K 2 Replies Last reply Reply Quote 0
          • paviroP Offline
            paviro @zombi27
            last edited by

            @zombi27 Yes might consider changing this to ten minutes or so :)

            We're all stories in the end. Just make it a good one, eh?

            – The Doctor

            1 Reply Last reply Reply Quote 0
            • MitchfarinoM Offline
              Mitchfarino Module Developer @zombi27
              last edited by

              @zombi27 @paviro I’m wanting to use the camera/facial recognition to do this - but haven’t even looked at it yet.

              Work/Family life has prevented me recently.

              Slow and steady wins the race :)

              1 Reply Last reply Reply Quote 0
              • M Offline
                MechMatt @zombi27
                last edited by

                @zombi27 oh awesome i will have to check this out

                1 Reply Last reply Reply Quote 0
                • KirAsh4K Offline
                  KirAsh4 Moderator @zombi27
                  last edited by

                  @zombi27, yeah, @paviro wants to make sure that once you post your message, you are 100% committed to it. There will be no going back to change your post, or reply. You don’t get to pass GO and collect twice. :)

                  A Life? Cool! Where can I download one of those from?

                  paviroP 1 Reply Last reply Reply Quote 0
                  • paviroP Offline
                    paviro @KirAsh4
                    last edited by

                    @KirAsh4 @zombi27 changed it to ten minutes :) Should be enough to fix mistakes :D

                    We're all stories in the end. Just make it a good one, eh?

                    – The Doctor

                    1 Reply Last reply Reply Quote 1
                    • S Offline
                      sameershah23
                      last edited by

                      I was wondering if there is a way to toggle the power to the TV via HDMI CEC commands (sent by pi) and integrating a PIR sensor?
                      Example setup: The pi is always powered on. I walk into the room, the PIR senses me, and sends a power on signal to my TV via HDMI CEC command, and the mirror modules are displayed.

                      After a set duration, if no activity sensed by PIR sensor, a power off CEC command is sent to the TV by PI.

                      Has this been done before?

                      Any guidance would be much appreciated.

                      1 Reply Last reply Reply Quote 0
                      • KirAsh4K Offline
                        KirAsh4 Moderator
                        last edited by

                        CEC implementation is far and wide on monitors/tvs. There’s a client for the Raspberry Pi that you would have to install yourself, possibly (re)compile for your specific setup, and see if it is even able to communicate. This part is outside the scope of MagicMirror, like way out there. :)

                        You can start by reading the rpi forum: https://www.raspberrypi.org/forums/viewtopic.php?t=15749

                        A Life? Cool! Where can I download one of those from?

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

                          Re: Auto on/off of the TV (not the Pi)?
                          @MechMatt This is nearly the exact setup I would like to implement but without the PIR sensor. I’ve already checked and my Vizio TV is CEC compatible and Ive got a Pi3 with Jessie 8.0. Ideally I’d like to display the MM just from 6-9 am and again from 7-10 pm. Did you make any progress with a script or service that would allow timed display power changes?

                          @KirAsh4
                          I had already found the link you referenced and in trying to go through it the instructions falter. I’m following the setup listed towards the bottom of this site but when I get down to sudo git clone https://github.com/Pulse-Eight/libcec.git I’m prompted to login to get hub but then just get “remote: repository not found.” Any ideas or advice?

                          KirAsh4K 1 Reply Last reply Reply Quote 0
                          • N Offline
                            nhl
                            last edited by nhl

                            Turn the monitor on and off automatically

                            To turn the monitor on/off on a daily schedule, grab this script and put it in /home/pi/rpi-hdmi.sh. Next, make it executable:

                            chmod +x /home/pi/rpi-hdmi.sh

                            Now we’ll need to add a cron entry to call this script at the desired time, so open the cron editor:

                            crontab -e

                            And add the following lines at the bottom of the file:

                            Turn HDMI Off (22:00/10:00pm)

                            0 22 * * * /home/pi/rpi-hdmi.sh off

                            Turn HDMI On (7:00/7:00am)

                            0 7 * * * /home/pi/rpi-hdmi.sh on

                            The first number (0) is the minutes and the second number on each of those lines (22 and 7) is the hour in 24 hour time. So in this example, the monitor would turn off at 10:00pm and back on again at 7:00am. Adjust the time for your needs.

                            Keep in mind: this does not turn the Raspberry Pi off! It just turns off the monitor, saving energy and hopefully extending the life of your monitor. The Raspberry Pi is still on and running however.

                            1 Reply Last reply Reply Quote 2
                            • KirAsh4K Offline
                              KirAsh4 Moderator @Rtopher
                              last edited by KirAsh4

                              @Rtopher said in Auto on/off of the TV (not the Pi)?:

                              @KirAsh4
                              I had already found the link you referenced and in trying to go through it the instructions falter. I’m following the setup listed towards the bottom of this site but when I get down to sudo git clone https://github.com/Pulse-Eight/libcec.git I’m prompted to login to get hub but then just get “remote: repository not found.” Any ideas or advice?

                              What are you logging in as? The 'sudo' command is local to you (your rpi), so that password is your regular user’s password (possibly the 'pi' user, in which case you should not need it as it’s already configured to be allowed to run 'sudo'.) I can run it just fine and it clones that repository as expected.

                              A Life? Cool! Where can I download one of those from?

                              1 Reply Last reply Reply Quote 1
                              • F Offline
                                fuet
                                last edited by

                                I use a simple command in my crontab:
                                0 23 * * * vcgencmd display_power 0
                                0 6 * * * vcgencmd display_power 1

                                This turns the monitor off at 11pm and back on at 6am.

                                M 1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mdissel @fuet
                                  last edited by

                                  @fuet said in Auto on/off of the TV (not the Pi)?:

                                  I use a simple command in my crontab:
                                  0 23 * * * vcgencmd display_power 0
                                  0 6 * * * vcgencmd display_power 1

                                  This turns the monitor off at 11pm and back on at 6am.

                                  I’ve configured the monitor off with display_power 0, but the next morning my raspberry pi is also shutdown… Any tips?
                                  (no other scheduled tasks running)

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

                                    @mdissel
                                    Just power your rpi on?
                                    If you want to power on your rpi schedully, you should use poweroutlet with timer function or something like smartoutlet.
                                    If your problem is unintentional RPI’s poweroff, this could be another issue.

                                    1 Reply Last reply Reply Quote 1
                                    • K Offline
                                      kroket
                                      last edited by

                                      Yeah my project stopped just because of this same reason…
                                      Prob is, that I’ve made MM on my rpi 3 and bought sonoff relays for turning on and off my tv, but the prob is, that when I power my tv it doesn’t start. It just gets its power and I need to use my remote for it. Now… if I would have some sort of remote app of some sort with wich I could control my tv, then this could be the answer (maybe some android remote or something)…

                                      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 / 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