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.

    Switching the Magic Mirror display on/off

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    10 Posts 3 Posters 1.9k Views 3 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.
    • H Online
      Hilt @sdetweil
      last edited by Hilt

      @sdetweil

      Thanks for the heads up Sam.

      I’m currently running Bullseye with kernel 6.1.21-v7+ and it still works in this revision. Admittedly I didn’t try with Bookworm as when I originally tried it ( Bookworm ) at launch, the VNC server had gone away on account of Wayland and alternatives were…interesting back then ( didn’t do too much research at the time to be fair ). So for this rebuild I just stuck with Bullseye.

      2 quick questions for my own edification :

      1. For Bookworm. Could the commands I listed for vcgencmd simply be replaced with wlr-randr --output HDMI-A-1 --on and wlr-randr --output HDMI-A-1 --off ( assuming HDMI port 1 ) for the same result ?

      2. Another option according the the almighty but not always correct ChatGPT is to switch to X11 and then vcgencmd would work as expected ?

      I have a spare Pi I could test on. I won’t however have time to tinker in the next few weeks. Curse having to adult !!

      Really appreciate your input

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

        @Hilt said in Switching the Magic Mirror display on/off:

        Another option according the the almighty but not always correct ChatGPT is to switch to X11 and then vcgencmd would work as expected ?

        no, this is incorrect, as vcgencmd is no more , altho I see it on my bookworm system , it is not supposed to support display anymore…

        as for point 1,
        when running wayland you can use the wlr-randr command
        when running x11 you can use the xrandr command

        I don’t know the specifics of what each command needs.

        all linux commands come with help built in

        wlr-randr --help

        many provide more detailed info in the man page
        man wlr-randr
        I see the man page for vcgencmd is there too

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        H 1 Reply Last reply Reply Quote 0
        • K Offline
          Klinge
          last edited by

          First of all, thank you for your tips.

          So, I use the module from ambarusa

          origin  https://github.com/ambarusa/MMM-HomeAssistant/ (fetch)
          origin  https://github.com/ambarusa/MMM-HomeAssistant/ (push)
          

          And use the following config

                             module: “MMM-HomeAssistant”,
                             config: {
                                  mqttServer: “mqtt://192.168.100.xx”,
                                  mqttPort: 1883,
                                  username: “mqttxxxx”,
                                  password: “xxxxx”,
                                  deviceName: “MagicMirror xxxx”,
                                  autodiscoveryTopic: “homeassistant”,
                                  monitorControl: true,
                                  brightnessControl: true,
                                  moduleControl: true,
                                  monitorStatusCommand: “xrandr --query | awk \”/Screen/ {print ($8 > 320) ? ‘true’ : ‘false’}\“”,
                                  monitorOnCommand: “wlr-randr --output HDMI-A-1 --on --transform 90”,
                                  monitorOffCommand: “wlr-randr --output HDMI-A-1 --off”,
          //                      monitorOnCommand: “xrandr -d :0 --output HDMI-1 --auto --rotate right”,
          //                      monitorOffCommand: “xrandr -d :0 --output HDMI-1 --off”,
                                  pm2ProcessName: “mm”,
                              }
          

          As you can see, I use wlr-randr for on/off and rotate the monitor 90 degrees when switching it on.

          1 Reply Last reply Reply Quote 0
          • K Offline
            Klinge
            last edited by

            I think you’re right in calling it a switch. You can see it clearly in the screenshot at the arrow.

            Zwischenablage01s.jpg

            1 Reply Last reply Reply Quote 0
            • H Online
              Hilt @sdetweil
              last edited by

              @sdetweil

              Many thanks for the input. I’ll have a tinker when I find a gap and explore the commands and their respective soft switches. Just so that I’m future proof !

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