• 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
  1. Home
  2. nbrenn
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Offline
  • Profile
  • Following 0
  • Followers 0
  • Topics 10
  • Posts 43
  • Groups 0

nbrenn

@nbrenn

2
Reputation
1.4k
Profile views
43
Posts
0
Followers
0
Following
Joined Sep 18, 2016, 11:26 PM
Last Online Apr 17, 2017, 8:57 PM

nbrenn Unfollow Follow

Best posts made by nbrenn

  • RE: Trying to write my own Module...

    For posterity, I modified the if statement as follows, to remove the row items that have a 0 for wattage:

    if (channels[i].children[n].textContent != 0) {
         element.innterHTML = channels[i].children[n].textContent;
         row.appendChild(element);
         table.appendChild(row);
    }
    else {
         table.removeChild(row);
    }
    
    posted in Development
    N
    nbrenn
    Dec 28, 2016, 4:51 PM
  • RE: Trying to write my own Module...

    I am trying to begin the next iteration of my module.

    I have the real-time energy usage, and monthly power usage being displayed in a list in the top left and right corners of my mirror.

    I am hoping to do something similar to the following:

    • Take a value from my Monthly Usage, and then display it in the center of my mirror with a sentence like, “Your monthly power usage is: XXX Watts”.

    Since this monthly energy usage module is in the top right of my mirror, how would I extract a value or variable from that module and then display it into the center of the mirror.

    So basically, I have a long list of power usages being displayed on my mirror, but I would like to display a sentence or two about that data on another part of my mirror - extracting a value from the module and displaying it in the center of the mirror. Can this be done using the same .js code in the module, and just modifying the .css?

    posted in Development
    N
    nbrenn
    Feb 9, 2017, 2:01 AM

Latest posts made by nbrenn

  • RE: Trying to write my own Module...

    I am trying to begin the next iteration of my module.

    I have the real-time energy usage, and monthly power usage being displayed in a list in the top left and right corners of my mirror.

    I am hoping to do something similar to the following:

    • Take a value from my Monthly Usage, and then display it in the center of my mirror with a sentence like, “Your monthly power usage is: XXX Watts”.

    Since this monthly energy usage module is in the top right of my mirror, how would I extract a value or variable from that module and then display it into the center of the mirror.

    So basically, I have a long list of power usages being displayed on my mirror, but I would like to display a sentence or two about that data on another part of my mirror - extracting a value from the module and displaying it in the center of the mirror. Can this be done using the same .js code in the module, and just modifying the .css?

    posted in Development
    N
    nbrenn
    Feb 9, 2017, 2:01 AM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @cowboysdude @strawberry-3-141

    I’m having trouble getting my icon to load. My getDom looks like the following:

    getDom: function() {
    		var wrapper = document.createElement("div");
    
    		if (!this.loaded) {
    			wrapper.innerHTML = this.translate("Loading...");
    			wrapper.className = "dimmed light small";
    			return wrapper;
    		}
    		wrapper.className = "datafeed";		
    		var myLogo = document.createElement("span");
    			var myIcon = document.createElement("img");
    			myLogo.classList.add("myLogo");		
    			myIcon.src = this.file("my_logo.png");
    			myLogo.appendChild(myIcon);
    		wrapper.appendChild(myLogo);
    		
    		wrapper.innerHTML = "Today, your sum is " + this.sum ;
    		return wrapper;
    	},
    
    posted in Development
    N
    nbrenn
    Feb 4, 2017, 9:22 PM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @cowboysdude Thanks for the example!

    Is there a specific styling that needs to be used for the images? For example, I would need the image to have the typical white/greyish hue to it.

    posted in Development
    N
    nbrenn
    Feb 4, 2017, 2:56 PM
  • RE: How to load a <script> src = " " </script> into my mirror?

    Does anyone know of the best documentation for adding an image/graphic into a mirror module?

    For my example here, Mirror Datafeed and Sum Module, I am summing over the values in a column in a .csv and then outputting it.

    I would like to show an image based on what that value is. As a crude example, if the sum is greater than 50, output a frown. If it is less than 50, show a smiling face. What’s the best documentation for putting in graphics that will work on the mirror?

    posted in Development
    N
    nbrenn
    Feb 4, 2017, 1:37 PM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @morozgrafix I think I can work around this by changing the SQL query (that generates my .csv) to include just one column. Then I can implement it as a new module, placed above the current one.

    posted in Development
    N
    nbrenn
    Feb 4, 2017, 1:18 AM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @morozgrafix Everything is working very well so far!

    I am updating my “Sum” daily, but I would like to be able to show the previous day’s sum. Could I store the value of the sum at 11:59pm, each evening, and then display that value in addition to the current day’s sum?

    Additionally, how could I modify the line of code:

    this.sum = lines.reduce((a, b) => a + b, 0);
    

    to allow for me to sum across multiple columns? So, if my .csv has 3 columns, I’d like the sum total of them.

    posted in Development
    N
    nbrenn
    Feb 3, 2017, 1:45 PM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @morozgrafix This looks awesome! I will try to work with this over the next couple days and will let you know if I have any other questions! Thanks!

    posted in Development
    N
    nbrenn
    Jan 25, 2017, 2:06 PM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @morozgrafix Thanks for your outline. It is very, very helpful and appreciated. So I tried to take what you suggested to turn it into my code, and put it onto GitHub.

    I created a GitHub repository that contains my .css, .csv, and datafeed.js. My areas of confusion (which you’ll probably see in the code) are around how I called in the remoteFile in my getDom. I am not sure if I did that correctly. https://github.com/brennn1/Magic-Mirror-Datafeed-Module

    My .csv is coming in the format which you’ll see on the Github - so each data point is separated by a new line. So I changed where you had the line.split(",") to line.split("\n").

    Do you see anything obvious that will cause me problems? I will go ahead and see what errors I get when I load it onto my mirror.

    posted in Development
    N
    nbrenn
    Jan 25, 2017, 1:12 AM
  • RE: How to load a <script> src = " " </script> into my mirror?

    @morozgrafix I am referring back to your jsfiddle example: jsfiddle example, and you created an object called csvData which you refer to in var data = ...

    I was wondering how I would create a similar object, except with the file that I have in my directory. I couldn’t seem to find an HTML DOM function that would allow me to load the .csv file. I looked at the examples for the Compliments module, and they were in json. So, I saw that I might be able to use Papa Parse to convert the .csv to json and then follow the similar route as the Compliments.

    My d3 approach loads the data from my csv onto my mirror, but the .css doesn’t seem to help it. It doesn’t appear in a table, and is very large (displaying in the upper left part of the mirror) even when I specified it to load in the middle.

    For some context, my .csv data table contains two columns of time-series data for which I want to sum together. And then I just want to output a sentence like, “Your sum is XXX.”

    Thanks again for the clarifications. I’m slowly wrapping my head around the interaction of the HTML and Javascript, and I think I get confused when I see code split into HTML and Javascript, when the modules are written with it all together in the HTML DOM format.

    posted in Development
    N
    nbrenn
    Jan 24, 2017, 10:24 PM
  • RE: Displaying data from a CSV file saved on my Pi?

    @morozgrafix That’s fine with me! Thanks!

    posted in Development
    N
    nbrenn
    Jan 24, 2017, 7:38 PM
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