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.

    Combining MMM-GroveGestures and MMM-Page-Selector

    Scheduled Pinned Locked Moved Solved Troubleshooting
    7 Posts 2 Posters 303 Views 2 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.
    • C Offline
      ChanceTime
      last edited by

      Hi there! I’m on my third update of my Magic Mirror after the previous OS revision of Raspbian busted my RPi (I wasn’t able to generate a taskbar until Bookworm came out??) and am trying to restore some of the functionality I had in rev 1 of my build, where I could use MMM-GroveGestures to swap between pages of modules. I tested and the sensor works, and I am able to get recognition of the gesture movement when I move my hand in front of the sensor in the MM app, but I think there must be an issue in the notification being sent to MMM-Page-Selector and I am stumped. I tried using this.SendNotification and continually got errors as well (I’ll leave the commented versions in in case that was my issue).

      A lightly redacted version of my config file is below:

      /* Config Sample
       *
       * For more information on how you can configure this file
       * see https://docs.magicmirror.builders/configuration/introduction.html
       * and https://docs.magicmirror.builders/modules/configuration.html
       *
       * You can use environment variables using a `config.js.template` file instead of `config.js`
       * which will be converted to `config.js` while starting. For more information
       * see https://docs.magicmirror.builders/configuration/introduction.html#enviromnent-variables
       */
      let config = {
      address: "localhost", // Address to listen on, can be:
      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
      // - another specific IPv4/6 to listen on a specific interface
      // - "0.0.0.0", "::" to listen on any interface
      // Default, when address config is left out or empty, is "localhost"
      port: 8080,
      basePath: "/", // The URL path where MagicMirror² is hosted. If you are using a Reverse proxy
      // you must set the sub path here. basePath must end with a /
      ipWhitelist: [redacted], // Set [] to allow all IP addresses
      // or add a specific IPv4 of 192.168.1.5 :
      // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
      // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
      // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
      
      useHttps: false, // Support HTTPS or not, default "false" will use HTTP
      httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
      httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true
      
      language: "en",
      locale: "en-CA",   // this variable is provided as a consistent location
        // it is currently only used by 3rd party modules. no MagicMirror code uses this value
        // as we have no usage, we  have no constraints on what this field holds
        // see https://en.wikipedia.org/wiki/Locale_(computer_software) for the possibilities
      
      logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
      timeFormat: 12,
      units: "metric",
      
      modules: [
      {
      module: "MMM-Page-Selector",
      position: "top_center",
      config: {
      defaultPage: "mainPage",
      displayTitle: false,
      selectPageNotif: ["PAGE_SELECT"],
      incrementPageNotif: ["PAGE_UP"],
      decrementPageNotif: ["PAGE_DOWN"],
      persistentPages: true,
      }
      },
      {
      module: "MMM-GroveGestures",
      //position: "top_right",
      pages: {"all": "top_right"},
      config: {
      autoStart: true,
      verbose: false,
      recognitionTimeout: 1000,
      idleTimer: 0,
      },
      defaultNotification: "GESTURE",
      pythonPath: "/usr/bin/python",
      
      defaultCommandSet: "default",
      commandSet: {
      "default": {
      "FORWARD": {
      notificationExec: {
      notification: "PAGE_SELECT",
      payload: "mainPage",
      },
      //this.sendNotification: ("PAGE_SELECT", "mainPage");
      },
      "BACKWARD": {
      notificationExec: {
      notification: "PAGE_SELECT",
      payload: "work",
      },
      //this.sendNotification("PAGE_SELECT", "work"),
      },
      "UP": {
      },
      },
      },
      },
      {
      module: "alert",
      // pages: {"all": "top_bar"},
      },
      {
      module: "updatenotification",
      //position: "top_bar"
      // pages: {"all": "top_bar"},
      },
      {
      module: "clock",
      //position: "top_left"
      pages: {"mainPage": "top_left"},
      },
      {
      module: "calendar",
      header: "Calendar",
      //position: "top_left",
      pages: {"mainPage": "top_left"},
      config: {
      calendars: [
      {
      fetchInterval: 7 * 24 * 60 * 60 * 1000,
      symbol: "calendar-check",
      url: "redacted.ics",
      }
      ]
      }
      },
      {
      module: "calendar",
      header: "Upcoming Birthdays",
      //position: "top_left",
      pages: {"mainPage": "top_left"},
      config: {
      calendars: [
      {
      fetchInterval: 7 * 24 * 60 * 60 * 1000,
      symbol: "calendar-check",
      url: "redacted.ics"
      }
      ]
      }
      },
      {
      module: 'MMM-Block',
      //position: 'top_right',
      pages: {"mainPage": "top_right"},
      config: {
      height: 132,
      }
      },
      {
      module: 'MMM-EnvCanada',
      //position: 'top_right',
      pages: {"mainPage": "top_right"},
      header: "Environment Canada",
      config:{
      siteCode: "redacted",
      provCode: "ON",
      updateInterval: 10 * 60 * 1000,
      language: "e",
      textForecasts: 2,
      showAlerts: true,
      showForecastDays: 5,
      }
      {
      module: 'MMM-Todoist',
      //position: 'bottom_bar',
      pages: {"mainPage": "bottom_bar"},
      header: 'Todoist',
      config: {
      hideWhenEmpty: false,
      accessToken: 'redacted',
      maximumEntries: 10,
      updateInterval: 10 * 60 * 1000,
      fade: false,
      //projects: [],
      labels: ['MagicMirror'],
      }
      },
      
      // Work!
      
      {
      module: "MMM-SpaceLaunch",
      pages: {"work": "top_right"},
      config: {
      showMission: true,
      showLaunchDate: true,
      showRocket: true,
      showLaunchSite: true,
      showLocation: false,
      showPayload: true,
      showOrbit: true,
      showDetails: false,
      }
      },
      ]
      };
      
      /*************** DO NOT EDIT THE LINE BELOW ***************/
      if (typeof module !== "undefined") { module.exports = config; }
      

      Thanks in advance!

      S 1 Reply Last reply Reply Quote 1
      • C Offline
        ChanceTime @sdetweil
        last edited by

        @sdetweil nevermind - I fixed it thanks to your suggestion to use the second module! Found where GESTURE_DETECTED was coming from in MMM-GroveGestures.js and edited my notifications in there. I really appreciate your support!

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

          @ChanceTime said in Combining MMM-GroveGestures and MMM-Page-Selector:

          this.SendNotification

          MagicMirror is case sensitive
          this.sendNotfication, is not the same as this.SendNotification

          I do not know if ‘this’ is set at the time of use in config.js

          but you do not need any code, there is configuration for
          what notification to send and what data(payload) goes with it , and you are using those

          "BACKWARD": {
          notificationExec: {
          notification: "PAGE_SELECT",
          payload: "work",
          },
          }
          

          I would install MMM-ViewNotifications to see if the notifications are being sent

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          C 3 Replies Last reply Reply Quote 0
          • C Offline
            ChanceTime @sdetweil
            last edited by

            @sdetweil ah!! Thanks so much for this - I’ll give it a shot when I get home this evening and report back. :)

            1 Reply Last reply Reply Quote 0
            • C Offline
              ChanceTime @sdetweil
              last edited by

              @sdetweil so I tested with MMM-ViewNotifications! I am seeing MMM-GroveGestures GESTURE_DETECTED get registered, but nothing from inside of the movement (FORWARD, BACKWARD) from the MMM-GroveGestures section despite the correct movements being shown on the screen. Any ideas?

              1 Reply Last reply Reply Quote 0
              • C Offline
                ChanceTime @sdetweil
                last edited by

                @sdetweil nevermind - I fixed it thanks to your suggestion to use the second module! Found where GESTURE_DETECTED was coming from in MMM-GroveGestures.js and edited my notifications in there. I really appreciate your support!

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

                  @ChanceTime awesome!!!

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S sdetweil has marked this topic as solved on
                  • S Offline
                    sdetweil @ChanceTime
                    last edited by

                    @ChanceTime you edited in config.js, right?

                    never edit the module source

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    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 Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy