Use MMM-Buttons to hide/show modules



  • 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?



  • 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.



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

    Hope that helps.

    Works. Thank u very much 🙂