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

    Posts

    Recent Best Controversial
    • RE: How to receive push notifications from another server?

      I did some experiments but no success yet. Maybe you could clarify some things:

      • What do you mean by ‘module specific channel’? How does that work?
      • I tried to emit an event via a java application, but I don’t know which parameters to use so that the event is passed to my module?
      • Where is the code that processes incoming socket events?

      I tried socket.io-java-client, but nothing happens on the server (log remains empty, module does not return anything):

      public static void main(String[] args) throws Exception {
      	Socket socket = IO.socket("http://raspi:8080"); // I also tried: http://raspi:8080/socket-test-module
      	socket.connect();
      	socket.emit("notification", "ping");
      	socket.close();
      }
      

      Any ideas how to get a simple external socket client running?

      posted in Development
      paphkoP
      paphko
    • RE: How to receive push notifications from another server?

      Thanks for the really quick answer! :-)
      Do you have any hint in which files I could start digging?

      posted in Development
      paphkoP
      paphko
    • How to receive push notifications from another server?

      I would like to receive notifications from another server in my module. To be more precise, I have a running openhab server and I would like to display the state of lights and window contacts on my mirror. Up to now, I am using the first version of the mirror:

      magic mirror with floor plan and window contacts

      Currently, I use the openhab REST API to pull the states every 10 seconds, but this produces a lot of requests on the openhab server and an update delay of up to 10 seconds. Instead, I would like the openhab server to tell my mirror each state change. On the openhab side, I can easily add some arbitrary java code, for example to perform some http requests or to open and communicate via a socket connection to a specific IP.

      But how to implement a listener in a MM module? I don’t have much experience with electron and the new MM application infrastructure yet. How can I configure my module to receive notifications from another server? Is there maybe some module that does something similar?

      posted in Development
      paphkoP
      paphko
    • RE: MMM-WeatherChart

      @gshimself glad to hear that it’s fixed for you. Yes, because update interval must be specified in ms.

      @amanzimdwini you could try to add a scale option, but I’m not sure how to properly implement it for both cases, with and without border. If you found a proper solution for it, tell me or create a pull request :-)

      posted in Utilities
      paphkoP
      paphko
    • RE: MMM-WeatherChart

      The module appends ‘#’ to the image so that the browser does not cache the image. This works on my old version of the mirror but not on the new version 2. Quite strange…

      Fixed by replacing this part with ‘?’, at least for Chrome browser, the image is not cached any longer. @gshimself please pull changes and report wether it is also fixed for you.

      posted in Utilities
      paphkoP
      paphko
    • RE: MMM-WeatherChart

      @gshimself I added a dummy parameter (timestamp) to the image which should prevent caching. I’ll check that later today when I find some time.

      posted in Utilities
      paphkoP
      paphko
    • MMM-WeatherChart

      I created a module that lists a nice weather chart from www.yr.no, optionally with or without border: mmm-weatherchart

      0_1471381678951_weatherchart1.png
      0_1471381717178_weatherchart2.png

      posted in Utilities
      paphkoP
      paphko
    • 1
    • 2
    • 3
    • 3 / 3