• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 power on and off

Scheduled Pinned Locked Moved Development
14 Posts 10 Posters 5.9k Views 9 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.
  • N Offline
    natebrown
    last edited by Oct 28, 2020, 3:23 AM

    Hi there,

    I was wondering if there was technology out there where i can set a timer to make the mirror turn on and off automatically at a specific time each day. I cant find anything. Does anyone else use something similar?

    1 Reply Last reply Reply Quote 0
    • G Offline
      garbleflux Project Sponsor
      last edited by Oct 28, 2020, 8:10 AM

      I use via crontab the CEC-function of the Monitor:

      turn on monitor weekdays 8 o clock:

      0 8 * * 1-5 echo “on 0” | cec-client -s -d 1 >/dev/null 2>&1

      turn on monitor on saturday & sunday 9.30 o clock:

      30 9 * * 0,6 echo “on 0” | cec-client -s -d 1 >/dev/null 2>&1

      turn off monitor daily at 20.30 o clock

      30 20 * * * echo ‘standby 0’ | cec-client -s -d 1 >/dev/null 2>&1

      this works like a charme since over one year
      regards Mike

      N 1 Reply Last reply Nov 1, 2020, 5:39 AM Reply Quote 0
      • T Offline
        thgmirror
        last edited by thgmirror Oct 28, 2020, 8:47 AM Oct 28, 2020, 8:46 AM

        @natebrown enter crontab -e at the prompt and insert the data garbieflux mentioned.
        If you struggle with the syntax, you can use several internet-pages to define the rules:
        https://crontab-generator.org/
        or
        https://crontab.guru/ for exapmle

        I use
        @reboot sudo sh -c ‘echo none > /sys/class/leds/led0/trigger’
        @reboot sudo sh -c ‘echo 0 > /sys/class/leds/led0/brightness’
        @reboot sudo sh -c ‘echo none > /sys/class/leds/led1/trigger’
        @reboot sudo sh -c ‘echo 0 > /sys/class/leds/led1/brightness’
        to turn off the LEDs at my RPI 3+

        Btw, an # at the beginning of the line marks it as a comment.

        Or use a time-switch to turn on and off the whole construction.

        Thomas

        1 Reply Last reply Reply Quote 1
        • B Offline
          BKeyport Module Developer
          last edited by Oct 28, 2020, 7:36 PM

          If you use a time switch to turn on and off the entire construction, you should still have a crontab to shut down the pi prior to shutting down the power, so you don’t corrupt your media.

          The "E" in "Javascript" stands for "Easy"

          1 Reply Last reply Reply Quote 0
          • T Offline
            thgmirror
            last edited by Oct 28, 2020, 8:20 PM

            Yes, @BKeyport idea is highly recommended:-)

            1 Reply Last reply Reply Quote 0
            • E Offline
              ember1205
              last edited by Oct 29, 2020, 11:58 AM

              I have a WiFi plug that switches the device on at a specific time in the morning.

              I use a cron job entry to shut the Pi down at a specific time at night.

              I have the WiFi plug turn off at a specific time at night, five minutes after the time I’ve configured the cron job to shut the Pi down.

              There is also an IFTTT integration where you can have the shutdown script make a specific call to create a calendar entry on a Google calendar and IFTTT will pick up that entry and use it to trigger the power-off event for the plug. I used to do this until IFTTT changed their account structure and I’ve been moving away from using any of their integrations.

              1 Reply Last reply Reply Quote 0
              • N Offline
                natebrown @garbleflux
                last edited by Nov 1, 2020, 5:39 AM

                @garbleflux
                Thanks, so i want it to turn on at 6:30 every morning and turn off at 9 every night, If i copy and paste that into crontab -e, will that work? What is the exact code i need?

                1 Reply Last reply Reply Quote 0
                • H Offline
                  hamid
                  last edited by Nov 1, 2020, 8:24 AM

                  I did not test with there are motion detectors that turn on the screen when moving the front screen does not know how it works

                  https://www.swedx.se/product_info.php?cPath=137_12800030&products_id=1955

                  R 1 Reply Last reply Nov 2, 2020, 11:05 AM Reply Quote 0
                  • T Offline
                    TJuTZu
                    last edited by TJuTZu Nov 1, 2020, 11:44 AM Nov 1, 2020, 11:30 AM

                    You can use also MMM-ModuleScheduler with MMM-Remote-Control to turn monitor on/off if you don’t need to turn off the whole system.

                    It works similar to crontab

                    Here is example from my mirror configuration

                       {
                          module: 'MMM-Remote-Control'
                          // uncomment the following line to show the URL of the remote control on the mirror
                          // , position: 'bottom_left'
                          // you can hide this module afterwards from the remote control itself
                        },
                    
                       {
                            module: 'MMM-ModuleScheduler',
                            config: {
                                notification_schedule: [
                                    // TURN THE MONITOR/SCREEN ON At 10:00
                                    {notification: 'REMOTE_ACTION', schedule: '00 10 * * *', payload: {action: "MONITORON"}},
                                    // TURN THE MONITOR/SCREEN OFF At 00:00 
                                    {notification: 'REMOTE_ACTION', schedule: '00 00 * * *', payload: {action: "MONITOROFF"}}
                                ]
                            }
                       }
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      BKeyport Module Developer
                      last edited by Nov 2, 2020, 4:41 AM

                      If you wanna go down that path, there’s MMM-Remote-Control, too.

                      The "E" in "Javascript" stands for "Easy"

                      S 1 Reply Last reply Oct 30, 2021, 3:44 AM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        9/14
                        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