• 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. doubleT
  3. Posts
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
D
Offline
  • Profile
  • Following 0
  • Followers 4
  • Topics 4
  • Posts 176
  • Groups 1

Posts

Recent Best Controversial
  • RE: Really confused

    Ok, thanks for the private message. Seems like you have trouble posting the code. Don’t worry, we’ll sort it out the other way.

    You were able to open the config.js now delete the content completely! Copy the below code in the box and paste it into the config.js then save it.

    /* Magic Mirror Config Sample
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     *
     * For more information how you can configurate this file
     * See https://github.com/MichMich/MagicMirror#configuration
     *
     */
    
    var config = {
    	address: "localhost", // Address to listen on, can be:
    	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    	                      // - another specific IPv4/6 to listen on a specific interface
    	                      // - "", "0.0.0.0", "::" to listen on any interface
    	                      // Default, when address config is left out, is "localhost"
    	port: 8080,
    	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
    	                                                       // or add a specific IPv4 of 192.168.1.5 :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    
    	language: "en",
    	timeFormat: 24,
    	units: "metric",
    
    	modules: [
    		{
    			module: "alert",
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    		{
    			module: "calendar",
    			header: "US Holidays",
    			position: "top_left",
    			config: {
    				calendars: [
    					{
    						symbol: "calendar-check-o ",
    						url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics"
    					}
    				]
    			}
    		},
    		{
    			module: "compliments",
    			position: "lower_third"
    		},
    		{
    			module: "currentweather",
    			position: "top_right",
    			config: {
    				location: "New York",
    				locationID: "",  //ID from http://www.openweathermap.org/help/city_list.txt
    				appid: "YOUR_OPENWEATHER_API_KEY"
    			}
    		},
    		{
    			module: "weatherforecast",
    			position: "top_right",
    			header: "Weather Forecast",
    			config: {
    				location: "New York",
    				locationID: "5128581",  //ID from http://www.openweathermap.org/help/city_list.txt
    				appid: "YOUR_OPENWEATHER_API_KEY"
    			}
    		},
    		{
    			module: "newsfeed",
    			position: "bottom_bar",
    			config: {
    				feeds: [
    					{
    						title: "New York Times",
    						url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml"
    					}
    				],
    				showSourceTitle: true,
    				showPublishDate: true
    			}
    		},
    	]
    
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}
    
    
    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 7:54 PM
  • RE: How to add modules. For absolute beginners.

    A good one. :) www.sublimetext.com

    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 7:33 PM
  • RE: Default Modules

    For the sake of completeness I’d say that even on the current day it’s still helpfull to see the forecast with the lowest and highest temp throughout the day.


    The reason I revided this thread, though, is: DECIMAL MARKS IN WEATHER MODULES

    I saw a lot of Mirrors from German users with typographically wrong decimal marks in the defeault modules Current Weather and Weather Forecast (9.5°C vs 9,5°C).

    With the latest update, there’s the possibility to change the decimal mark from the English decimal dot to the German (and other language’s) decimal comma. If you’re not sure what decimal mark your language is using, check this list on Wikipedia.

    Usage:
    In the config of currentweather and weatherforecast, just add the line

    decimalSymbol: ","
    

    only with MagicMirror² v2.2.0 and up

    posted in Modules
    D
    doubleT
    Jan 14, 2018, 5:49 PM
  • RE: Really confused

    Did you copy the config.js.example to config.js with the code above? Have you made any changes inside config.js yet?
    Can you cd into the config folder and tell us what ls (list) is showing?

    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 5:27 PM
  • RE: Really confused

    I guess you have to create a config file. ;) Did you read the Readme @ https://github.com/MichMich/MagicMirror (scroll down a little)?

    The MagicMirror, as the readme points out, comes with a config example. Create a config file by copying the example file with this command:
    cp config/config.js.sample config/config.js Use this command from the MagicMirror folder!
    (The way this works is: copy | original/file.js | target/file.js)

    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 4:54 PM
  • RE: Really confused

    Sorry if this sounds a bit harsh, but to be honest, that’s an easy one that you can answer yourself with all the information you have in this thread already. You’re making the same mistake as yesterday.

    Hint: Check where you are. Use “ls” (list content of current directory) and “cd”. Learn to read the path to know where you are.

    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 12:10 PM
  • RE: Really confused

    @Duke86 said in Really confused:

    pi@raspberrypi:~/MagicMirror $ cd MagicMirror
    bash: cd: MagicMirror: No such file or directory

    You are already in the directory “MagicMirror”. cd (change directory to) can’t find the directory because you are already inside.

    pi@raspberrypi:~/MagicMirror $ nmp install
    bash: nmp: command not found

    Just a typo, it’s “npm”, not “nmp”.

    posted in Troubleshooting
    D
    doubleT
    Jan 14, 2018, 11:12 AM
  • RE: Default newsfeed - make list?

    @Pade2204 said in Default newsfeed - make list?:

    Im not good to see, where you edit those things you have made? Can you make a dummy guide for me? hehe :)

    Sure, but I’d suggest reading – and learning – about the basics of JavaScripts first, or this could get a bit complicated.

    I worked directly in the default newsfeed module, which I’d absolutely not suggest doing. a) This could break the default module and you have to rebuild the code. b) With the next update, the code will be reset to its original state and your changes are lost.

    Having said that, to experiment with this module, I changed the /MagicMirror/modules/default/newsfeed/newsfeed.js that I opened in an editor. You’ll see the functions I mentioned above. Note that I commented where the original code of a function was left untouched. In the getDom: I put some part of the original code with the else { } part of an if statement.

    EDIT: I made a git repository of the changes I made. You can look at my code here: https://github.com/TTigges/newsstack/blob/master/newsfeed.js

    posted in Requests
    D
    doubleT
    Jan 14, 2018, 1:03 AM
  • RE: Default newsfeed - make list?

    I played around with the module a little bit, made a list of 5 news items scrolling vertically, then came back to this thread and saw that I missunderstood your request. Oh, well…

    What I overlooked was the part where you wanted 5 items, then 5 of another source.
    What I saw was a list where an item would be visible for 5 “intervals”. It comes in from the bottom, then the next one comes in, pushing the last one up, and so on. I thought this was just about having news item in view and readable for a longer time while still having some flow.

    Video: https://streamable.com/7a8pq

    If you want to check it out:

    defaults: {
    //... original content
    // NEW:
    	stackNews: true,
    	stackSize: 5
    
    },
    
    getDom: function() {
    	var wrapper = document.createElement("div");
    
    	if (this.config.feedUrl) {
    //... original content
    	}
    	if (this.activeItem >= this.newsItems.length) {
    //... original content
    	}
    // NEW:
    	if (this.config.stackNews) {
    		if (this.newsItems.length > 0) {
    
    			var newsStack = document.createElement("ul");
    			newsStack.setAttribute("id", "newsstack");
    				// 5 empty li-items
    				for (e = 1; e < this.config.stackSize; e++) {
    					var newsStackItem = document.createElement("li");
    					newsStackItem.className = "newsstack0 bright medium light" + (!this.config.wrapTitle ? " no-wrap" : "");
    					
    					newsStackItem.innerHTML = "";
    					newsStack.appendChild(newsStackItem);
    				}
    
    				for (s = 0; s < this.newsItems.length-1; s++) {
    					var newsStackItem = document.createElement("li");
    					newsStackItem.className = "newsstack" + s + " bright medium light" + (!this.config.wrapTitle ? " no-wrap" : "");
    					
    					newsStackItem.innerHTML = this.newsItems[this.activeItem + s].title;
    					newsStack.appendChild(newsStackItem);
    				}
    			wrapper.appendChild(newsStack);
    
    		} else {
    			if (this.config.hideLoading) {
    				this.hide();
    			} else {
    				wrapper.innerHTML = this.translate("LOADING");
    				wrapper.className = "small dimmed";
    			}
    		}
    
    	}
    	else {
    //... original content within else {}
    	}	
    	return wrapper;
    },
    
    scheduleUpdateInterval: function() {
    	var self = this;
    // NEW/CHANGED/UPDATED:
    	self.updateDom(self.config.animationSpeed);
    
    	if (this.config.stackNews) {
    		timer = setInterval(function() {
    			self.newsStack();
    		}, this.config.updateInterval);
    	}
    	else {
    		timer = setInterval(function() {
    			self.activeItem++;
    			self.updateDom(self.config.animationSpeed);
    		}, this.config.updateInterval);
    	}
    },
    newsStack: function() {
    	var self = this;
    	Log.info("delete a line");
    	document.getElementById("newsstack").removeChild(document.getElementById("newsstack").children[0]);
    	Log.info(document.getElementById("newsstack").children.length);
    	if (document.getElementById("newsstack").children.length === 0) {
    		Log.info("start over again");
    		self.updateDom(self.config.animationSpeed);
    	}
    },
    

    custom.css:

    ul#newsstack {
        height: 140px; /* stackSize - 1 * 35 (li height) */
        overflow: hidden; /* or you will see all news list items */
        padding-top: 35px;
        transition: padding-top 1s;
    }
    ul#newsstack:empty {
        padding-top: 0px;
    }
    ul#newsstack li {
        height: 35px;
        margin-top: 0px;
        transition: margin-top 1s;
        list-style-type: none;
    }
    
    ul#newsstack li:first-child {
        margin-top: -33px;
    }
    

    Not sure how this would work with several feeds, yet.

    posted in Requests
    D
    doubleT
    Jan 13, 2018, 9:43 PM
  • RE: Mirror turning black after a while

    Is there any kind of “sleep” mode on the system itself?
    The node log probably doesn’t detect what’s going on but maybe the console log would show (unfortunately, it’s reset when the browser window is refreshed). I’d start MM in dev mode and wait for the crash, then check the browser’s console log.

    posted in Troubleshooting
    D
    doubleT
    Jan 11, 2018, 5:51 PM
  • 1 / 1
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