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

    Posts

    Recent Best Controversial
    • RE: MMM-Carousel switching slides using MMM-Buttons

      finally I got it!!!

      in the config.js section of MMM-Buttons Module I generated two new “broadcast notifications” that are sent once the according button is pressed:

      buttons: [
      {	pin: 05,
              name: "Slide increment",
              shortPress: {
                   notification: "SLIDE_INCREMENT",
      	},
      },
      {	pin: 06,
              name: "Slide decrement",
              shortPress: {
                   notification: "SLIDE_DECREMENT",
      	},
      },
      ]
      

      and in MMM-Carousel.js I added the following code lines in line 65:

      // Handle notifications sent from MMM-Buttons Module
             if (notification === "SLIDE_INCREMENT") {
                 this.manualTransition(undefined, 1);
                 this.restartTimer();
             }
             if (notification === "SLIDE_DECREMENT") {
                 this.manualTransition(undefined, -1);
                 this.restartTimer();
             }
      

      Of course the transitionInterval for automatic slide change needs to be set to ‘0’
      Now it’s possible to switch between various pages by a simple button press.

      Hope this helps!

      Best,
      onkelbobby

      posted in Troubleshooting
      O
      onkelbobby
    • RE: MMM-Carousel switching slides using MMM-Buttons

      Hi AxLED,
      thanks for your response.

      I tried to trigger the NextSlide function (line 75) and the PrevSlide function (line 79) by adding the following code:

      notificationReceived: function (notification, payload, sender) {
                  var position, positions = ['top_bar', 'bottom_bar', 'top_left', 'bottom_left', 'top_center', 'bottom_center', 'top_right', 'bottom_right', 'upper_third', 'middle_center', 'lower_third'];
                  if (notification === 'MODULE_DOM_CREATED') {
                      // Initially, all modules are hidden except the first and any ignored modules
                      // We start by getting a list of all of the modules in the transition cycle
                      if ((this.config.mode === 'global') || (this.config.mode === 'slides')) {
                          this.setUpTransitionTimers(null);
                      } else {
                          for (position = 0; position < positions.length; position += 1) {
                              if (this.config[positions[position]].enabled === true) {
                                  this.setUpTransitionTimers(positions[position]);
                              }
                          }
                      }
                  },
                  //-----BOBBY CODE
                  switch (notification) {
                      case 'SLIDE_INCREMENT':
                        Log.log(`${this.name} recieved a notification to increment slides!`);
                        this.manualTransition(undefined, 1);
                        this.restartTimer();
                        break;
                      case 'SLIDE_DECREMENT':
                        Log.log(`${this.name} recieved a notification to decrement slide!`);
                        this.manualTransition(undefined, -1);
                        this.restartTimer();
                        break;
                      default:
                  //-----BOBBY CODE END
      
                  // Handle KEYPRESS events from the MMM-KeyBindings Module
                  if (notification === "KEYPRESS_MODE_CHANGED") {
                      this.currentKeyPressMode = payload;
                  }
                  // if (notification === "KEYPRESS") {
                  //     console.log(payload);
                  // }
                  if (notification === "KEYPRESS" && (this.currentKeyPressMode === this.config.keyBindingsMode) && 
                          payload.KeyName in this.reverseKeyMap && payload.Sender === this.instance) {
                      if (payload.KeyName === this.config.keyBindings.NextSlide) {
                          this.manualTransition(undefined, 1);
                          this.restartTimer();
                      }
                      else if (payload.KeyName === this.config.keyBindings.PrevSlide) {
                          this.manualTransition(undefined, -1);
                          this.restartTimer();
                      }
                      else if (this.reverseKeyMap[payload.KeyName].startsWith("Slide")) {
                          var goToSlide = this.reverseKeyMap[payload.KeyName].match(/Slide([0-9]+)/i);
                          console.log((typeof goToSlide[1]) + " " + goToSlide[1]);
                          if (typeof parseInt(goToSlide[1]) === "number") { 
                              this.manualTransition(parseInt(goToSlide[1]));
                              this.restartTimer();                        
                          }
                      }
                  }
              },
      

      but unfortunately it is not working. Do you have any idea why?

      posted in Troubleshooting
      O
      onkelbobby
    • RE: MMM-Carousel switching slides using MMM-Buttons

      Nobody any idea?

      posted in Troubleshooting
      O
      onkelbobby
    • MMM-Carousel switching slides using MMM-Buttons

      Hi all,
      first of all I want to thank all of you for this excellent work both in generating the MM platform and especially for developing very impressive and valuable modules.

      Besides the screen we also integrated two pushbuttons in our mirror and implemented them with MMM-Buttons – working perfectly fine.

      The intention with our mirror is to have various slides - all of them showing a different modules and module positions. For switching between the slides we want to use the two pushbuttons. The pushbutton on the right shall be used for increasing the slide number and the button on the left side of the mirror shall decrease the slide number.

      After searching MM forum I found a way to do something similar by using MMM-pages: In the MMM-pages.js is a section that handles notifications here in line 71 the notification ‘PAGE_INCREMENT’ and in line 76 the notification ‘PAGE_DECREMENT’ is interpreted and the pages are switched accordingly. Unfortunately MMM-pages does not offer the possibility to place modules on various positions.

      Since we definitely want to use modules on different positions on various pages we decided to use the “slides” functionality of MMM-Carousel as described here https://forum.magicmirror.builders/topic/6640/could-use-some-assistance-setting-up-mmm-carousel-w-navigation-and-understanding-the-architecture/8.
      Unfortunately we didn’t find any similar solution in MMM-Carousel and since we’re not very familiar to java coding we’re currently stuck.

      Is there someone who can help us with a few lines of code to be implemented maybe in the MMM-Carousel.js? Or is this function already implemented and up to now we simply overlooked it?

      Thank you for your support
      onkelbobby

      posted in Troubleshooting
      O
      onkelbobby
    • RE: 27" Mirror with selfmade frame

      Hi kruemel,

      good job… looks very professional.
      Since I’m using the same RCWL0516 motion sensor I have also some questions:

      • How did you mount it that it is working through the glass?
        I tried id with my Mirropane Chrome Spy 4mm but there was no detection trough the glass at all.
      • Maybe you can share some pictures especially of the motion sensor?

      Thanks, onkelbobby

      posted in Show your Mirror
      O
      onkelbobby
    • RE: MMM-PublicTransportHafas – Public transport information for all stations known to Deutsche Bahn

      @raywo Thank’s… best support ever :-)

      posted in Transport
      O
      onkelbobby
    • RE: MMM-PublicTransportHafas – Public transport information for all stations known to Deutsche Bahn

      Hi there,
      while configuring this awsome module another question came up. is there an way to get rid of the city name being displayed behind the final destination of e.g. the bus? In my configuration I want to remove “München”.
      0_1519375568336_directions.jpg

      Thanks in advance…

      posted in Transport
      O
      onkelbobby
    • RE: MMM-PublicTransportHafas – Public transport information for all stations known to Deutsche Bahn

      @raywo said in MMM-PublicTransportHafas – Public transport information for all stations known to Deutsche Bahn:

      .str11:before {
      content: "Tram ";
      }

      works perfectly…
      thank you for the prompt support :-)

      posted in Transport
      O
      onkelbobby
    • RE: MMM-PublicTransportHafas – Public transport information for all stations known to Deutsche Bahn

      Thanks also from my side… this is exact the module I was looking for. Is there a way to change the “STR” into “Tram”? Thanks for your help.

      posted in Transport
      O
      onkelbobby
    • 1
    • 2
    • 3
    • 3 / 3