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

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

Scheduled Pinned Locked Moved System
40 Posts 15 Posters 30.3k Views 14 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.
  • M Offline
    Mar @Jopyth
    last edited by Mar Feb 8, 2017, 1:30 PM Feb 8, 2017, 1:30 PM

    @Jopyth No i had to switch the 1 and the 0 to make it work (0 first, then 1) so my code does differ slightly unfortunately. Suppose I’ll have to remember to manually make the change on updates unless it can be made a config option.
    That could be a good option. We’d need a way for profile switcher to send over all unique profiles which would make it easy to do, rather than scrape the config file for “classes”.

    edit: Though I suppose thinking about this not relying on another module would be much quicker fix.

    1 Reply Last reply Reply Quote 0
    • ? Offline
      A Former User
      last edited by yawns Feb 20, 2017, 10:31 AM Feb 8, 2017, 5:04 PM

      What if I want to send an alert show display message when the GPIO port is ON? I mean, is not like a switch that closes the GPIO port, is when you programatically send an outoput GPIO signal to close (lets say a relay). Is there any changes necessary? I can´t make it happen.

      {
               module: 'MMM-Buttons',
              config: {
              buttons: [
                      {
                       pin: 17,
                      name: "rele",
                      longPress: {
                                      title: "Rele longpress",
                                      message: 'El rele esta siendo pulsado largo',
                                      imageFA: 'power-off',
                                      notification: 'SHOW_ALERT',
                                      payload: {
                                              type: 'notification',
                                              title: 'Alerta rele pulsado largo'
                                      }
                              },
                              shortPress:  {
                                      title: "Rele shortress",
                                      message: 'El rele esta siendo pulsado corto',
                                     imageFA: 'power-on',
                                      notification: 'SHOW_ALERT',
                               payload: {
                                            type: 'notification',
                                              title: 'Alerta rele pulsado largo'
                                   }
      
                              }
      
      
                      }
              ]
                      } //del config
      
       },
      
      1 Reply Last reply Reply Quote 0
      • P Offline
        PointPubMedia
        last edited by Feb 19, 2017, 8:01 PM

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

        M 1 Reply Last reply Feb 20, 2017, 11:22 AM Reply Quote 0
        • M Offline
          Mar @PointPubMedia
          last edited by Feb 20, 2017, 11:22 AM

          @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 Offline
            B4rth
            last edited by Feb 20, 2017, 1:17 PM

            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 Feb 20, 2017, 4:28 PM Reply Quote 0
            • J Offline
              Jopyth Moderator @B4rth
              last edited by Feb 20, 2017, 4:28 PM

              @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
              • P Offline
                PointPubMedia
                last edited by Mar 6, 2017, 10:26 PM

                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 Mar 7, 2017, 7:39 AM Reply Quote 0
                • J Offline
                  Jopyth Moderator @PointPubMedia
                  last edited by Mar 7, 2017, 7:39 AM

                  @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 Offline
                    RickyTerzis
                    last edited by Jul 19, 2017, 6:32 PM

                    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 Jul 20, 2017, 8:16 AM Reply Quote 0
                    • J Offline
                      Jopyth Moderator @RickyTerzis
                      last edited by Jul 20, 2017, 8:16 AM

                      @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
                      • 1
                      • 2
                      • 3
                      • 4
                      • 2 / 4
                      • 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