Copy and paste of text to nano config/config.js



  • Hi so I’m currently trying to change the current weather details in the nano config/config.js folder. I wanted to try copying and pasting the information shown below to replace the current details in there as a test to get it working. I’m yet to be success full. So I copy the info below and copy and past it over the details already in the file for current weather, but for some reason each time it just re-copys whats already in there New York, instead of replacing it with Amsterdam,Netherlands and all the other info. It seems to paste everywhere else but not in that folder.

    Any help would be gratefully appreciated.

    {
    		module: "currentweather",
    		position: "top_right",	// This can be any of the regions.
    									// Best results in left or right regions.
    		config: {
    			// See 'Configuration options' for more information.
    			location: "Amsterdam,Netherlands",
    			locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt
    			appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key.
    		}
    

  • Module Developer

    @IDCreate

    If I had to guess, I’d say that your use of nano to edit your config.js file is at fault. There is an easier way to edit your config.js file that doesn’t require the use of nano, or even the terminal, at all. Straight out of this tutorial:
    https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners

    Go to your Pi desktop

    Click the File Manager folder. (Top menu bar, 3rd from the left, in Raspbian Jessie)

    Double click the MagicMirror folder.

    Double click the config folder.

    Double click the config.js file. (Not the sample! The config.js file you made during setup)

    Your config.js file is now open in a text editor. (leafpad)

    Edit your file and remember to SAVE



  • This post is deleted!

  • Module Developer

    Your config entry should look like this:

    {
    	module: "currentweather",
    	position: "bottom_center",
    	config: {
    		location: "THIS CAN BE EMPTY",
    		locationID: "YOUR LOCATION ID",  //ID from http://www.openweathermap.org/help/city_list.txt
    		appid: "YOUR API KEY GOES HERE", 
    	}
    },
    


  • @Mykle1 Hi I tried yesterday and it did not work. I tried just now and it copied the code in replacement of the original current weather but it still did not work. please see below my config.js

    /* 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: 12,
    	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",	// This can be any of the regions.
    									// Best results in left or right regions.
    		config: {
    			// See 'Configuration options' for more information.
    			location: "Amsterdam,Netherlands",
    			locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt
    			appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org 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;}
    

  • Module Developer

    @IDCreate

    My answer is above your question :-)



  • @Mykle1 thanks that was what it looked like at the beginning and was not doing anything so I went ahead as suggested https://github.com/MichMich/MagicMirror/tree/master/modules/default/currentweather

    To test things out and to get things working you mentioned I needed an api key. So I went to the section information in the module set up a copy and past there example presuming that would be a working one.

    {
    		module: "currentweather",
    		position: "top_right",	// This can be any of the regions.
    									// Best results in left or right regions.
    		config: {
    			// See 'Configuration options' for more information.
    			location: "Amsterdam,Netherlands",
    			locationID: "", //Location ID from http://openweathermap.org/help/city_list.txt
    			appid: "abcde12345abcde12345abcde12345ab" //openweathermap.org API key.
    		}
    

    But unfortunately nothing happens, I thought if I was to simply post there code in replacement for mine to test it as above it would work. :-(


  • Module Developer

    @IDCreate said in Copy and paste of text to nano config/config.js:

    presuming that would be a working one.

    You presume incorrectly. That is an example. You need to go to openweathermap.org and sign up for your own API key. Get your locationID there at the same time. Enter those into your config



  • @Mykle1 ok thanks going there as we speak


  • Module Developer

    @IDCreate

    So. now your config entry should look like this:

    {
    	module: "currentweather",
    	position: "top_right",
    	config: {
    		location: "", // This can be empty. Leave it as is
    		locationID: "2639577",  // inside the quotes
    		appid: "YOUR API KEY GOES HERE",  // inside the quotes
    	}
    },

Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.