MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. rkorell
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    R
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 25
    • Posts 419
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Wayland problems in the April 2026 release

      Dear @howest,

      Glad you got it working again! The Wayland transition is indeed a bit of a bumpy ride if it hits you unexpectedly.

      Just to share a different experience: I’m running MagicMirror on a Raspberry Pi 5 with Raspberry Pi OS Trixie, and Wayland works fine for me – including keyboard input.

      The wireless combo keyboard/mouse issue you described is a known pain point; Wayland handles HID devices differently than X11, and some receivers just don’t play nice out of the box.

      If you ever feel adventurous and want to try Wayland again: check if your keyboard receiver shows up cleanly under

      libinput list-devices.
      

      Sometimes a powered USB hub or simply a different receiver firmware makes all the difference.
      But honestly – if X11 runs stable and you’re happy, there’s zero pressure to switch. Wayland on the Pi is still maturing. Your setup, your rules! 😊

      Warm regards,
      Ralf

      posted in General Discussion
      R
      rkorell
    • RE: MMM-RainRadarDWD

      @OliWer

      Absolutely fine for me. Just a hint - as improvement path for further upcoming modules from your side :-)

      Warm regards,
      Ralf

      posted in Utilities
      R
      rkorell
    • RE: MMM-RainRadarDWD

      @OliWer cool idea, thanks!
      You could save a lot of your parameters (all of the “// — Language & Text —” section) if you use the translate - capability…
      But with your approach it’s straight forward and really “all languages” - intersting idea!

      Warm regrds,
      Ralf

      posted in Utilities
      R
      rkorell
    • RE: Wayland problems in the April 2026 release

      @parnic said:

      I was able to modify my startup scripts to use start:x11 instead of start and it came back online

      Dear parnic,
      if you can start your mirror with x11 - than you have configured your pi for x11 - and wayland will not work! As far as I know this is either-or, not in parallel…

      This is not related to the mirror upgrade, I guess.

      You can change X11/wayland with raspi-config (with sudo) …

      Hope this helps - good luck!

      Ralf

      posted in General Discussion
      R
      rkorell
    • RE: AI Coding Tools Infuse a new Life in MagicMirror

      @Rags yes, it is :-)

      posted in General Discussion
      R
      rkorell
    • RE: AI Coding Tools Infuse a new Life in MagicMirror

      @sdetweil

      I am using the cline integration (Sonnet 4.6) with VS to enhance some firmware (build env in VS), and its been interesting.

      I‘m using claude code - installed directly on Mirror‘s RasPi and it (mostly :-) ) works like a charm.
      Indeed you need a subscription and several times „auto compressions“ of the current chat happens.
      But if one insist in writing important information consequently to CLAUDE.md as well as to „memory“ even every fresh started session has pretty much context…

      Warm regards,
      Ralf

      posted in General Discussion
      R
      rkorell
    • RE: MMM-Globe: Meteosat imagery broken — fork with fix available

      @manu85340 :-) Thank You!
      Glad, if it works for you!

      Ralf

      posted in Showcase
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      I’ve just seen that you had invented a solution for your problem - MMM-HideModulesOnSpotify :-)
      Cool!

      Ralf

      posted in System
      R
      rkorell
    • RE: MMM-FRITZ-Box-Callmonitor-py3 and MMM-Callmonitor-Current-Call

      @MiPraSo cool! thanks for this confirmation.
      Glad to hear it works for you!

      Regards,
      Ralf

      posted in Utilities
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      Dear @htilburgs,

      Yes, I Like your garbage module - it’s really great - thanks for this!
      I’m using MMM-NowPlayingOnSpotify …
      This has exactly the behavioour as described.
      Shows a spotify logo - which I had replaced with Volumio logo (which is my favourite spotify player) and only expands if something is played.
      In this case the left corner looks like

      screen2.jpg

      Warm regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs screen.jpg
      I have a quite similar layout.
      My MusicPlayer (Volumio) is on the left side, too but is spreading the region if cover-art is appearing…
      Warmest regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: MMM-Globe: Meteosat imagery broken — fork with fix available

      @plainbroke you’re really welcome.
      Thanks for your patience :-)

      Ralf

      posted in Showcase
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs cool!
      happy, that you are satisfied!

      Warm regards,
      Ralf

      interesting that you are poistion this counterbar on thr right side of the screen.
      For me it feels/looks more natural on the left side.
      May this is the reason for my “acceptance” of the colorFrom / colorTo - “mismatch” you had reported …

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs said:

      I’m looking forward for the startupGracePeriod parameter and think this is going to make the module fully as I like it.

      Good news — your wish came true faster than expected! 😊

      v1.5.0 is released and includes the startupGracePeriod parameter you were looking forward to.

      How to update:

      cd ~/MagicMirror/modules/MMM-PresenceScreenControl
      rm -rf node_modules
      git pull
      npm install
      

      Then add to your config:

      startupGracePeriod: 30,  // seconds to keep screen on after startup
      

      Set it to however many seconds you want the screen to stay on after a restart — enough time to
      verify everything came up correctly. After the grace period, normal presence logic kicks in. If
      your PIR detects you during the grace period, it seamlessly switches to the regular countdown
      timer.

      Also included in v1.5.0:

      • logFileName parameter — debug output now goes to pm2 logs by default (no more hidden log file)
      • Several internal fixes found during a code quality review

      Full changelog in the README.

      Enjoy! 🎉

      Warm regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs

      YES, IT IS WORKING!!!

      I’m SO happy.
      Great news - congratulations…
      So at least your stubborn issue leds to several code enhancements - during my investigation regarding your symptoms I had the chance to identify some optimization potential, so code is much cleaner now.
      Thanks for this gentle “push”.

      Warmest regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs :-) OK, nearby - Germany …
      Thanks for testing/feedback!

      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      Dear @htilburgs,
      it seems, we are in the same time-zone :-) wouldn’t be surpised even same mother-tongue …

      Nevertheless, thank you for your patience and the detailed logs — they were extremely helpful in tracking this down.

      What we found

      The module works perfectly on my system (Pi 5, Debian Trixie, Wayland/labwc, MagicMirror 2.34.0), so we did an intensive
      deep-dive comparing your setup, your MMM-Pir configuration, and your MMM-PresenceScreenControl configuration to understand why
      the screen comes back after ~6 seconds on your system.

      The key clue came from your own working MMM-Pir config:

      mode: 3
      waylandDisplayName: "wayland-0"
      

      MMM-Pir mode 3 uses wlr-randr — the same tool you configured for MMM-PresenceScreenControl. But there’s a critical difference:
      MMM-Pir internally sets WAYLAND_DISPLAY=wayland-0 (from your waylandDisplayName parameter) before calling wlr-randr.

      Your MMM-PresenceScreenControl config, on the other hand, uses:

      onCommand: "DISPLAY=:0 wlr-randr --output HDMI-A-1 --on --mode 1920x1080 --transform 270",
      offCommand: "DISPLAY=:0 wlr-randr --output HDMI-A-1 --off",
      

      wlr-randr is a Wayland tool — it communicates with the Wayland compositor via the WAYLAND_DISPLAY environment variable.
      DISPLAY=:0 is an X11 variable and is meaningless to wlr-randr. Without the correct WAYLAND_DISPLAY, wlr-randr falls back to
      guessing the socket, which results in the unstable behavior you’re seeing: the screen turns off but comes back after ~6
      seconds.

      This also explains why your system info shows WAYLAND_DISPLAY: undefined — MagicMirror/Electron doesn’t have it set, so any
      screen command executed from the module needs to provide it explicitly.

      The fix

      Replace DISPLAY=:0 with WAYLAND_DISPLAY=wayland-0 in your config. You have two options:

      Option A: wlr-randr (matching your working MMM-Pir setup)

      onCommand: "WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --on --mode 1920x1080 --transform 270",
      offCommand: "WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --off",
      

      This is the minimal change — same tool, same parameters, just the correct environment variable.

      Option B: wlopm (recommended, more robust)

      wlopm is purpose-built for display power management on Wayland. Unlike wlr-randr --off (which removes the output from the
      compositor layout), wlopm --off uses the Wayland power management protocol (DPMS-level) — it turns the display hardware off
      without affecting window layout. This is what I use on my system.

      First install it (it’s in the Trixie repos):

      sudo apt install wlopm
      

      Then configure:

      onCommand: "wlopm --on HDMI-A-1",
      offCommand: "wlopm --off HDMI-A-1",
      

      Note: wlopm doesn’t need WAYLAND_DISPLAY explicitly — the default fallback to wayland-0 works reliably on Trixie. And since
      wlopm controls hardware power state, it doesn’t need --mode or --transform on the on command — the display simply wakes up with
      its previous settings intact.

      For reference, the https://github.com/Jopyth/MMM-Remote-Control/blob/master/docs/guide/monitor-control.md documents wlr-randr
      as the recommended Wayland screen control option, including the hint to set WAYLAND_DISPLAY if needed.

      About the startup behavior (screen stays on)

      You mentioned the screen stays on after MagicMirror starts until you trigger the PIR. The startup fix from commit 39d28d6 does
      work — it turns the screen off ~1 second after startup. But since your offCommand wasn’t working correctly (the DISPLAY=:0
      issue), the screen appeared to “stay on.” Once you fix the command, the screen should turn off shortly after startup if nobody
      is in front of the PIR.

      You also asked: “Why not the time from counterTimeout?” — That’s a fair point. On my system, counterTimeout is 600 (10
      minutes), so turning off after 1 second is the desired behavior — I want to see that the restart worked, but not wait 10
      minutes. For your setup with counterTimeout: 30, having 30 seconds of screen-on after startup would make more sense.

      I’m planning a new config parameter startupGracePeriod that lets you define how long the screen stays on after module start
      before the presence logic kicks in. This way each user can choose independently of their counterTimeout. I’ll include this in a
      future release.

      Upcoming improvement: cronMonitor efficiency

      While investigating your issue, I discovered that the internal cron monitor (which checks for always-on/ignore time windows)
      sends updates to the frontend every second, even when nothing has changed and the screen is off. This causes unnecessary DOM
      rebuilds and is inefficient, though it’s not the cause of your screen-comes-back problem. I’ll fix this in the next release to
      make the module quieter after screen-off.

      About the debug logging

      Now that we’ve identified the root cause, you can set debug: “off” in your config again. The debug output you saw (gpiomon
      lines in pm2 logs) comes from the PIR library and goes to the console. The module’s own debug logging (updatePresence,
      startCounter, updateScreen, etc.) intentionally writes to a separate log file (MMM-PresenceScreenControl_local.log in the
      module directory) rather than to pm2 logs. This keeps the debug output focused and separated from the noise of all other
      modules — much easier to analyze when troubleshooting a specific issue. If you ever need to debug the module again, check that
      file instead of pm2 logs.

      Summary

      1. Screen comes back after 6 seconds: Replace DISPLAY=:0 with WAYLAND_DISPLAY=wayland-0 (Option A), or switch to wlopm (Option
        B)
      2. Screen stays on after startup: Should be fixed once Option A or B is applied. A startupGracePeriod parameter is planned for
        a future release.
      3. Log prefix [MMM-Pir]: Already fixed in your version ✓

      Please let me know if Option A or B resolves the screen-comes-back issue!

      Warm regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @sdetweil Thanks.
      I’ve excluded this file from git tracking so the pull should work.
      Warm regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      Dear @htilburgs

      You were right about the startup behavior — I’ve fixed it. The screen now turns off after ~1
      second if no presence is detected at startup. No more waiting for the first sensor event.

      Please update:
      cd ~/MagicMirror/modules/MMM-PresenceScreenControl
      rm -rf node_modules package-lock.json
      git pull
      npm install

      Regarding the remaining issue (screen comes back on after 6-7 seconds): The debug log you shared
      earlier shows the off command executing successfully, with no PIR event triggering the screen back
      on. The module isn’t causing it — but I need to understand what is. Could you please set debug:
      “complex” and share the complete log output from the moment the screen turns off until it comes
      back on? That will show every internal state change.

      Thanks for your testing and feedback — it’s making the module better for everyone.

      Warm regards,
      Ralf

      posted in System
      R
      rkorell
    • RE: PIR / MQTT - Presence sensor(s) revived

      @htilburgs sure. you’re right. Sorry.
      I’ve removed package-lock.json from git-tracking and corrected the README.md installation instruction according your advise.
      Instructions in postings above corrected as well.

      Regards,
      Ralf

      posted in System
      R
      rkorell
    • 1 / 1