Navigation

    MagicMirror Forum

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

    Another PIR sensor

    Requests
    3
    19
    209
    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.
    • D
      DaVinki last edited by

      Hi all,

      At this moment I am using my MM as a wall decoration instead of a mirror, displaying images using MMM-wallpaper and various other modules. I Have connected a PIR sensor to my Pi, which works, but is currently disabled since I use Google Home to turn on/off the monitor.

      What I was thinking of is using the PIR sensor to show modules like weather forecast, nstreinen module etc. I Reckon this uses the “USER PRESENCE” notification. However, all PIR modules I look at are build to power off the monitor completely.

      Is anyone able to build a module for this, or maybe push me in the right direction?

      1 Reply Last reply Reply Quote 0
      • wishmaster270
        wishmaster270 Module Developer last edited by

        Hi,

        to me it sounds more like pages/profiles you are looking for.
        My https://github.com/Tom-Hirschberger/MMM-GPIO-Notifications module is able to trigger notifications based on GPIO events.
        In combination with https://github.com/tosti007/MMM-ProfileSwitcher and https://github.com/Tom-Hirschberger/MMM-ProfileControl you could toggle through the profiles with your PIR sensor.

        D 1 Reply Last reply Reply Quote 0
        • D
          DaVinki @wishmaster270 last edited by DaVinki

          @wishmaster270 Thanks for the reply. I Have been trying to get this to work, but some simple code breaks my config:

               {
                     module: 'MMM-GPIO-Notifications',
                      config: {
                          '22': {
                          gpio_state: 0,
                          gpio_debounce: 10,
                          delay: 1000,
                          notifications: [
                            {
                            notification: 'USER_PRESENCE',
                            payload: true,
                            profiles: 'pageOneEveryone',
                                   },
                          ]
                          }
                          }
                  },
              {
                  module: 'MMM-ProfileSwitcher',
                  config: {
                      // See 'Configuration options' for more information.
                  {
                   module: 'MMM-Wallpaper',
                   classes: 'pageOneEveryone',
                  },
                  } 
              },
          

          When commenting out the " modules" config in ProfileSwitcher, my config.js works. Is there something I am missing, or should I first create configurations for every single module?

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

            @DaVinki said in Another PIR sensor:

            {
                module: 'MMM-ProfileSwitcher',
                config: {
                    // See 'Configuration options' for more information.
                {                                    // < ----- what is that ?
                 module: 'MMM-Wallpaper',
                 classes: 'pageOneEveryone',
                },                                   // < ----- what is that?
                } 
            }
            

            seems there are too many {}

            D 2 Replies Last reply Reply Quote 0
            • D
              DaVinki @sdetweil last edited by

              @sdetweil said in Another PIR sensor:

              {

              Code directly taken from the module page https://github.com/tosti007/MMM-ProfileSwitcher. Seems to me you need the bracket for a per module assignment of the class.

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

                @sdetweil said in Another PIR sensor:

                @DaVinki said in Another PIR sensor:

                {
                    module: 'MMM-ProfileSwitcher',
                    config: {
                        // See 'Configuration options' for more information.
                    {                                    // < ----- what is that ?
                     module: 'MMM-Wallpaper',
                     classes: 'pageOneEveryone',
                    },                                   // < ----- what is that?
                    } 
                }
                

                seems there are too many {}

                Removing the brackets results in a black screen. Assigning the wallpaper module to IgnoredModules class doesn’t change that. Using square brackets [] also breaks the config.

                I Checked for comma’s, opening and closing brackets, the usual suspects, but as far as I can see I didn’t miss any.

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

                  @DaVinki said in Another PIR sensor:

                  MMM-GPIO-Notifications

                  do

                  cd ~/MagicMirror
                  npm config:check
                  

                  black screen, open the developers console, ctrl-shift-i on the keyboard,
                  and select the tab labeled ‘console’ and scroll up to see any errors, usually red text.

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

                    @sdetweil said in Another PIR sensor:

                    @DaVinki said in Another PIR sensor:

                    MMM-GPIO-Notifications

                    do

                    cd ~/MagicMirror
                    npm config:check
                    

                    black screen, open the developers console, ctrl-shift-i on the keyboard,
                    and select the tab labeled ‘console’ and scroll up to see any errors, usually red text.

                    npm config:check is an incorrect command.

                    The black screen shows no errors. It states that the modules are hidden. Even the wallpaper module, which should be ignored.

                    MMM-Wallpaper is suspended. module.js:198:7
                    MMM-Wallpaper is hidden. MMM-ProfileSwitcher.js:113:25
                    
                    
                    S 1 Reply Last reply Reply Quote 0
                    • S
                      sdetweil @DaVinki last edited by sdetweil

                      @DaVinki said in Another PIR sensor:

                      npm config:check is an incorrect command.

                      yeh,

                      npm run config:check

                      i would disable each module one at a time til I found the one hiding everything

                      add
                      disabled: true,
                      after the module statement

                      {
                      module: name,
                      disabled: true,
                      position:
                      config: {
                      }
                      }

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

                        @sdetweil said in Another PIR sensor:

                        @DaVinki said in Another PIR sensor:

                        npm config:check is an incorrect command.

                        yeh,

                        npm run config:check

                        i would disable each module one at a time yil I found the one hiding everything

                        add
                        disabled: true,
                        after the module statement

                        {
                        module: name,
                        disabled: true,
                        position:
                        config: {
                        }
                        }

                        Yeah, the culprit is MMM-ProfileSwitcher. Somehow I can not get that config working.

                        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