Read the statement by Michael Teeuw here.
Total rookie, got it "running" but need help
-
@motdog - Okay, let’s get you fixed up. First step is how to use the markdown features of the forum. Read that real quick before you reply. Especially the part at the bottom about posting code.
By default, the current weather and the weather forecast don’t work. That’s because it needs a key to access the web API that contains the forecast data and it needs a location to load weather data. Let’s look at the part of
config.js
that is specific to the current weather module. It currently reads:{ module: "currentweather", position: "top_right", config: { location: "New York", locationID: "", //ID from htttp://bulk.openweathermap.org/sample/; unzip the gz file and find your city appid: "YOUR_OPENWEATHER_API_KEY" } },
For starters, you can delete everything after the
//
characters on the line that reads locationID. That’s a helpful comment and isn’t executed by the system. Get rid of it to clean it up a bit.You have to do two things here: Find the location ID for your area and you have to sign up for an OpenWeather API key. Location is easy. Go to OpenWeatherMap and search for where you live. Follow that link and use the search box to type in your city. I’ll use Little Rock, Arkansas as an example. When I search for that city, I get a handful of results. Pick one and click on it. You’ll get a webpage with current weather and forecast, right? Look at the URL of that page and you’ll see something like this: https://openweathermap.org/city/4898342
That seven digit number is the location ID. Plug that into the
config.js
as the value of thelocationID
key. Like so:{ module: "currentweather", position: "top_right", config: { location: "New York", locationID: "4898342", appid: "YOUR_OPENWEATHER_API_KEY" } },
Once you have that, go back to your web browser on the OpenWeatherMap web page. At the top is a menu item called “API”. Click on it. You’ll be given several options on how to sign up for their service and obtain an API Key. Go ahead and register for the free tier. Once you’ve successfully registered, you can click on the Sign In option and you’ll be given a sub-menu that includes a link to “API Keys”. Follow that link and you’ll see the interface to generate an API key. Punch in a name for your key and click on “Generate”. It will show you a stream of gibberish. That is your API key. Copy that down, 'cuz you’re going to need it.
Now you just need to plug your API key back into the
config.js
file.{ module: "currentweather", position: "top_right", config: { location: "New York", locationID: "4898342", appid: "1234567890ABBACADABBA" } },
Save your file and restart your Mirror process (
pm2 restart 0
). You should see the current weather. I’ll leave the configuration of the weather forecast as an exercise for the newbie. :) -
@bhepler Thanks. I’m a visual learner so seeing it broken down like this helps. I also found a few youtube videos that hopefully will do the same. I get changing the forecast will be the same as the current weather with the proper info in place.
-
@bhepler ok things are a mess. Thought I did the weather thing correct. When I try to launch I get the dreaded please create a config file Totally appreciate the help
/* 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: "Imperial", 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", url: "webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics" } ] } }, { module: "compliments", position: "lower_third" }, { module: "currentweather", position: "top_right", config: { location: "Cottleville", locationID: "4382491", } }, { module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "Cottleville", locationID: "4382491", appid: "06ba2b8cec1e843098c058756882d642" } }, { 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 } }, ] };
-
Don’t know if I properly copied sample file to config.js kinda guessed how to do so
-
@motdog said in Total rookie, got it "running" but need help:
timeFormat: 12
You are missing a comma at line 25
it should be
timeFormat: 12,
Ejay