Magic Mirror Module
- General
Magic Mirror Module
What is magic mirror module?
MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant. MagicMirror² is built by the creator of the original MagicMirror with the incredible help of a growing community of contributors.
MagicMirror² focuses on a modular plugin system and uses Electron as an application wrapper. So no more web server or browser installs necessary!
Requirements
1) Hardware:-
MagicMirror² is developed to run on a Raspberry Pi. It might (and will) run on various different types of hardware, but new versions will only be tested on a Raspberry Pi.
Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2, 3 & 4. The Raspberry Pi 0/1 is currently not supported. If you want to run this on a Raspberry Pi 1, use the server only feature and setup a fullscreen browser yourself. (Yes, people have managed to run MM² also on a Pi0, so if you insist, search in the forums.)
2) Operating System:- Note that you will need to install the latest full version of Raspbian, don’t use the Lite version. If you want to run the software on other Operating Systems.
3) Node:- Although older version of Node might work, we suggest you use Node 16.
Installation & Usage
The Magic Mirror can be installed manually or using automatic installers. At the start of 2020 the decision was made to remove the automatic installer from the MagicMirror² core repository and move it to a community maintained separate repository. For more information about this decision, please check issue #1860 on GitHub.
Therefore the only officially supported way of installation is by using a manual installation. Using external installation scripts is at your own risk but can make the process a lot easier. Available automatic installers can be found under: alternative installation methods.
1) Manual Installation:-
A) Download and install the latest Node.js version:
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash –
sudo apt install -y nodejs
B) Clone the repository and check out the master branch:
git clone https://github.com/MichMich/MagicMirror
C) Enter the repository:
cd MagicMirror/
D) Install the application:
npm install –only=prod –omit=dev
E) Make a copy of the config sample file:
cp config/config.js.sample config/config.js
F) Start the application:
npm run start
G) For Server Only use:
npm run server
2) Alternative Installation Methods
The following installation methods are not maintained by the MagicMirror² core team. Use these scripts and methods at your own risk.
A) Automatic Installation Scripts:-
i) Sam (@sdetweil, long time contributor of the MagicMirror² framework) maintains a easy to use installation and update script:
https://github.com/sdetweil/MagicMirror_scripts
ii) The MagicMirror Package Manager is a command line interface designed to simplify the installation, removal, and maintenance of MagicMirror modules.
- Server Only:- In some cases, you want to start the application without an actual app window. In this case, you can start MagicMirror² in server only mode by manually running npm run server or using Docker. This will start the server, after which you can open the application in your browser of choice. Detailed description below.
- Client Only:- This is when you already have a server running remotely and want your RPi to connect as a standalone client to this instance, to show the MM from the server. Then from your RPi, you run it with: node clientonly –address 192.168.1.5 –port 8080. (Specify the ip address and port number of the server)
Modules
A) Clock:- It is used to display clock.
1 2 3 4 5 6 7 |
{ module: "clock", position: "top_right", classes: 'scheduler', config: { } } |
B) Compliments:- It is used to display headlines or text.
1 2 3 4 5 6 7 |
{ module: "compliments", position: "top_center", classes: 'scheduler', config: { } }, |
C) Live Cricket Score:- It is used to display Live Cricket Score.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
{ module: 'MMM-CricketScores', position: 'top_center', classes: 'scheduler', config: { category: "cricket", numberOfResults: 1, screenRefreshInterval: 10, focusTeam: "India", apiKey: 'bc05566a19mshd8605c56e2e4454p1f810fjsne2c23a19136c', // refer to the apiKey description to get an apiKey // apiKey: '3be322deeamsh01a9db46924147dp1212cbjsn87caf796bbec', // refer to the apiKey description to get an apiKey refreshInterval: 90, }, width: "20%", }, |
D) Google Photos:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
{ module: "MMM-GooglePhotos", position: "fullscreen_above", config: { albums: ["AURIGA"], updateInterval: 1000 * 10, sort: "random", uploadAlbum: null, condition: { fromDate: null, toDate: null, minWidth: null, maxWidth: null, minHeight: null, maxHeight: null, minWHRatio: null, maxWHRatio: null, }, showWidth: 1100, showHeight: 600, timeFormat: "YYYY/MM/DD HH:mm", debug: true, } }, |
E) Music:-
1 2 3 4 |
{ module: 'MMM-MP3Player', position: 'top_center' }, |
F) Network Connections:-
1 2 3 4 5 6 7 8 9 |
{ module: 'MMM-NetworkConnection', position: 'top_right', classes: 'scheduler', showWidth: 200, showHeight: 100, config: { } }, |
G) News:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
{ module: "newsfeed", position: "bottom_left", classes: 'scheduler', config: { feeds: [ { title: "Technology News", url: "https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml" } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } }, |
E) You Tube Video:-
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ module: 'MMM-EmbedYoutube', // Path to youtube module from modules folder Exmaple: MagicMirror/modules/custom/MMM-EmbedYoutube/ so it's custom/MMM-EmbedYoutube position: 'top_center', // This can be any of the regions.https://www.youtube.com/embed/LEqeoOjVIfY config: { // See 'Configuration options' in README.md for more information. video_id: 'LEqeoOjVIfY', loop: true, autoplay: true, height: "400", width: "400", // controls: false, }, }, |
G) YFrame:-
Calling get api from wordpress post and using it in MMM with the help of yFrame module.
H) All Module in One Screen:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
let config = { address: "localhost", port: 8088, basePath: "/", ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], useHttps: false, httpsPrivateKey: "", httpsCertificate: "", language: "en", locale: "en-US", logLevel: ["INFO", "LOG", "WARN", "ERROR"], timeFormat: 24, units: "metric", modules: [ { module: "alert", classes: 'scheduler', config: { } }, { module: "updatenotification", position: "top_bar", classes: 'scheduler', config: { } }, { module: "clock", position: "top_right", classes: 'scheduler', config: { } }, { module: "MMM-GooglePhotos", position: "fullscreen_above", config: { albums: ["AURIGA"], updateInterval: 1000 * 10, sort: "random", uploadAlbum: null, condition: { fromDate: null, toDate: null, minWidth: null, maxWidth: null, minHeight: null, maxHeight: null, minWHRatio: null, maxWHRatio: null, }, showWidth: 1100, showHeight: 600, timeFormat: "YYYY/MM/DD HH:mm", debug: true, } }, { module: 'MMM-NetworkConnection', position: 'top_right', classes: 'scheduler', showWidth: 200, showHeight: 100, config: { } }, { module: "newsfeed", position: "bottom_left", classes: 'scheduler', config: { feeds: [ { title: "Technology News", url: "https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml" } ], showSourceTitle: true, showPublishDate: true, broadcastNewsFeeds: true, broadcastNewsUpdates: true } }, { module: "MMM-Widget", config: { widgets: [ { html: ` <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> $(document).ready(function () { $.ajax({ url: 'https://www.aurigait.com/index.php/wp-json/wp/v2/posts', type: 'GET', dataType: 'json', success: function (data, textStatus, xhr) { $("#test2").html(data[0].title.rendered); $("#myText").html(data[0].content.rendered); }, error: function (xhr, textStatus, errorThrown) { console.log('Error in Operation'); } }); }); </script> <style> body { background-color: black; color:#999; } .my-custom { font-size: 40px; } </style> </head> <body> <br /> <br /> <marquee attribute_name="attribute_value" ....more attributes id="myyy" style="font-size: 40px;"> Blog From Wordpress Post API </marquee> <hr /> <div class="my-custom"> <h5 id="test2"> </h5> </div> <div style="width: 80%; font-size: 30px;"> <h5 id="myText"> </h5> </div> </body> </html> `, position: "top_right", width: "600px", height: "700px", backgroundColor: "#FFF" }, ] } }, ] }; /*************** DO NOT EDIT THE LINE BELOW ***************/ if (typeof module !== "undefined") { module.exports = config; } |
Thank You
Related content
Auriga: Leveling Up for Enterprise Growth!
Auriga’s journey began in 2010 crafting products for India’s