• 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.

Displaying Metrics from an Excel Sheet

Scheduled Pinned Locked Moved Unsolved Requests
6 Posts 7 Posters 3.3k Views 6 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.
  • R Offline
    rummyr
    last edited by Dec 20, 2018, 7:45 PM

    I guess the bottom line is the question “can nodejs access the data?”

    A quick search turned up more than one npm module for reading xls files.

    Not sure pulling from an Excel sheet is particularly sensible, probably more sensible to push from Excel on change to a more accessible source.

    R 1 Reply Last reply Dec 20, 2018, 9:18 PM Reply Quote 1
    • R Offline
      robiv8 @rummyr
      last edited by Dec 20, 2018, 9:18 PM

      @rummyr said in Displaying Metrics from an Excel Sheet:

      I guess the bottom line is the question “can nodejs access the data?”

      A quick search turned up more than one npm module for reading xls files.

      Not sure pulling from an Excel sheet is particularly sensible, probably more sensible to push from Excel on change to a more accessible source.

      My English is not very good!
      Can you explain that further? That would interest me too.

      B 1 Reply Last reply Dec 22, 2018, 1:56 PM Reply Quote 0
      • S Offline
        shbatm Module Developer
        last edited by Dec 22, 2018, 2:30 AM

        You can use a Node.js module like this one: https://www.npmjs.com/package/excel-as-json to save the data in a convenient format (JSON) and then use a MM module like https://github.com/timdows/MMM-JsonTable to display it.

        1 Reply Last reply Reply Quote 1
        • B Offline
          bhepler Module Developer @robiv8
          last edited by Dec 22, 2018, 1:56 PM

          @robiv8 - Data in an excel spreadsheet is useful for calculating values and displaying them. The difficulty in using a Magic Mirror to display such values is that you now have to transfer the excel file to the Magic Mirror so it can be read by the module. (You can get around this by making the file available over the network and telling the mirror to look at a specific network path).

          You also have to write some sort of interpretation to pull the data out of Excel and display it on the screen. If you just wish to display a spreadsheet, this isn’t too difficult. Things get complicated when you want to extract only certain parts of that spreadsheet (such as computed totals). Excel doesn’t store total values in the cells, it stores formulas. Just displaying the contents on the mirror results in values that look like =$AE+SUM(B3..B14)

          The preferred way of doing these things is to make the computed data available via a web API and then use the Magic Mirror to query the API and display the values. That module has already been written.

          1 Reply Last reply Reply Quote 1
          • B Offline
            bhepler Module Developer @bminer1
            last edited by Dec 22, 2018, 2:10 PM

            @bminer1 - I’m glad your FiL likes your mirror! To answer his question, the answer is generally “Any location with a web API is easy. Most other data sources are possible *.”

            I’ve been developing systems for more years than I care to admit. I would guess that he has an employee/coworker who maintains a spreadsheet with metrics for his various processes. Spreadsheets are simple and easy to use, so they end up doing a lot of lifting in any business. The spreadsheet probably performs both data storage and calculation roles and they’ve probably been using it for years.

            I wonder… there’s got to be a simple tool out there that will use a spreadsheet as a data source and expose an API to query the spreadsheet. You could then use the existing modules (MMM-Rest, for example) to query that API.

            *Sometimes I am too much of a literalist. There are certain sources of data that are too large for the Pi to handle with its limited memory and processor. You will not be able to display a ray tracing rendering process, for example, as there is too much data for the Pi to keep up.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              6/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