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.

    Use MMM-Buttons to hide/show modules

    Scheduled Pinned Locked Moved Troubleshooting
    3 Posts 2 Posters 3.1k 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.
    • cruunnerrC Offline
      cruunnerr
      last edited by

      Hey guys,

      another question again -.- ^^

      i am actually trying to show and hide a module with the MMM-Buttons of @Jopyth

      The Buttons Module works fine for show the podcast e.g.

      To show and hide the MMM-GoogleMapsTraffic Module this works also fine:

      http://192.168.178.240:8080/remote?action=SHOW&module=module_0_MMM-GoogleMapsTraffic
      http://192.168.178.240:8080/remote?action=HIDE&module=module_0_MMM-GoogleMapsTraffic

      so i tried to implement that to my Buttons config, but this doesn’t work:

      {
                          module: 'MMM-Buttons',
                          config: {
                              maxShortPressTime: 1000,
                              buttons: [
                                  {
                                      pin: 20,
                                      name: "GoogleMapsTraffic",
                                      shortPress: {
                                          notification: "REMOTE_ACTION",
                                          payload: {action: "HIDE&module=module_0_MMM-GoogleMapsTraffic"}
                                      },
                                      longPress: {
                                          notification: "REMOTE_ACTION",
                                          payload: {action: "SHOW&module=module_0_MMM-GoogleMapsTraffic"}
                                      },
                                  },
                                  {
                                      pin: 19,
                                      name: "Podcast",
                                      shortPress: {
                                          notification: "BUTTON_PRESSED",
                                          payload: {action: ""}
                                      },
                                      longPress: undefined
                                  }
                              ]
                          }
                      },
      

      If i type “RESTART” in the Payload the mirror restarts. So the Button is connected on the right pin.

      Any idea?

      1 Reply Last reply Reply Quote 0
      • N Offline
        ninjabreadman
        last edited by

        Hi @cruunnerr,

        payload.module isn’t part of payload.action, but should be a separate key:

        shortPress: {
          notification: "REMOTE_ACTION",
          payload: {
            action: "HIDE",
            module: "module_0_MMM-GoogleMapsTraffic"
          }
        },
        

        Hope that helps.

        Problem with config or JavaScript? Copy/paste it into JSHint.
        Check out the detailed walkthroughs on install, config, modules, etc.

        1 Reply Last reply Reply Quote 2
        • cruunnerrC Offline
          cruunnerr
          last edited by

          @ninjabreadman said in Use MMM-Buttons to hide/show modules:

          Hope that helps.

          Works. Thank u very much :)

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