Read the statement by Michael Teeuw here.
MMM-iFrame-Ping
-
@agp42 Ok, thanks for the tip, I’ll checkup the README file.
-
@johans Hello, in fact I already try to manage this functionality (on another plugin), but it’s very hard to make it work.
Here is an easy way for you :- duplicate the plugin (copy/paste the full folder and rename it, for example “MMM-iFrame-Ping-2”)
- enter the folder and rename the file “MMM-iFrame-Ping.js” into “MMM-iFrame-Ping-2.js” (no need to change the css file, you can also delete it)
- open the file “MMM-iFrame-Ping-2.js” and and the very first line, also change :
Module.register("MMM-iFrame-Ping",{
to
Module.register("MMM-iFrame-Ping-2",{
- then you can declare this “new” module on your config file and use it with another URL
(Yes this is a very very bad looking solution :grimacing_face: , please don’t tell anyone it comes from me !:winking_face: )
-
Dear @agp42,
unfortunately, a playlist does not help for my use case:
I found a 90 min 4K Video Collection from the ISS and want use a defined / selected / random 35 minute section to fill in for the time when the ISS is in the dark.
Currently, I am circumventing it by having multiple copies of the “Night”-page with MMM-Page-Selector and defining different instances of MMM-iFrame-Ping for each page. Each of these instances get a defined URL and I call the pages via notifications, depending on the daylight-status of the ISS.
Having a little more flexibility in the module would make this a lot easier and more dynamic.Maybe it could be possible to pass on an URL via a notification?
-
@rudibarani
Hello,
to better understand your request, by “notification” do you mean the internal MM notification mecanism ? (describe here on the official doc)
In that case, which module will send the url request to the MMM-iFrame-Ping module ? and what will be the notification request format ?Thanks,
AgP42 -
@AgP42 Thanks for your reply and happy new year!
I using MMM-Remote-Control to inject notifications from my home automation system (FHEM), as it knows all the other relevant states in the house (user-presence, lighting situation, etc.).Maybe your module could listen to
"iFrame_Ping_URL"
notifications and take the"URL"
from the payload and use it until a new one is provided or until a restart, in which case it would revert back to the standard URL from the setup?This way, it would not change its behavior presented to its current users and just gain an option to change the preconfigured URL on the fly.
-
@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 -
@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¬ification=iFrame_Ping_URL&payload={%22url%22:%22https://magicmirror.builders/%22}
or
http://192.168.xx.xx:8080/remote?action=NOTIFICATION¬ification=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 “¬” 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:
-
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!
-
@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: -
@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?