• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.
  • C Offline
    cruunnerr
    last edited by Jan 8, 2018, 4:39 PM

    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 Jan 9, 2018, 5:27 AM

      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
      • C Offline
        cruunnerr
        last edited by Jan 9, 2018, 7:25 PM

        @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
        1 / 1
        • First post
          1/3
          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