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
    36 Posts 5 Posters 1.8k Views 7 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.
    • htilburgsH Offline
      htilburgs @rkorell
      last edited by

      @rkorell
      Oke, done some testing:
      With the ‘new’ strings, I get:

      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",
      
      [ERROR] [MMM-PresenceScreenControl] [updateScreen] ERROR: Error: Command failed: WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --on --mode 1920x1080 --transform 270
      unknown output HDMI-A-1
      

      Why this message, I don’t know.
      After a reboot this message didn’t show again.

      Then I stopped MagicMirror and did the same command from the commandline WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --off

      After 6 seconds my display comes on again.
      So it isn’t coming from MagicMirror, but from my system.
      I created a simple Python3 script to turn off and on my monitor. Same problem.

      Next step:
      I took a new SD Card and installed a fresh copy of Trixie.
      Didn’t do anything else, no updates or something else and tried again with WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1 --off from the command prompt.
      Display goes off and after 6 seconds back on again.
      So I excluded MagicMirror. What else can it be?

      Next step:
      I took an other RPI4b with the new SD Card from previous step. Repeated the test, but still same result. Monitor goes on after 6 seconds. So it is not MagicMirror, not the RPI. But why it works with MMM-PIR and not with MMM-PresenceScreenControl. It is still a riddle for me.

      Next step:
      Original RPI with original SD Card and installed MMM-Universal-Pir. Same result, after 6 seconds screen on.
      So I excluded MagicMirror, SD Card, Trixie installation and RPI. It must have something to do with my monitor?!?
      Did something happen? Not that I know.

      After doing a search on the big WWW, I found an interesting article that described exact the same issue I was having.
      https://forums.raspberrypi.com/viewtopic.php?t=363966

      So I searched for my RemoteControl and search for a setting
      that automatically scan its input sources (not easy if your MagicMirror screen is rotated 270° ;-)
      And I found this setting and indeed it was standing on auto scan. I put it on HDMI as only source and tried it again:

      YES, IT IS WORKING!!!

      And even better than before, now my monitor turns completly off after 15 min. of no signal. So instead of using 75W when on, 26W in standby, it now uses 0W after 15 minutes (it’s a setting on the monitor).
      Activating the PIR, it turns back on!

      So with this I hope that if somebody else has this problem, they can solve it to.

      Ralf, thanks for all the help and trying to solve it with me.
      I’m looking forward for the startupGracePeriod parameter and think this is going to make the module fully as I like it.
      Thank you for your great work with this module and a grownup replacement for MMM-Pir!!!

      (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

      R 2 Replies Last reply Reply Quote 0
      • R Offline
        rkorell Module Developer @htilburgs
        last edited by rkorell

        @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

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

          @rkorell your welcome…;-)

          (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

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

            @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

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

              @rkorell
              Hi Ralf, I implemented the new version and parameter.
              It works great!

              I’m now playing with the CSS.
              Made the bar smaller (50%) rounded edges and alligned the counter at the left of my screen.

              1dcea511-66b9-4002-82e8-a3d2bec2652b-image.jpeg

              For those who like this setup, just add following in ~/MagicMirror/css/custom.css

              /* MMM-PresenceScreenControl */
              
              .psc-linebar {
                width: 50%;
                height: 5px;
                background: #222;
                border-radius: 4px;
                margin: 6px 0 6px 0;
                overflow: hidden;
                margin-left: auto;
                margin-right: 0;
              }
              
              .psc-bar {
                height: 100%;
                width: 100%;
                border-radius: 4px;
                transition: width 0.4s ease, background 0.4s ease;
                box-shadow: 0 0 6px currentColor;
              }
              
              .psc-timer {
                font-size: 16px;
                margin-top: 4px;
                margin-bottom: 2px;
                letter-spacing: 1px;
                text-align: right !important;
              }
              

              (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

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

                @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 …

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

                  @rkorell
                  My current mirror
                  This is why I have it on the right. For me this feels better.
                  On the left side there comes the Spotify information, when I play music.

                  eac1a738-526d-4d3f-8ad7-4103a12bc910-image.jpeg

                  (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

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

                    @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

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

                      @rkorell
                      I see you’re even using one of my Modules (MMM-MyGarbage)

                      My MusicPlayer (Volumio) is on the left side, too but is spreading the region if cover-art is appearing…
                      

                      Did you do something special for this, or is this an option in de Module?
                      Because when MMM-OnSpotify appears, it just go over everything that is standing there.
                      So for now I’ve disabled it and looking for a solution.

                      (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

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

                        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

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

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

                          Ralf

                          htilburgsH 1 Reply Last reply Reply Quote 1
                          • htilburgsH Offline
                            htilburgs @rkorell
                            last edited by

                            @rkorell
                            That’s correct!
                            At the end, because it currently just works with MMM-OnSpotify, it was not so difficult.

                            I Will look into this in the near future to support other Player also.

                            (still trying to learn JS, but not afraid to ask and AI is my best friend) ☺

                            1 Reply Last reply Reply Quote 0

                            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
                            • 2
                            • 2 / 2
                            • 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