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

    Posts

    Recent Best Controversial
    • Consolidate logging to browser console

      I wanted to share a simple approach to unify logging across module components that I found incredibly useful during development. This will put all* logging in a browser console and remove the need to monitor pm2/pi console logs.

      In your main module code (MMM-ABC.js), where you define your sockets simply add:

      if (notification === 'HELPER_MESSAGE') {
           if (this.config.debug === 1) { Log.info(payload); }
      //Receive a message, log the payload to the browser console. 
      }
      
      

      In your node_helper.js module, construct and send messages:

      if (self.config.debug === 1) {
               apiMessage = moment().format('YYYY-MM-DD>>HH:mm:ss.SSSZZ') + ' [node_helper] << your log message content here >>';
               self.sendSocketNotification('HELPER_MESSAGE', apiMessage);
      }
      

      Hope this helps on your development journey!

      *any code errors / exceptions will still throw to the raspberry pi console / pm2

      posted in Tutorials
      P
      Privacywonk
    • MMM-Surf

      Description

      MMM-Surf module displays weather, tides, water temp, and Magicseaweed forecast data for your favorite surf spot. It is currently North America centric, pulling tide and water temperature from the National Oceanic and Atmospheric Administration (NOAA).

      Screenshot

      Bild Text

      20178-01-07:

      • Added color coded icons to swell height, periodicity, swell/wind direction that are based on configurable settings based on spot characteristics
      • Added “gear” guide (wetsuit mm based on water temp)
      • Fixed 12 hour view to cross date boundary
      • Developed algo to find “best” daily forecast time and display that in daily forecast row

      2017-12-09:

      • Updated layout
      • Cleaned up code
      • Added logic to match Spot Characteristics (e.g. best swell / wind). If a match, the swell/wind icons pop green
      • Added swell/wind direction text next to arrow to make it easier to understand

      Download

      [card:Privacywonk/MMM-Surf]


      Version history

      • v1.0.0 - first tagged release 2018-01-07
      posted in Sport
      P
      Privacywonk
    • RE: Question to Log.info in js file

      Log.Info will print to the Browser Console.

      In Firefox or Chrome hit: Ctrl+Shift+I and then click the “console button”

      posted in Development
      P
      Privacywonk
    • RE: UI/Data Caching

      @E3V3A that worked perfectly. Thank you for sharing!

      posted in Troubleshooting
      P
      Privacywonk
    • RE: Additional sports modules

      https://www.scorespro.com/livescore-xml/ - looks like the best bet for following Six Nations coverage via API.

      If I have time prior to the tourny starting, I may try to put something together but please don’t wait on me if you want to start developing.

      posted in Requests
      P
      Privacywonk
    • 1 / 1