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.

    Adjust brightness of the screen in the night

    Scheduled Pinned Locked Moved Troubleshooting
    8 Posts 4 Posters 11.0k Views 4 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.
    • KeromidaK Offline
      Keromida
      last edited by

      I would also appreciate if there is a way to turn off/on the screen. I could write a shellscript for that, but I don’t know how to tell my RPi 3 out of the clock module, that when the time reaches 10.00 PM that it should start the “Screen Turn Off”-Script and at 6 AM to start the “Screen Turn On”-Script. The script could be run without the LXTerminal, so there wouldn’t be any complications with the MagicMirror interface.

      RedNaxR 1 Reply Last reply Reply Quote 0
      • RedNaxR Offline
        RedNax Module Developer @Keromida
        last edited by

        @Keromida You can easily use cron and tvservice to turn on/off at specific times…

        tvservice -o turns off the display.
        tvservice -p turns it back on.

        Just use cron (crontab -e) to schedule them…

        1 Reply Last reply Reply Quote 0
        • CatoC Offline
          Cato Module Developer
          last edited by

          Have you considered using a 50% transparent black DIV that is laying on top of everything?

          The DIV has to be added to the DOM with absolute position, like this:

          div.nightmode { 
          	position: absolute;
          	top: 0;
          	left: 0;
          	width: 100%;
          	height: 100%;
          	background-color: Black;
          	opacity: 0.5;
          }
          
          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @Cato
            last edited by

            @Cato this will prevent touchscreen ability for Those with Touch screen

            I would go for a Filter like

            body {
            -webkit-filter: brigthness(50%);
            }

            Please create a github issue if you need help, so I can keep track

            CatoC 1 Reply Last reply Reply Quote 0
            • CatoC Offline
              Cato Module Developer @strawberry 3.141
              last edited by

              @strawberry-3.141 Yes, that seems like a much better idea! I tried to think simple, but it was not simple enough… :-)

              1 Reply Last reply Reply Quote 0
              • KeromidaK Offline
                Keromida
                last edited by Keromida

                @strawberry-3-141 That sound’s like a pretty good idea but now I have to connet that code to the time and that’s my actual problem. How could i integrate that? I would really like to use that option because that’s exactly what I want to use =)

                @Cato Yeah, I was thinking the same but there was also my problem to write a code like that and then tell the code that it should just work between 10 PM and 6 AM (or better betweeen 22:00 and 6:00 for me in Germany) the time :(

                @RedNax Yeah, these are the codes I know but there is still the problem to conect the code to the time :(

                I’m really sorry when I’m not that good in programming like you all do but I started with VisualBasic just 3 months ago and I never programmed with anything else than VisualBasic :(

                RedNaxR 1 Reply Last reply Reply Quote 0
                • RedNaxR Offline
                  RedNax Module Developer @Keromida
                  last edited by

                  @Keromida The raspbian os is a linux derivative and includes cron which is used to schedule things.
                  You can tell it to do things through your crontab.

                  When you log on to your pi issue the crontab -e command. The first time it will ask you which editor to use… chose the default if you’re not sure.

                  You’ll be greeted by something like this:

                  #
                  # To define the time you can provide concrete values for
                  # minute (m), hour (h), day of month (dom), month (mon),
                  # and day of week (dow) or use '*' in these fields (for 'any').#
                  # Notice that tasks will be started based on the cron's system
                  # daemon's notion of time and timezones.
                  #
                  # Output of the crontab jobs (including errors) is sent through
                  # email to the user the crontab file belongs to (unless redirected).
                  #
                  # For example, you can run a backup of all your user accounts
                  # at 5 a.m every week with:
                  # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
                  #
                  # For more information see the manual pages of crontab(5) and cron(8)
                  #
                  # m h  dom mon dow   command
                  00 23 * * * /usr/bin/tvservice -o
                  00 06 * * * /usr/bin/tvservice -p
                  

                  You’ll have to add the two lines at the bottom which, in this example, will turn the mirror off at 2300 (11pm) and on again at 0600.

                  Save the file, and when asked yes you’re sure, and exit the editor… all done!

                  1 Reply Last reply Reply Quote 1
                  • 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