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 2.8k 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
          • 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