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.

    MM current version on Raspberry Pi 5 cannot turn off monitor

    Scheduled Pinned Locked Moved Solved Troubleshooting
    53 Posts 9 Posters 29.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.
    • J Offline
      jbat66 @sdetweil
      last edited by

      @sdetweil
      I looked it up and you can get power readings via the API.
      http://doc.yosmart.com/docs/yolinkapi/Outlet

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @jbat66
        last edited by

        @jbat66 yeh gotta get a token for each I think

        Sam

        How to add modules

        learning how to use browser developers window for css changes

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

          @sdetweil

          and interesting idea being described for integrating older devices, like washing machine, is to monitor the power consumption with a smart plug… (I don’t know which do that in the US)

          thats exactly what I plan for my washing machine

          I wonder if the pi also has a lower consumption that can be measured and used as a trigger to turn off the smart switch when the power drops after pi shuts down…

          I ordered a smart plug from TuYa for this and tested this now with a raspberry pi 4.

          When the pi is running:
          pi_on.png

          After shutdown of the pi but red light of pi still on:
          pi_off_red_light.png

          S 1 Reply Last reply Reply Quote 1
          • S Offline
            sdetweil @karsten13
            last edited by

            @karsten13 awesome. I hope my plug will be here today

            Sam

            How to add modules

            learning how to use browser developers window for css changes

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

              @sdetweil So I ened up using a Yo-Link Plug, and it’s API. I have my monitor plugged into the Yo-Link Plug. I wrote a script that sets a delay time off to 1 minute for the monitor, and then 10 seconds later does a sudo power off command. So the pi shuts down gracefuly and then the monitor. The pi is powered from the usb connector on the monitor.

              1 Reply Last reply Reply Quote 1
              • J Offline
                JohnGalt @jbat66
                last edited by

                @jbat66 - thanks for the offer. If you do wind up sharing your work, I will take a look and see if it works for me.

                I don’t run any remote control module, and don’t find the “MMM-remote” you reference when I search. I do, however, find at least two (2) different modules called “MMM-Remote-Control” by two different authors. Do you mean one of those?

                My progress so far is that I can get the monitor to turn off using the following script (called by a cron job), but the monitor then turns back on after ~10-15 seconds:

                #!/bin/bash
                
                # Script to turn off monitor display when called by crontab
                export WAYLAND_DISPLAY=wayland-1
                export XDG_RUNTIME_DIR=/run/user/1000
                /usr/bin/wlr-randr --output HDMI-A-1 --off
                
                1 J 2 Replies Last reply Reply Quote 0
                • 1 Offline
                  1a2a3a @JohnGalt
                  last edited by

                  @JohnGalt Can you add vc4.force_hotplug=1 to cmdline.txt (on existing line) and check if behaviour changes? Add a space at the end of the line, save and reboot.

                  Assuming you are using the first hdmi port closer to the usb c. If using the 2nd port then change the hot plug number to 2

                  J J 2 Replies Last reply Reply Quote 0
                  • J Offline
                    jbat66 @JohnGalt
                    last edited by

                    @JohnGalt said in MM current version on Raspberry Pi 5 cannot turn off monitor:

                    @jbat66 - thanks for the offer. If you do wind up sharing your work, I will take a look and see if it works for me.

                    I don’t run any remote control module, and don’t find the “MMM-remote” you reference when I search. I do, however, find at least two (2) different modules called “MMM-Remote-Control” by two different authors. Do you mean one of those?

                    This one: https://github.com/Jopyth/MMM-Remote-Control

                    Sorry I should have been more clear.

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

                      @1a2a3a said in MM current version on Raspberry Pi 5 cannot turn off monitor:

                      vc4.force_hotplug

                      That does appear to work! So far I have tried it on two different Pi 4 instances, and each responded to a script called in crontab to turn off the monitor display, and then a script to turn it back on, as expected.

                      Thanks.

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

                        @1a2a3a Thank you Thank you Thank you… That worked for me as well… Message me, and I will get you a pizza like I promised to anyone who could get my pi4 running latest rasbian to turn off the monitor. Adding vc4.force_hotplug=1 to the end of the line in /boot/cmdline.txt did the trick along with using wlr-randr!!

                        I’m serious about the pizza.

                        1 D 2 Replies Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 5 / 6
                        • 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