MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    [MMM-Buttons] Connect multiple buttons to send configurable notifications

    System
    15
    40
    21588
    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.
    • PointPubMedia
      PointPubMedia last edited by

      Anyone have an example of a switching profile using Buttons + ProfileSwitcher ?

      M 1 Reply Last reply Reply Quote 0
      • M
        Mar @PointPubMedia last edited by

        @PointPubMedia

                        {
                                module: 'MMM-ProfileSwitcher',
                                config: {
                                        includeEveryoneToDefault: true,
                                        ignoreModules: ["alert", "updatenotification"],
                                        enterMessages: false,
                                        leaveMessages: false,
                                        defaultTime: 15000,
                                        timers: {
                                                "PAGE2":{profile:"default"}, //Switch to defaultClass after defaultTime
                                        }
                                }
                        },
                        {
                                module: 'MMM-Buttons',
                                minShortPressTime: 0,
                                maxShortPressTime: 1000,
                                minLongPressTime: 3000,
                                config: {
                                buttons: [
                                        {
                                                pin:23,
                                                name: "change_profile_1",
                                                longPress: undefined,
                                                shortPress: {
                                                        notification: "CURRENT_PROFILE",
                                                        payload: "PAGE2"
                                                }
                                        },
                                        {
                                                pin: 22,
                                                name: "change_profile_2",
                                                longPress: undefined,
                                                shortPress: {
                                                        notification: "CURRENT_PROFILE",
                                                        payload: "default"
                                                }
                                        }
                                ]
                                }
                        },
        
        1 Reply Last reply Reply Quote 2
        • B
          B4rth last edited by

          can this module be used to send notification to the newsfeed module?
          I can’t get it to work, not throuht sending it directly nether over the remote-module.
          Have anyone have done it and can help me?

          J 1 Reply Last reply Reply Quote 0
          • J
            Jopyth Moderator @B4rth last edited by

            @B4rth Please note that a notification never has a dedicated receiver. It is always a broadcast to all other modules. But sending notifications should definitely work with the module. Is your button working? If you are struggling with the correct URL for sending notifications, you can use this fiddle to build the correct URL.

            The below config should be a simple example for showing an alert (it sends a notification to all modules and the alert module reacts to it):

            {
                module: 'MMM-Buttons',
                config: {
                    buttons: [
                        {
                            pin: 25,
                            name: "test_button",
                            longPress: {
                                notification: "SHOW_ALERT",
                                payload: {"title": "Hello World", "message": "Long Press!"}
                            },
                            shortPress: {
                                notification: "SHOW_ALERT",
                                payload: {"title": "Hello World", "message": "Short Press!"}
                            }
                        }
                    ]
                }
            },
            

            Make sure to check that you are using the correct pin number and change the notification config, if you want another module to react.

            Helpful sticky: How to troubleshoot

            1 Reply Last reply Reply Quote 1
            • PointPubMedia
              PointPubMedia last edited by

              Hey guys…

              Is it me or having this module + ProfileSwitcher + Facial are not working well together.

              I have no issue using the buttons + ProfileSwitcher as I can toggle between profile! Facial recognize me but switch to nothing…

              J 1 Reply Last reply Reply Quote 0
              • J
                Jopyth Moderator @PointPubMedia last edited by

                @PointPubMedia Did you check out this section? There are some changes needed to make both work together smoothly.

                Helpful sticky: How to troubleshoot

                1 Reply Last reply Reply Quote 1
                • R
                  RickyTerzis last edited by

                  Hi…i am a new user here. In my case sing a python test program i can see every single instance of my button press is registered instantly. But in the mirror it seems MMM-Buttons doesnt register pushes unless sometimes I double or triple click.

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    Jopyth Moderator @RickyTerzis last edited by

                    @RickyTerzis I released changes from the development branch, can you try experimenting with the new activeLow setting? Maybe you used the inverse wiring to the one I anticipated?

                    Helpful sticky: How to troubleshoot

                    1 Reply Last reply Reply Quote 0
                    • P
                      pedroken last edited by

                      Hi, @Jopyth, great job on all modules that you developed. They’re great!
                      I`m trying to send a hide module action to the MMM-Remote-Control module in order to hide the clock (I already know that the id is module_2_clock).

                      I can’t get it to work with MMM-Buttons. The button is working (worked with an alert), but I think that I doing the wrong thing on the parameters of the HIDE module action.

                                 {
                                  pin: 5,
                                  name: "HideClock",
                                  shortPress: {
                                     title: "Hide clock Test",
                                      notification: "REMOTE_ACTION",
                                      payload: {"action": "HIDE", "identifier": "module_2_clock"}
                                  },
                                  longPress: undefined
                              }
                      

                      Can you or someone give me a clue?
                      I’d be greateful, thanks!

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        Jopyth Moderator @pedroken last edited by

                        @pedroken I think you almost got it, just use module instead of identifier:
                        payload: {"action": "HIDE", "module": "module_2_clock"}

                        Helpful sticky: How to troubleshoot

                        P 1 Reply Last reply Reply Quote 3
                        • 1
                        • 2
                        • 3
                        • 4
                        • 3 / 4
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy