• 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.
  • J Offline
    Jopyth Moderator
    last edited by Jopyth Jan 30, 2017, 8:18 AM Jan 28, 2017, 3:28 PM

    Description:

    This is a module for Magic Mirror² to act based on button presses via GPIO.
    It is basically a generalized version of the Button module, original idea comes from @PtrBld.
    It is capable of connecting multiple buttons at once, which can be individually configured.
    However it only sends out notifications to other modules.

    For example this can be used to send notifications to the following modules:

    • Remote Control
    • Profile Switcher

    Download:

    [card:Jopyth/MMM-Buttons]

    FAQ

    Error on npm install: An unhandled error occurred inside electron-rebuild. Unable to find electron-prebuilt’s version number, either install it or specify an explicit version

    Possible Solution: Upgrade your MagicMirror 2.1.0 or higher.

    Changelog

    [1.0.0] - 2017-01-28

    Initial release of the Buttons module.

    Helpful sticky: How to troubleshoot

    1 Reply Last reply Reply Quote 3
    • B Offline
      Burner911
      last edited by Jan 28, 2017, 8:13 PM

      This sounds awesome! Do you think there is a relatively easy way to output from the GPIO instead? I would like to turn my TV off using a transistor being it does not support HDMI-CEC like a monitor does. I’m thinking this might be best discussed with regards to MMM-Remote-Control.

      1 Reply Last reply Reply Quote 0
      • T Offline
        tosti007 Module Developer
        last edited by Jan 30, 2017, 11:08 AM

        Nice! I think many people will be able to use this for their mirror

        If there is anything don't hesitate to contact me!
        ProfileSwitcher, TouchNotifications

        1 Reply Last reply Reply Quote 0
        • I Offline
          istepgueu
          last edited by istepgueu Feb 3, 2017, 10:20 AM Feb 3, 2017, 9:41 AM

          Hi @Jopyth !

          Thanks for your module.

          I would like to use an on / off button instead of a push button
          for my garage door project (https://forum.magicmirror.builders/topic/1620/garage-door-detectors)

          Is there a way to send a notification on “button_up” and an other notification on “Button_down” ?

          Thank you very much ;-)

          1 Reply Last reply Reply Quote 0
          • I Offline
            istepgueu
            last edited by Feb 3, 2017, 5:39 PM

            Does anyone know how to read the initial value of a button (GPIO) before it is run ?

            Thanks.

            1 Reply Last reply Reply Quote 0
            • M Offline
              Mar
              last edited by Feb 6, 2017, 10:52 PM

              @Jopyth Moved my post here out from another thread.

              I am having one more issue though. Using 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…then sometimes the button registers 5-6 times. I’m not really sure how to debug this sort of thing.

              Also would it be right to assume the pull up/down resistors were not enabled with MMM-Buttons?

              I 2 Replies Last reply Feb 6, 2017, 10:56 PM Reply Quote 0
              • I Offline
                istepgueu @Mar
                last edited by Feb 6, 2017, 10:56 PM

                @Mar all is here https://forum.magicmirror.builders/topic/211/button

                ;-)

                M 1 Reply Last reply Feb 6, 2017, 11:21 PM Reply Quote 0
                • I Offline
                  istepgueu @Mar
                  last edited by Feb 6, 2017, 10:58 PM

                  @Mar i have same problem. I run my little script button.py before start MM and its solve the problem

                  M 1 Reply Last reply Feb 6, 2017, 11:20 PM Reply Quote 0
                  • M Offline
                    Mar @istepgueu
                    last edited by Mar Feb 6, 2017, 11:35 PM Feb 6, 2017, 11:20 PM

                    @istepgueu Ive taken your button.py program and modified it for me two buttons 5/6. And while the program reads my button presses perfectly, MM-Buttons doesnt at all. I pretty much have to double click each time to make a button register. It switches my profiles just fine … but just takes lots of clicks to register.

                    import RPi.GPIO as GPIO
                    import time
                    
                    GPIO.setmode(GPIO.BCM)
                    GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP)
                    GPIO.setup(6, GPIO.IN, pull_up_down=GPIO.PUD_UP)
                    
                    tries = 0
                    
                    while (tries < 200000):
                        if GPIO.input(6):
                            print("Open 6")
                        else:
                            print("Close 6")
                        if GPIO.input(5):
                            print("Open 5")
                        else:
                            print ("Close 5")
                        time.sleep(0.5)
                        tries = tries + 1
                    
                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      Mar @istepgueu
                      last edited by Mar Feb 7, 2017, 12:08 AM Feb 6, 2017, 11:21 PM

                      @istepgueu Will take a look through this now, but i already have a 1k resistor between pins 5/6 and the respective button. Hopefully something else comes up here.

                      Yes my problem seems a bit opposite of what was posted in your link. I dont have any erroneous button presses, it just takes a few clicks until MMM-Buttons registers the click. You button.py registers every click instantly. So must be something in the buttons code?

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        1/40
                        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