MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. istepgueu
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 1
    • Followers 1
    • Topics 4
    • Posts 35
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: [MMM-Buttons] Not recognizing button presses

      For testing in terminal :

      1- Create a button.py file with this :

      import RPi.GPIO as GPIO
      import time
      
      GPIO.setmode(GPIO.BCM)
      GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
      GPIO.setup(25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
      
      tries = 0
      
      while (tries < 200):
          if GPIO.input(25):
              print("Open")
          else:
              print ("Close")
          time.sleep(0.5)
          tries = tries + 1
      
      #GPIO.cleanup()           # clean up GPIO on normal exit
      
      

      2 - Execute with “python button.py”

      3 - Test your button.

      posted in Troubleshooting
      istepgueuI
      istepgueu
    • RE: [MMM-Buttons] Connect multiple buttons to send configurable notifications

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

      Thanks.

      posted in System
      istepgueuI
      istepgueu
    • RE: [MMM-Buttons] Connect multiple buttons to send configurable notifications

      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 ;-)

      posted in System
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      @strawberry-3.141 Thank you !! It’s working :-)

      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      @strawberry-3.141
      Thank you for the help !
      I understand the principle but not knowing javascript, I have a little trouble with the variables.

      This is my (not working) code :

      /* global Module */
      
      /* Magic Mirror
       * Module: MMM-door-sensor
       *
       * By iStepgueu http://www.twitter.com/istepgueu
       * MIT Licensed.
       */
      
      Module.register("MMM-door-sensor",{
      
      	// Default module config.
      	defaults: {
      		text: "Hello World!"
      	},
      
      
      	// Define start sequence.
      	start: function() {
      		Log.info("Starting module: " + this.name);
      
      	},
      
      
      
      	notificationReceived: function(notification, payload, sender) {
      		if (sender) {
      			Log.log(this.name + " received a module notification: " + notification + " from sender: " + sender.name);
      			if (notification === "REMOTE_ACTION") {
      				this.sendSocketNotification(notification, payload);	
      
      				var door_state = "close.png";			
      	
      				this.updateDom();				
      			
      			}
      		} else { 
      			if (notification === "DOM_OBJECTS_CREATED") {
      				this.sendSocketNotification("REQUEST_DEFAULT_SETTINGS");
      			
      				var door_state = "open.png";
      
      
      				this.updateDom();
      
      
      			}
      		}
      		
      		},
      
      
      		getDom: function() {
      
      		var wrapper = document.createElement("div");
      		return door_state;
      		wrapper.innerHTML = '<img src=" + door_state + " />';
      		return wrapper;
      	}
      
      
      
      });
      
      
      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      I have create a MMM-door-sensor ‘module’
      https://github.com/istepgueu/MMM-door-sensor

      The module receive SHOW_ALERT and HIDE_ALERT from MMM-Buttons but I do not know how to show such or such text (Toto/Tata) according to the received notification.

      Any help is welcome.
      Thank you very much ;)

      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      @morozgrafix Ok I understand the principle. I will try to look at this but I do not have enough skills.

      On the way to create a module “MMM-doors-sensor”

      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      Yes !

      I have successfuly installed MMM-buttons and connect my first magnetic sensor to pin24

      When contact is ON, nothing happen.
      When contact is OFF, I have the notification message and the RPI Shutdown.

      Now I’m a bit stuck for the rest.
      I do not see how to display images in a specific place in the mirror.

      Here is the working code :

      {
          module: 'MMM-Buttons',
          config: {
              buttons: [
      
      {
                      pin: 24,
                      name: "power",
                      longPress: {
                          title: "Power off",
                          message: "Keep pressed for 3 seconds to shut down",
                          imageFA: "power-off",
                          notification: "REMOTE_ACTION",
                          payload: {action: "SHUTDOWN"}
                      },
                      shortPress: undefined
                  }
      
              ]
          }
      },
      
      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      I think it’s possible to adapt MMM-Buttons for my project.
      https://github.com/Jopyth/MMM-Buttons

      I connected my 1 garage sensor to PIN 25 and GND
      I connected my 2 garage sensor to PIN 24 and GND
      How can i show a png file when sensor 1 (or 2) is “pressed” ?

      Thanks a lot ;-)

      posted in Requests
      istepgueuI
      istepgueu
    • RE: Garage Door Detectors

      Hello.

      Here is my current “installation”.

      alt text

      My 2 door sensors send 1 or 0 if there is contact.

      Depending on the result, LEDs 1 and 2 light up red or green.

      0_1486025374805_Capture d’écran 2017-02-02 à 09.37.06.png

      What I would like is to replace the leds with a logo on the mirror.
      (I have a door on the street side and a door on the garden side which explains the logos)

      0_1486025879937_logos-rouge.png
      1_1486025879938_logo-verts.png

      Here is the code of my Arduino project.

      #include   
      
      const int  C_buttonPin = 12; // Door 1 
      const int  H_buttonPin = 13; // Door 2
      
      const int ledsPin = 2;
      const int nombreLeds = 2;
      const int intervalleTemps = 200;
      Adafruit_NeoPixel pixels = Adafruit_NeoPixel(nombreLeds, ledsPin);
      
      int C_buttonState = 0;         // Etat actuel Door 1
      int H_buttonState = 0;         // Etat actuel Door 2
      
      // the setup routine runs once when you press reset:
      void setup() {
        // initialize serial communication at 9600 bits per second:
        Serial.begin(9600);
        // make the pushbutton's pin an input:
        pinMode(12, INPUT_PULLUP);
        pinMode(13, INPUT_PULLUP);
        pixels.begin();
        pixels.show();
      }
      
      // the loop routine runs over and over again forever:
      void loop() {
      
       int sensorValC = digitalRead(12); Serial.println(sensorValC);
       int sensorValH = digitalRead(13); Serial.println(sensorValH);
      
        
      if (sensorValC == 1) 
      {
      pixels.setPixelColor(0, 255,0,0);  
      }
      else
      {
      pixels.setPixelColor(0, 124,252,0);
      }
      
      if (sensorValH == 1) 
      {
      pixels.setPixelColor(1, 255,0,0); 
      }
      else
      {
      pixels.setPixelColor(1, 124,252,0); 
      }
      
      
      
      pixels.show();
      delay(intervalleTemps);
      
      }
      

      Ho and sorry for my bad english (i’m from Belgium)

      posted in Requests
      istepgueuI
      istepgueu
    • 1
    • 2
    • 3
    • 4
    • 3 / 4