• 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-pages & mmm-remote-control

Scheduled Pinned Locked Moved Unsolved Troubleshooting
12 Posts 4 Posters 3.1k Views 4 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.
  • W Offline
    waki
    last edited by Oct 17, 2019, 9:12 PM

    Hey guys,

    I want to use the restful-api of the mmm-remote control package to switch to a specific page. To achive this, I tried to send a notification with the command “http://192.168.0.62:8080/api/notification/PAGE_CHANGED?payload=1” but it is not working. Can you help me?

    Thanks a lot!

    S A 2 Replies Last reply Oct 17, 2019, 9:32 PM Reply Quote 0
    • S Away
      sdetweil @waki
      last edited by Oct 17, 2019, 9:32 PM

      @waki see this post of mine… the api was changed but not documented

      https://forum.magicmirror.builders/topic/9941/mmm-remote-control-cannot-get-api/7

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • W Offline
        waki
        last edited by Oct 17, 2019, 9:41 PM

        Thank you for the link, but the command is working, if I use the notification “PAGE_DECREMENT” without an aditional parameter. But I´m not sure how to pass the page as paramter, so the mmm-remote-control is executing “this.sendNotification(“PAGE_CHANGED”, 1)”.

        S 1 Reply Last reply Oct 17, 2019, 9:44 PM Reply Quote 0
        • S Away
          sdetweil @waki
          last edited by Oct 17, 2019, 9:44 PM

          @waki

          from the mmm-pages doc
          https://github.com/edward-shen/MMM-pages

          also do note that to switch to page 1, you need to send 0 to the module
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • W Offline
            waki
            last edited by Oct 17, 2019, 9:57 PM

            I understand this. The question is how to pass the page:
            Like one of these??

            • http://192.168.0.62:8080/api/notification/PAGE_CHANGED?page=1
            • http://192.168.0.62:8080/api/notification/PAGE_CHANGED?1
            • http://192.168.0.62:8080/api/notification/PAGE_CHANGED?payload=1

            or how ?

            S 1 Reply Last reply Oct 17, 2019, 9:58 PM Reply Quote 0
            • S Away
              sdetweil @waki
              last edited by sdetweil Oct 17, 2019, 9:59 PM Oct 17, 2019, 9:58 PM

              @waki said in MMM-pages & mmm-remote-control:

              http://192.168.0.62:8080/api/notification/PAGE_CHANGED?page=1

              no
              to go directly to page 1

              http://192.168.0.62:8080/api/notification/PAGE_CHANGED?payload=0
              

              the direct page numbers are 0 based…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote -1
              • W Offline
                waki
                last edited by waki Oct 17, 2019, 10:02 PM Oct 17, 2019, 10:01 PM

                I know the page numbers start with 0. But if I use the commands in the list, no matter what page index I pass, I only get a black page. So I think the formal way, of how I pass the paramter is wrong. And your command also doesnt work

                S 1 Reply Last reply Oct 17, 2019, 10:03 PM Reply Quote 0
                • S Away
                  sdetweil @waki
                  last edited by Oct 17, 2019, 10:03 PM

                  @waki open the developers window, ctrl-shift-i and select the tab labeled console, set the filter to control
                  and then send a message and see what the error is…

                  or look at the mmm-remote-control code

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • W Offline
                    waki
                    last edited by Oct 17, 2019, 10:42 PM

                    I tried this, there is no error. The notification gets recieved by the mmm-pages modules, but it reports:
                    [Pages]: received a notification to change to page [object Object] of type object

                    From the API I get the answer:
                    {“success”:true,“notification”:“PAGE_CHANGED”,“payload”:{“payload”:“1”}}

                    But I only get a black page. And I looked inside the code, but my js knowledge is too bad to understand what is happening there.

                    S 1 Reply Last reply Oct 17, 2019, 11:11 PM Reply Quote 0
                    • S Away
                      sdetweil @waki
                      last edited by Oct 17, 2019, 11:11 PM

                      @waki try this

                      “payload”:{“page”:“0”}

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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