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.

    PIR / MQTT - Presence sensor(s) revived

    Scheduled Pinned Locked Moved System
    7 Posts 3 Posters 1.5k Views 5 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.
    • R Offline
      rkorell
      last edited by

      Dear MagicMirror-ians

      As may already known I was a real fan of MMM-Pir.
      For also good known reasons this nice module is not longer maintained.

      I have a local clone which runs OK but in the meantime I had switched to MMM-MQTTScreenOnOff wich attaches a “better” (radar-) sensor to my mirror. But I’ve missed the progress bar, the dimming and cron-like functionality. In addition the radar sensor is much slower than PIR- caused by a 5 second update intervall as minimum.

      After plenty of tinkering and testing, and above all torturing AI heavily I’m excited to announce:
MMM-PresenceScreenControl is finally out! 🎉

      This module brings together the best of both worlds:
      • The beloved timer bar and auto-dimming from MMM-Pir,
      • The reliability, MQTT support, and simplicity of MMM-MQTTScreenOnOff,
      • All cleaned up, without unnecessary complexity, cryptic cron strings, or weird build tricks.

      A few highlights:
      • Presence detection with PIR, MQTT, or both (whichever triggers first wins)
      • A visual timer bar so you always know how long the screen will stay on
      • Straightforward “ignore” and newly introduced “always-on” time windows using plain times and days—no cryptic cron needed
      • Customizable screen on/off commands—works on Pi, PC, X11, Wayland, CEC, and more
      • Touch mode for remote or manual override (yes, you can poke your mirror awake remotely!)

      If you’re after spinning circles or relay magic, this isn’t your thing (yet 😉).

      But if you want a solid, readable, and maintainable presence module that just works—even (hopefully) after updates—this is for you.

      Give it a try, share your feedback, open pull requests, or ask questions right here or on GitHub:

      Happy mirroring!

      Ralf

      P 1 Reply Last reply Reply Quote 5
      • P Offline
        Peter @rkorell
        last edited by Peter

        @rkorell sadly it does not work: Pi 2b, bookworm, Pir only.
        It says: Presence: no
        It has worked for years with MMM-Pir on Bullseye.
        Can you help please?
        Peter

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          rkorell @Peter
          last edited by

          Dear @Peter,

          I can imagine that this is a restriction of your hardware.
          I’m not THAT system specialist but as far as I remember there are some limitations regarding environment and software versions on Pi2b …
          Because the “actuality” of used libgpiod this may doesn’t work on this specific hardware.

          I can imagine Sam (@sdetweil ) can deliver a more precise statement on this.

          On pi4/5 with “current” MM versions this works - and yesterday I got feedback regarding a successful installation.

          Is there any log-entry which can be useful here?
          Is the right GPIO configured for PIR?
          Is the PIR sensor functional / calibrated?
          Is power/ground connected to PIR?
          Is power supply sufficient and working?

          Regards,
          Ralf

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            Peter @rkorell
            last edited by

            @rkorell
            The Pir worked fine with MMM-Pir and Bullseye on the Pi 2b.
            Fresh install with Bookworm: everything worked fine except the Pir.
            That is why I tried your module.
            Peter

            R 1 Reply Last reply Reply Quote 0
            • A Offline
              advpolish
              last edited by sdetweil

              I’m not THAT system specialist but as far as I remember there are some limitations regarding environment and software versions on Pi2b -

              1 Reply Last reply Reply Quote 0
              • R Offline
                rkorell @Peter
                last edited by

                Dear @Peter,
                Yes fully understood…
                Without context - and may an answer regarding my questions - It‘s really hard to help.

                Warmest regards,
                Ralf

                R 1 Reply Last reply Reply Quote 0
                • R Offline
                  rkorell @rkorell
                  last edited by

                  Good afternoon!

                  today’s check of MMM-PresenceScreenControl shows me an issue posted by @icemanmw , which wasn’t on my radar but is an easy and useful addition.
                  Thanks for this idea.
                  I’ve added two additional parameters mqttUser and mqttPassword for those of you requiring additional authentification.

                  In Addition to this external trigger I had have some issues resolved :

                  While migrating my MagicMirror setup from Bookworm to Debian 13 (Trixie), I ran into a few things that required
                  changes to MMM-PresenceScreenControl. Since others might face the same issues, here’s a summary.

                  v1.1.0: GPIO fallback for Trixie + touch simplification

                  Trixie ships with libgpiod 2.x, which is a breaking API change from 1.x. The node-libgpiod npm package doesn’t work
                  with it (and also has issues with newer Electron versions). Rather than waiting for upstream fixes, the module now
                  auto-detects the situation and falls back to Python/gpiozero, which works perfectly on Trixie out of the box. No
                  configuration change needed — if you’re on Bookworm, nothing changes; if you’re on Trixie, it just works.

                  I also simplified the touch handling: the old touchMode parameter (0-3) is gone. Touch/click is now always active —
                  tap anywhere to wake up the display and reset the timer. Less config, same result.

                  v1.2.0: Removed VNC disconnect workaround

                  On older setups (X11), I had a double-click feature that would shut off the screen AND disconnect the VNC session to
                  avoid a “mini window” problem. Turns out this is no longer needed: wayvnc (0.9.1+) on Wayland/labwc natively manages
                  screen power through the wlr-output-power-management protocol. When you connect via VNC, the screen turns on. When you
                  disconnect, it goes back to whatever state it was in. Clean and simple — so I removed the workaround entirely.

                  Both updates are fully backwards-compatible. If you’re upgrading from v1.0.x, just pull the latest version. The only
                  thing to clean up in your config is removing touchMode and vncDisconnectCommand if you had them — but even if you
                  don’t, they’re simply ignored.

                  Have fun and a nice rest of the day.

                  Warmes regards,
                  Ralf

                  1 Reply Last reply Reply Quote 1

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 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