• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Tutorials or Overview for Module Dev?

Scheduled Pinned Locked Moved Development
6 Posts 4 Posters 4.7k Views 5 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.
  • N Offline
    nbrenn
    last edited by Oct 7, 2016, 12:52 AM

    I am looking to develop a module for my Mirror, for an Energy Monitor (SiteSage E-Monitor), and I have found the API specification that provides all of the information regarding the methods for the API.

    I was wondering if there exists a general overview of how to take the API methods that are outlined in the company’s specification, and turn it into a Module.

    From my high-level understanding, here is what I need to develop:

    • E-MonitorConfig.js
    • E-MonitorStyling.css --> which takes the data from the API call and turns it into the visualization for the magic mirror.

    Is there any general documentation or any high-level guidelines that I may be missing as I embark on this journey?

    N 1 Reply Last reply Oct 7, 2016, 3:10 AM Reply Quote 0
    • N Offline
      nigel-daniels @nbrenn
      last edited by Oct 7, 2016, 3:10 AM

      @nbrenn I found it really useful to find a module someone had already written and look at that as an example. I’ve now written a few simple modules that just pull data from web service and display it on screen. Feel free to fork any of them and pull them apart for ideas, the one I just submitted (MMM-AirNow) is pretty basic.

      1 Reply Last reply Reply Quote 3
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer
        last edited by Oct 7, 2016, 8:15 AM

        here is the documentation https://github.com/MichMich/MagicMirror/tree/master/modules

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 1
        • Y Offline
          yawns Moderator
          last edited by Oct 7, 2016, 10:30 AM

          I’d like to jump in as well.
          How do you decide if a node_helper is required or if the module itself is sufficient? Is there any benefit or downside if you choose one way or the other?

          S 1 Reply Last reply Oct 7, 2016, 10:56 AM Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @yawns
            last edited by Oct 7, 2016, 10:56 AM

            @yawns I create only a node_helper if I need to use a npm dependency

            Please create a github issue if you need help, so I can keep track

            1 Reply Last reply Reply Quote 2
            • N Offline
              nbrenn
              last edited by nbrenn Oct 7, 2016, 3:00 PM Oct 7, 2016, 3:00 PM

              Thanks for the responses, guys.

              The E-Monitor API specification has a listing of the supported API methods (page 3), like authenticate, deauthenticate, getCurrentData and so on.

              Aside from Module.register, getStyles, start: function(), and getDom, are these methods listed in the API specification the ones that I will use as functions in my code? For example:

              Module.resgister ("MMM-Emonitor.js", {
              },
              
              getStyles: function() {
              },
              
              start: function() {
              },
              
              getDom: function() {
              },
              
               // And then the EMonitor methods below:
              authenticate: function() { 
              }
              
              deauthenticate: function() {
              }
              
              getCurrentData: function() {
              }
              
              //... and so on down the list of the supported API methods
              
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                4/6
                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