MagicMirror Forum

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

    PIR and config.js

    Utilities
    3
    16
    527
    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.
    • N6NG
      N6NG last edited by sdetweil

      I saw the thread about running the script below to see if the screen would react to the vcgencmd.

      /usr/bin/vcgencmd display_power 0; echo “Display should now be off”; sleep 20; /usr/bin/vcgencmd display_power 1; echo “And now it should be on again”

      I did so and the screen did as advertised… My problem is I’m not sure how to incorporate this into the config.js to make my PIR work properly.

      {
      		module: "MMM-PIR-Sensor-Lite",
      		position: "top_right",
      		config: {
      			sensorPin: 2, // GPIO pin
      		        commandType:  "vcgencmd",  
                                      }
      } 
      

      Can one of you smart people give me some ideas?
      Thanks all…
      Dennis

      S S 2 Replies Last reply Reply Quote 0
      • S
        sdetweil @N6NG last edited by

        @N6NG those commands should be what the pir module execute.

        examine the node_helper.js

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • S
          shall_ @N6NG last edited by

          @N6NG I have just spent the evening getting my MM working with this module. What do you want this module to do? turn the screen off 20 seconds after motion is detected?

          I am using the latest version of Desbian so i had to used the default xrandr command. but I seem to have got it working fine. I was also having issues with GPIO pin 2 so I changed it to pin 22.

          If it helps, I can share my config file for this module.

          N6NG 2 Replies Last reply Reply Quote 1
          • N6NG
            N6NG @shall_ last edited by

            @shall_ Yes… I would like to look at it… If you would like not to post it to public, you can send it to my protected email
            wg7dgxytg@relay.firefox.com
            Thanks
            Dennis

            1 Reply Last reply Reply Quote 0
            • N6NG
              N6NG @shall_ last edited by

              @shall_ Although it might help others if you don’t mind posting it here…
              Thanks
              Dennis

              1 Reply Last reply Reply Quote 0
              • N6NG
                N6NG last edited by

                I never saw an example of what the config.js would look like to have the vcgencmd be used to turn the screen on and off. Would someone post a part of a config.js with this in use so I can get a look at how it would be used? I would appreciate it.
                Thanks all
                Dennis

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

                  @N6NG edit the node_hekper.js and see what it does. change as u see fit

                  Sam

                  Create a working config
                  How to add modules

                  N6NG 1 Reply Last reply Reply Quote 0
                  • N6NG
                    N6NG @sdetweil last edited by

                    @sdetweil Use the whole node_helper.js except as I modify it? The only thing I would modify would be the sensor pin number… All else would stay the same?
                    Thanks

                    N6NG 1 Reply Last reply Reply Quote 0
                    • N6NG
                      N6NG @N6NG last edited by

                      @N6NG Do I modify it where it is or do I copy it into the config.js ? If I modify it where it is and change the sensor pin what would I put in the config.js?

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

                        @N6NG said in PIR and config.js:

                        @N6NG Do I modify it where it is or do I copy it into the config.js ? If I modify it where it is and change the sensor pin what would I put in the config.js?

                        all you are doing is changing the vcgencmd string

                        exec(“…”)

                        then everything else is normal in config.js

                        pin and commandType (I didn’t look at the module doc)

                        Sam

                        Create a working config
                        How to add modules

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