MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UNSOLVED MMM-EyeCandy shown when USER_PRESENCE

    Troubleshooting
    3
    8
    1367
    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.
    • T
      thedk last edited by

      Searching for a while, how i can hide modules when PIR doesnt detect movement. So i used the voice control part from EyeCandy modul.
      I’m new in MagicMirror, is it correct like this:

      notificationReceived: function(notification, payload) {
              if (payload === false) {
                  this.hide();
              } else if (notification === 'USER_PRESENCE') {
                  this.show(2000);
              }
      
          },
      
      

      this.show means how long the eyecandy is shown?

      Mykle1 1 Reply Last reply Reply Quote 0
      • Mykle1
        Mykle1 Project Sponsor Module Developer @thedk last edited by Mykle1

        @thedk said in MMM-EyeCandy shown when USER_PRESENCE:

        this.show means how long the eyecandy is shown?

        this.show(2000); means the transition from hidden to shown is 2000ms, or 2 seconds…

        Now, in order to hide all modules “when the PIR doesn’t detect any movement”, you could try something like this within the PIR module

        notificationReceived: function(notification, payload) {
                if (payload === false) {
                      MM.getModules().enumerate((module) => {
                                   module.hide(2000);
                              });
                } else if (notification === 'USER_PRESENCE') {
                      MM.getModules().enumerate((module) => {
                                   module.show(2000);
                              });
                },
        

        Something like that.

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 1
        • T
          thedk last edited by

          Thanks for that.
          To hide all modules i an other problem. I have a discussion about that, when the screen goes off to save energy.
          I wanr to use this code just for eyecandy an maybe newsfeed cause of the high Temperatur of the Pi when its always running.

          1 Reply Last reply Reply Quote 0
          • T
            thedk last edited by

            Is it possible to add a duration how long the eyecandy is shown?
            Rest works fine.

            Mykle1 1 Reply Last reply Reply Quote 0
            • Mykle1
              Mykle1 Project Sponsor Module Developer @thedk last edited by

              @thedk said in MMM-EyeCandy shown when USER_PRESENCE:

              Is it possible to add a duration how long the eyecandy is shown?

              I’ll take a look at it when I get a chance. In the meantime, you could use something like this https://github.com/ianperrin/MMM-ModuleScheduler to accomplish that. Or, there are a few voice modules that can hide or show modules upon command.

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • T
                thedk last edited by

                With the Sheduler it wouldnt work, i guess.
                I just want to show the eyecandy when PIR detects movement for some seconds. Maybe it isnt that complicated and just a little command?

                1 Reply Last reply Reply Quote 0
                • ejay-ibm
                  ejay-ibm Project Sponsor Module Developer last edited by ejay-ibm

                  Hi all,
                  I’m looking for something similar than the main thread request.
                  I need to switch between 2 gif images on notification sent by other module.
                  Eg : On notification 1 , diplay gif one , on notification 2 display Gif 2 .
                  I can’t find how to achieve this…
                  @Mykle1 Do you still make developement on this module ? If yes would it be possible to implement some notification consideration in your module to handle multiple custom images ?
                  Thank you !

                  Ejay

                  Mykle1 1 Reply Last reply Reply Quote 0
                  • Mykle1
                    Mykle1 Project Sponsor Module Developer @ejay-ibm last edited by

                    @ejay-ibm

                    That is really not the purpose of this module. It was designed to simply show animations. Perhaps one of the image modules would be better suited to your needs. I will look into this when I am not so busy.

                    Create a working config
                    How to add modules

                    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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy