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.

    Switch Months - MMM-CalendarExt3 -

    Scheduled Pinned Locked Moved Solved Troubleshooting
    8 Posts 2 Posters 35 Views 2 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.
    • G Offline
      Getinthegames
      last edited by Getinthegames

      I’ve made quite a progress to code my MagicMirror the way I want it to work, but I’m hitting a wall right now and need help.

      I’m trying to make a simple navigation for MMM-CalendarExt3 where PageUp and PageDown would switch to next and previous months.

      I use those buttons because I’ll be using a usb clicker that has those 2 buttons.

      I have no issues with the clicker itself, it works on the Raspberry Pi and show the proper input on websites like key-event-viewer.

      So far I’v tried with MMM-KeyBindings, but the only notification MM is recievinge is MMM-KeyBinding sent “KEY PRESS” no matter the button I press, even on a regular keyboard (not all button works thought, mostly arrows, enter, space etc… but not PageUp and PageDown).

      I can enable evdev to listen to my clicker and in the terminal, when magic mirror is running with KeyBindings, I can see “KEY_104 pressed” and "KEY_109 pressed " when I use the clicker on path /dev/input/event0

      But in my code, no matter what I put, it only sends MMM-KeyBindings sent “KEY PRESS”
      Here is what my code would look like
      {
      module: “MMM-KeyBindings”,
      config: {
      enableKeyboard: true,
      evdev: {
      enabled: true,
      eventPath: “/dev/input/event0”
      },
      keyBindings: [
      { key: “KEY_104”, notification: “CALENDAR_NEXT” },
      { key: “KEY_109”, notification: “CALENDAR_PREV” }
      ]
      }
      },
      (I tried with “PageUp” and “KEY_PAGEUP”. That last one is what I get with evtest on input 0)

      After 2 days, I decided to check a new avenue with MMM-Remote-Control.

      I managed to get further (kind of) and managed to get the right notification sent to the calendar throught curl commands and the API. Not sure yet how to make the clicker input commands throught, but the issue here lies in the actual notifications right now.

      I wanted to use CX3_MOVE_CALENDAR, but it did not do anything. It is deprecated and not working at all, but the deprecated CX3_SET_DATE does work, but it’ll be kind of hard to use it as it goes to a specific date.

      Tried with CX3_SET_CONFIG but this also seems to not change the month, no matther what monthIndex I send with it.

      I’m quite confused right now on the best approach. As of reference, my MM currently look like this and it’s the calandar on the left I’d like to be able to flip from month to month.

      dfcf719e-21df-4dc1-8c00-f817d66c3362-image.png

      S 1 Reply Last reply Reply Quote 1
      • S Do not disturb
        sdetweil @Getinthegames
        last edited by

        @Getinthegames did you do this part of the setup

        If you are not using a Fire Stick Remote: You may need to adjust the key assignments above to match your remote. See Remote Setup for how to run evtest and display the key names for your remote/device.
        

        I think you need this section of the keybindings config

        actions: [
          {
            key: "Home",
            state: "KEY_LONGPRESSED",
            instance: "SERVER",
            mode: "DEFAULT",
            notification: "REMOTE_ACTION",
            payload: { action: "MONITORTOGGLE" }
          },
          {
            key: "ArrowLeft",
            state: "KEY_LONGPRESSED",
            notification: "CAROUSEL_PREVIOUS"
          },
          {
            key: "ArrowRight",
            state: "KEY_LONGPRESSED",
            notification: "CAROUSEL_NEXT"
          },
          {
            key: "Return",
            state: "KEY_LONGPRESSED",
            changeMode: "DEFAULT"
          }
        ],
        

        I think KeyMap only changes the name

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        G 1 Reply Last reply Reply Quote 1
        • S Do not disturb
          sdetweil @Getinthegames
          last edited by sdetweil

          @Getinthegames I would use mmm-pages and put the two months on different pages. (Two instances of Ext3)
          And use the page next/back notifications to pages. You can disable the timed page rotation

          I have three instances w different months (monthIndex=0/1/2)

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          G 1 Reply Last reply Reply Quote 0
          • G Offline
            Getinthegames @sdetweil
            last edited by

            @sdetweil Good idea. I guess I can do X pages, all with an incremental monthIndex for the next few months.
            I’ll see if that reponds well.

            I guess KeyBindings is out of question for that as it does not fix the issue. I will try programming something to translate my clicker input in actual Remote-Control command thru their API.

            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @Getinthegames
              last edited by

              @Getinthegames you could still use key binding to send the pages notifications

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              G 1 Reply Last reply Reply Quote 0
              • G Offline
                Getinthegames @sdetweil
                last edited by

                @sdetweil My issue with KeyBindings is no matter what I program… clicker or regular keyboard is that it does not seem to register the key and trigger the desired notification.

                Notification Viewer only show “KEYPRESS” on the MagicMirror while looking at the terminal it does show KeyBindings capturing KEY_104 and KEY_109 from the clicker, but nothing from an actual keyboard.

                S 1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil @Getinthegames
                  last edited by

                  @Getinthegames did you do this part of the setup

                  If you are not using a Fire Stick Remote: You may need to adjust the key assignments above to match your remote. See Remote Setup for how to run evtest and display the key names for your remote/device.
                  

                  I think you need this section of the keybindings config

                  actions: [
                    {
                      key: "Home",
                      state: "KEY_LONGPRESSED",
                      instance: "SERVER",
                      mode: "DEFAULT",
                      notification: "REMOTE_ACTION",
                      payload: { action: "MONITORTOGGLE" }
                    },
                    {
                      key: "ArrowLeft",
                      state: "KEY_LONGPRESSED",
                      notification: "CAROUSEL_PREVIOUS"
                    },
                    {
                      key: "ArrowRight",
                      state: "KEY_LONGPRESSED",
                      notification: "CAROUSEL_NEXT"
                    },
                    {
                      key: "Return",
                      state: "KEY_LONGPRESSED",
                      changeMode: "DEFAULT"
                    }
                  ],
                  

                  I think KeyMap only changes the name

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  G 1 Reply Last reply Reply Quote 1
                  • G Getinthegames has marked this topic as solved
                  • G Offline
                    Getinthegames @sdetweil
                    last edited by

                    @sdetweil I can’t believe I overlooked that detail.

                    Thanks it works now. 🤯

                    S 1 Reply Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @Getinthegames
                      last edited by

                      @Getinthegames awesome!!! thanks for the feedback

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • 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