Read the statement by Michael Teeuw here.
How to add modules. For absolute beginners.
-
Mykle! I have the PilotMX instlled and working on the bottom bar with my chosen 2 airports but it takes up the full width of the screen. Can I make it narrower. I changed the maxWidth to 300px but it is still all the way across.
-
@Dask bottom bar is designed to do exactly that. you’d be better to use bottom_left, bottom_right, or bottom_center (or is it middle, I don’t recall, I keep my config organized by the regions, so I get reminded when I redesign)
-
@Mykle1 - thanks for this guide. I promise I’ve studied it through and read the additional helpful comments that other contributors have made. However, I’ve having trouble adding the MMM-PrayerTime module to config.js. When I add the module and MM restarts, it shows blank and an error telling me to create a config file. Grateful for pointers on where I’m going wrong (please see code below. I’ve hidden any personal information). Thanks.
To note that without the entry to the MMM-PrayerTime module added to config.js Magic Mirror runs fine with the other modules.
modules: [ { module: "alert", }, { module: "updatenotification", position: "top_bar" }, { module: "clock", position: "top_left" }, { module: "MMM-PrayerTime", position: "top_left", // This can be any of the regions. Best result is in the top_left/top_right. config: { apiVersion: "1.0", // please, leave unchanged. reserved for future use. lat: xx.xxxxxxx, // latitude of your position (city) lon: -x.xxxxxxx, // longitude of your position (city) timezone: Europe/London, // please refer to http://php.net/manual/en/timezones.php timeFormat: 24, method: 5, playAdzan: ["fajr", "dhuhr", "asr", "maghrib", "isha"], notDisplayed: ["midnight", "sunset"], useUpdateInterval: true, updateInterval: 86400 * 1000, // How often do you want to fetch new praying time? (milliseconds) animationSpeed: 2.5 * 1000, // Speed of the update animation. (milliseconds) language: config.language, showAdzanAlert: true, showTomorrow: true, vertical: true, // set false for horizontal view alertTimer: 15000 } }, { module: "calendar", header: "UK Holidays", position: "top_left", config: { calendars: [ { symbol: "calendar-check", url: "webcal://www.calendarlabs.com/ical-calendar/ics/75/UK_Holidays.ics" } ] } }, { module: "currentweather", position: "top_right", config: { location: "London", locationID: "2643743", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }, { module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "London", locationID: "2643743", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml" }, { title: "BBC World News", url: "http://feeds.bbci.co.uk/news/world/rss.xml" }, { title: "Reddit", url: "https://www.reddit.com/r/worldnews/.rss" }, { title: "Buzzfeed", url: "https://www.buzzfeed.com/world.xml" }, { title: "Al Jazeera", url: "http://www.aljazeera.com/xml/rss/all.xml" } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } }, ] };
-
@TheSij ok, general rules for config values
thing to the right of :
if numeric or true/false
no quotesotherwise quoted, single or double doesn’t matter as long as both ends are the same
exception here, if the string is config.something (yours has config.language)
then not quoted, as this means use the value of that item from this configso, your timezone is text, but has no quotes.
I assume u xx the lat/long so we won’t know where u are -
@sdetweil. Thanks, Sam. That’s helpful to explain the general rules.
I’ve made a slight amendment - I figured that the timezone parameters was not correctly entered (see below - this time just showing the modules before and after). To answer your last point, I did remove the lat/lon values to hide my exact location (this time I’ve put in made-up numbers). With the slight amendment to the code, it’s still not working - do you think it’s the ‘timezone’ value that is causing the problem? I’ve not made any changes to the other modules.
{ module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "London", locationID: "2643743", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "1ab234c567defgh89012ij34k56l78mn" } }, { module: 'MMM-PrayerTime', position: 'top_left', // This can be any of the regions. Best result is in the top_left/top_right. config: { apiVersion: '1.0', // please, leave unchanged. reserved for future use. lat: 12.3456789, // latitude of your position (city) lon: -0.1234567, // longitude of your position (city) timezone: date_default_timezone_set('Europe/London'), // please refer to http://php.net/manual/en/timezones.php timeFormat: 24, method: 5, playAdzan: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha'], notDisplayed: ['midnight', 'sunset'], useUpdateInterval: true, updateInterval: 86400 * 1000, // How often do you want to fetch new praying time? (milliseconds) animationSpeed: 2.5 * 1000, // Speed of the update animation. (milliseconds) language: config.language, showAdzanAlert: true, showTomorrow: true, vertical: true, // set false for horizontal view alertTimer: 15000 } }, { module: "newsfeed", position: "bottom_bar", config: { feeds: [ { title: "New York Times", url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml" }, { title: "BBC World News", url: "http://feeds.bbci.co.uk/news/world/rss.xml" }, { title: "Reddit", url: "https://www.reddit.com/r/worldnews/.rss" }, { title: "Buzzfeed", url: "https://www.buzzfeed.com/world.xml" }, { title: "Al Jazeera", url: "http://www.aljazeera.com/xml/rss/all.xml" }
-
@TheSij yes, still timezone., that syntax says call a function named date_default_timezone_set
but I don’t know where that would be.
just comment out that one line. add // at the start of the line
-
@sdetweil - thanks! Unfortunately, still no luck on adding // at the start of the line, or after ‘timezone:’. According to the module creator, the timezone is a required field. I went to the php website that the module creator refers to, but it just doesn’t make sense to me - the coding information on that website is vast and much too advanced for me. I may have to abandon my desire to add this particular module. :-(
-
@TheSij said in How to add modules. For absolute beginners.:
I may have to abandon my desire to add this particular module.
Don’t give up! I just installed this to test it for you. I can see why it was confusing for you but it does work. Here is my config entry. Use it as a template for yours, replacing your info for mine. The following screenshot shows it working.
{ module: 'MMM-PrayerTime', position: 'top_center', // This can be any of the regions. Best result is in the top_left/top_right. config: { apiVersion: '1.0', // please, leave unchanged. reserved for future use. lat: myLat, // latitude of your position (city) lon: myLong, // longitude of your position (city) timezone: 'Europe/London', // please refer to http://php.net/manual/en/timezones.php // timeFormat: 24, method: 5, playAdzan: ['fajr', 'dhuhr', 'asr', 'maghrib', 'isha'], notDisplayed: ['midnight', 'sunset'], useUpdateInterval: true, updateInterval: 86400 * 1000, // How often do you want to fetch new praying time? (milliseconds) animationSpeed: 2.5 * 1000, // Speed of the update animation. (milliseconds) // language: config.language, showAdzanAlert: true, showTomorrow: true, vertical: true, // set false for horizontal view alertTimer: 15000 } },
-
@Mykle1 thx!
so the original problem was the timezone wasn’t quoted.
-
@sdetweil said in How to add modules. For absolute beginners.:
so the original problem was the timezone wasn’t quoted.
That and
language: config.language,
was causing an error. I simply commented it out and the module uses the config language by default. :-)Edit: Oh, and
timeFormat: 24,
in the module’s config entry, as well. Again, I commented it out as it was redundant.