MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

MMM-buttons help/advice to turn multiple modules on/off



  • Hi All

    I want to add the ability to press a button to hide all modules except google photos and vice versa, (working as a digital photo frame instead of a mirror) and I was trying to use the MMM-buttons module to send commands for MMM-Remote-Control (which is working from my browser), however it seems to keep throwing up the error with the usual create a config msg when I have even 1 button enabled.

    First question is reference my button setup, I currently have 1 button setup in pull_down (as in below pic), it’s setup on pin 24, as in the MMM-buttons example, however I’m now having second thoughts on if this is the right setup?

    0_1573248589754_8b57bf95-1be7-4d77-bba4-3781fb7bff29-image.png

    It’s been a while since I did anything with my Pi, so the previous testing of buttons, switches, leds etc I’ve mostly forgotten and I couldn’t find a python script to test the button in pull_down, however I’m pretty sure it’s the config that’s wrong at this stage.

    I have tried editing the buttons config several times & lost track of what I have and haven’t done, so I went back to the original config code and commented out the 2nd button, but no matter what I try it doesn’t work, so here’s the code

    code{
                                    module: 'MMM-Buttons',
                                    config: {
                                    buttons: [
                                    {
                                            pin: 24,
                                            name: "monitor_control",
                                            longPress: {
                                                    notification: "REMOTE_ACTION",
                                                    payload: {action: "MONITOROFF"}
                                            },
                                            shortPress: {
                                                    notification: "REMOTE_ACTION",
                                                    payload: {action: "MONITORON"}
                                            }
                                    },
                                    //{
                                            //pin: 24,
                                            //name: "power",
                                            //longPress: {
                                                    //title: "Power off",
                                                    //message: "Keep pressed for 3 seconds to shut down",
                                                    //imageFA: "power-off",
                                                    //notification: "REMOTE_ACTION",_text
                                                  //payload: {action: "SHUTDOWN"}
                                    //},
                                            //shortPress: undefined
                                    //}
                                    ]                                                                                                                                                               
                            }
                            },
    

    Any help/advice appreciated

    P.s I was originally wanting to use voice commands to my echo to do it, but the only one I found to do what I want was MMM-AlexaOnOff & it appears that’s got issues due to a change around wemo protocol, but if anyone has an option to make this work instead of a button, I’m open to considering that idea.


Log in to reply