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-iFrame-Ping

    Scheduled Pinned Locked Moved Utilities
    58 Posts 12 Posters 38.1k Views 13 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.
    • A Offline
      AgP42 Project Sponsor Module Developer @rudibarani
      last edited by

      @rudibarani
      Yes it seams possible to do, but then MMM-Remote-Control has also to be modified to be able to send such notification, no ?
      Could you let me know the other modules you uses than catch MMM-Remote-Control notification, so I will look the source code please ?

      Thanks,
      AgP

      1 Reply Last reply Reply Quote 0
      • A Offline
        AgP42 Project Sponsor Module Developer @rudibarani
        last edited by AgP42

        @rudibarani
        Hello,
        I guess I managed what you asked, could you please test it before I release it ?
        This new version is here : https://github.com/AgP42/MMM-iFrame-Ping/tree/dev
        Only the file MMM-iFrame-Ping.js has been modified, so you can copy/paste it on your MM directly and restart your MM.

        Then to allow URL modification through Remote-Control you can use the following request :

        http://192.168.xx.xx:8080/remote?action=NOTIFICATION&notification=iFrame_Ping_URL&payload={%22url%22:%22https://magicmirror.builders/%22}
        

        or

        http://192.168.xx.xx:8080/remote?action=NOTIFICATION&notification=iFrame_Ping_URL&payload={%22url%22:%22https://www.youtube.com/embed/Qwc2Eq6YXTQ?autoplay=1%22}
        

        (edit : the forum text editor seams not to like my link : this strange symbol “&not” has to be remplaced by “& not” (without the space…))
        (edit2 : the “%22” is the URL-encoded form of the symbol ". You can also try directly with ", and if it is not working try with %22 instead)

        It’s a cool new functionality ! :smiling_face:

        rudibaraniR 1 Reply Last reply Reply Quote 1
        • rudibaraniR Offline
          rudibarani Project Sponsor
          last edited by

          Dear AgP42,

          thank you so much for considering this and spending the time to make it happen. I am traveling at the moment but am looking forward to testing it when I get back home.

          Have a nice weekend!

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            AgP42 Project Sponsor Module Developer @rudibarani
            last edited by

            @rudibarani
            Thanks and you are welcome, it’s a pleasure to see that my work is useful and appreciated :-)

            I did a little bit more debugging and I also to try to change the URL through a rotating button or through the scheduler and I found some issues on the code I sent you for testing.
            Next week I am also traveling but as soon it look like acceptable I will send the new version.

            This functionality to be able to change dynamically the URL will really make this module much more interesting than the actual version !
            Every module will be able to send a notification to change the url, so many many new possibilities ! :relieved_face:

            1 Reply Last reply Reply Quote 0
            • H Offline
              Horge @AgP42
              last edited by

              @agp42 Hi AgP42, your idea to duplicate the PlugIn doesn’t work for me. I made the adjustments as described, but I only see one iFrame at a time. Sometimes the initial display shows the iFrame of the second instance in the first instance. After a few seconds the content is displayed correctly for the second instance. The first instance remains empty.
              If I have understood and researched this correctly so far, there are problems to differentiate between the two instances when displaying the ‘Payload’.
              Do I have to make further changes to the second instance?

              1 Reply Last reply Reply Quote 0
              • B Offline
                bolish
                last edited by

                @AgP42
                Hi, Thanks for the work, good module.
                Would it be possible to update the module by adding notification mgt to move to next url, .ie :

                • upon “IFRAMEPING_NEXT_URL” : display the next url of the list
                • Same with previous
                • Add Start / Pause option through notification also.

                I’m using MMM-GroveGestures and would like to be able to switch from URL1 to URL2 with gestures.

                Regards

                A 1 Reply Last reply Reply Quote 0
                • rudibaraniR Offline
                  rudibarani Project Sponsor @AgP42
                  last edited by rudibarani

                  Dear @agp42,
                  I am finally getting back at my mirror and get some time to incorporate your updated module. Thanks again for making dynamic URLs possible!

                  Would you mind changing this.urlToDisplay = payload.url; to this.urlToDisplay = payload; in your code? Thus, one could send a plain url as payload without the need to process it to be in the format{"url":"http://..."}.
                  This would make things easier and as the payload will only contain a URL if the notification is iFrame_Ping_URL, this should not cause any problems with other possible content.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    AgP42 Project Sponsor Module Developer
                    last edited by

                    @rudibarani
                    Hello rudibarani,

                    in fact it was my first try (as it is easier…) but I couldn’t succed to make it work and adding this “url”: is the only way I have found to make it work…
                    Did you try to change the code and it was ok ?

                    I do my best to find some hours this week end to finally debug my code and be able to release that new version !

                    On the next version it will be possible to send a new url through http request, but also with the module scheduler or with a rotating button

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      AgP42 Project Sponsor Module Developer @bolish
                      last edited by

                      @bolish
                      Hello Bolish,

                      thanks and happy to see that my module is useful,

                      I didn’t know the module MMM-GroveGestures so far but I check its documentation and it will be possible on the next version of the iFrame-Ping module to change the URL through the following code :

                      notificationExec: {
                        notification: "iFrame_Ping_URL",
                        payload: {
                           url: "http:whaturlyoulike.com"
                        }
                      }
                      

                      But it will not be a list of URL to switch between each other, just one url linked to a movement.

                      I will investigate a bit more this week end…

                      1 Reply Last reply Reply Quote 0
                      • B Offline
                        bolish
                        last edited by

                        Hi @AgP42 , @rudibarani

                        The modification you will implement for @rudibarani 's need will help me in one sense.
                        Indeed, MMM-GroveGestures is able to send wathever notification we want.
                        So, based on gestures, I will be able to send different URL’s.

                        It’s nevertheless, not covering fully my need as I was hoping for something incremental.
                        MMM-iFrame to manage the list of URL’s and able to move to next URL based on “URL NEXT” notification reception.

                        Maybe a combined proposal (that would make sense to me) would be :

                        • Centralize URL management into MMM-iFrame with :
                          - URL 1 : htpps…
                          - URL 2 : hfkzejrhfzoer

                        This would allow :

                        • any other modules to call for URL 1 or 2 and maybe suiting to @rudibarani
                        • would to avoid people to manage the list of URL into several modules (keep it into MMM-iFrame)
                        • enable the possibility to manage incremental notification mgt (my intial request : “NEXT URL” by managing a kind of counter into mmm-iFrame (to move from URL X to URL X+1 or URLX-1)

                        I hope it’s clear.

                        And I also don’t want to mess up with @rudibarani 's need which was expressed before…

                        So if my proposal (which seems more generic to me, so potentially opening larger possibilities in future for this module), suits to @rudibarani , fine.

                        But if my proposal is not suiting to @rudibarani 's need, go for him first maybe, I will try to adapt myself later.

                        Hope you will have time to dig in soon!

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 1 / 6
                        • 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