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

    Posts

    Recent Best Controversial
    • RE: MMM-iFrame-Ping

      @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

      posted in Utilities
      A
      AgP42
    • RE: MMM-iFrame-Ping

      @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: )

      posted in Utilities
      A
      AgP42
    • RE: MMM-iFrame-Ping

      @rudibarani Sorry for my late answer. Did you consider to create a youtube playlist and make it run on the Mirror ? (This way of doing is now describe on the readme file) I guest it will fulfill your need !

      posted in Utilities
      A
      AgP42
    • RE: MMM-iFrame-Ping

      @rudibarani said in MMM-iFrame-Ping:

      @AgP42 Thank you for this version of iFrame. Works well for me :)
      I do get a white line around the embedded iFrame. Could you please tell me, how to get rid of it?

      Hello,

      you can try the following :

      On the file “MMM-iFrame-Ping.js”, on lines 135, 136 and 137 there is :

      iframe.width = this.config.width;
      iframe.height = this.config.height;
      iframe.scrolling = this.config.scrolling;
      

      with those lines, please add :

      iframe.style = "border:0"
      

      This should solve your problem !

      Bye,
      AgP42

      posted in Utilities
      A
      AgP42
    • [MMM-Netatmo-Presence] - Display liveview and events for Netatmo cameras

      Hello,

      I just finished my module to display the live view and last events of Netatmo Presence Cameras.
      Some part of this module (Live view) may also work for Netatmo Welcome Cameras.

      Please test it and let me know if any issues or improvment idea ! :slightly_smiling_face:

      Description:

      Main functionnalities :

      • Display Live snapshot of one or several cameras - This behavior should work also for “Netatmo Welcome” cameras, but not tested
      • Display the events recorded by all the cameras as timeline, with the type of event (animal, human, vehicle or movement). It is possible to filter the event type and to choose the number of events to be displayed. This will for sure not work for Welcome cameras.
      • Use the official sample code from Netatmo to connect to the API, so with https and no complex token to catch !
      • Several instances possible (one to display live snapshot, another to display events of type “vehicle”, another with all last 5 events, …)
      • Network data and RPI load friendly :
        • The API token is requested only when expired or once at start-up (also for several instances)
        • If a PIR-sensor using MMM-PIR-Sensor module is used, the auto-update will stop during screen off (this behavior works also with all other module that send the notification “USER_PRESENCE”).
        • If all instances of MMM-Netatmo-Presence module are hidden (by REMOTE-CONTROL or any Carousel module for example), the auto-update will also stop.
          As soon as a MMM-Netatmo-Presence module will be again displayed on the screen or screen switch on, an update will be requested.
      • Possibility to display the date and time of the last update request (configurable)
      • CSS file and many display configuration possibilities

      Screenshots:

      3 instances running, 2 to display live snapshot and 1 with Event timeline :
      0_1533157971593_3 instances.png
      Event timeline with the last event on both full image and detail of the movement detected :
      0_1533157993806_Events color icon.png
      2 liveview on the same instance :
      0_1533158012694_2 lives in 1 instance.png

      Download:

      [card:AgP42/MMM-Netatmo-Presence]


      Version 0.0.1

      • First release - 01/08/2018
      posted in Utilities
      A
      AgP42
    • RE: Solved - Several module instances with one node_helper

      Hi,

      I answer to myself as I could find the origin of the problem and correct it, maybe it could help others (as I didn’t see that implemented on many other module :winking_face: )

      So the problem is documented on the developper doc here :

      On socketNotificationReceived: function(notification, payload) part :

      Note 1: When a node helper sends a notification, all modules of that module type receive the same notifications.

      On this.sendSocketNotification(notification, payload) :

      Note: Since all instances of your module will receive the notifications, it’s your task to make sure the right module responds to your messages.

      So it is normal that each instance receive all the SocketNotification even send from another instance.

      To manage this, I add on start function :

      this.config.instanceID = this.identifier;
      

      As all my socket notification send to the note_helper “self.config”, so the node_helper will know the source of the request and will be able to send it back on its answer.
      Then on the node_helper sendSocketNotification, I send back this identifier with the corresponding answer.

      And on the MMM_main.js, on the socketNotificationReceived, I start to check is the identifier correspond to this instance and if not :

      return;
      

      Unfortunatelly this was even not enough, in particular at start-up, when all instances want to receive their datas and request all the node_helper together with differents inputs, some mix up occurs, so I also had to implement a “initialDelay” timer (with setTimeout function) and I will ask the user to configure it correctly if he configure several instances.

      So complicated solution (I feel…), but working fine !

      Of course if anyone got a better one to share, please do !

      Bye,
      AgP

      posted in Development
      A
      AgP42
    • Solved - Several module instances with one node_helper

      Hello all,

      I am a newby on development, but I would be pleased to learn ! :grinning_face:

      I am developping a module for Netatmo Presence camera (but my question is generic for all modules…) and I realize that when I am running several instance of the same module that is using a node_helper file, then the request is sent as much time as we have module instances declared and not just 1 request = 1 answer.

      To be more explicit :
      My MMM-Main.js request to node_helper.js to get some JSON data from an external API. And one of my parameter is the number of “events” that I want to return.
      If I have only 1 instance of my module, this is working perfectly fine and I receive exactly what I requested.
      But if I have 2 instances with the first one that request 10 events and the second request 2, then I receive 4 times the answer : 2 times with 10 (send to each module instance) and 2 times with 2 (send to each module instance also).
      And the more instance I declare, the more it increased !

      And this behavior totally mix up my result !

      So an easy solution will be to request always the max number of “events” and accept extra network request, but I don’t like it…

      Of course I checked all my “this” and “self” to ensure not to share datas between instances, so I don’t understand…

      I checked also on some other modules avaliable, almost all of them get redundant results when several instances are running together.

      Is there any explication and solution ?

      Thank you very much in advance for any help !

      AgP

      posted in Development
      A
      AgP42
    • MMM-iFrame-Ping

      Hello,

      after struggling with existing iFrame modules, I decided to create my own…

      Here are some other iFrame module :

      • iFrame from desertblade : the original one with basics functions : one URL, no periodic refresh
      • MMM-iFrame from alberttwong : allow several rotating URL but no periodic refresh of the content
      • MMM-iFrameReload from TheBogueRat : one possible URL with periodic refresh

      The functionnalities of my new iFrame module :

      • Allow periodic refresh of the iFrame, or not (configurable), this allow to display images (with refresh) or video (without refresh)
      • Ping the URL before trying to display the content. Display an error (with the last successful PING date and time) if the host is not reachable. PING code from MMM-Ping by CFenner
      • If a PIR-sensor using MMM-PIR-Sensor module is used, the iFrame will not be updated during screen off (this behavior works also with all other module that send the notification “USER_PRESENCE”) and will be refresh with screen on.
      • If the iFrame-Ping module is hidden (by REMOTE-CONTROL or any Carousel module for example), the iFrame will not be updated. As soon as one MMM-iFrame-Ping module will be again displayed on the screen, an update will be requested.
      • Possibility to display the date and time of the last update request (configurable)
      • CSS file

      I tested it with MM² version 2.4.1.

      I hope it can also be helpful for others, please let me know any issue.

      Some screenshot :
      Display YouTube :
      0_1532871282781_MMM-iFrame-Ping_youtube_update.png

      Display camera snapshot (with updates) :
      0_1532871357269_MMM-iFrame-AgP.png

      PING Nok :
      0_1532871391253_MMM-iFrame-Ping_Nok_with update display.png

      PING Ok, iFrame upload on-going :
      0_1532871408913_MMM-iFrame-Ping_ok.png

      All infos and installation instruction :
      [card:AgP42/MMM-iFrame-Ping]

      posted in Utilities
      A
      AgP42
    • RE: MMM-Remote-Control warning in logs

      Hello,

      no infortunatelly I didn’t find any solution yet.

      Bye,

      posted in Troubleshooting
      A
      AgP42
    • RE: Withings

      Hello,

      I also try to make it work, but I didn’t succed. Probably I did some wrong behaviour during the oAuth process.

      At the end I can see on my MagicMirror logs an error 283, that correspond according to Nokia API website to : “283 : Token is invalid or doesn’t exist”.

      I considered it was OAuth version 1.0 because it look like it.

      Also it is written on Nokia website :

      “The Health Mate API is now fully functional with OAuth 2.0 authentication protocol.
      Therefore, the OAuth 1.0 process will no longer be supported beginning:
      November 30, 2018”

      Also I do not really want to fight to make it work if the service will be cut by Nokia/Withings on a few months.

      Does someone have the knowledge to update this module with OAuth 2.0 ?

      posted in Requests
      A
      AgP42
    • 1 / 1