@kumartrd Have a look at MMM-PIR-Sensor. You can customize it to suit your requirements. It normally triggers turning the monitor on, and sets a timer to turn the monitor off. Instead, you want to use button actions/notifications to do both, and not use a timer. Instead you can reuse the wake code for sleep. You’ll also need to add a logic test that a button press while asleep wakes, while a button press while awake sleeps. Have a look at this thread for a very thorough explanation.
Read the statement by Michael Teeuw here.
Posts
-
RE: Touch Switch - Wakes From and Puts To Sleep
-
RE: Slim display due to thin space
@Kastore Why not just let the mirror extend past the back of the door? Are there shelves? Just let your mirror wear a backpack.
-
RE: Permission Denied - Config File
@KumarTRD It’s not executable. You need to use an editor to open it, like
nano:nano ~/MagicMirror/config/config.js -
RE: Changing units from 'metric' to 'imperial' breaks currentweather module
@sefeing Use the instructions here. You want to
git checkoutthe branch by name (in this case, rungit checkout developin the~/MagicMirrorfolder).You might even be able to use
git cherry-pick 10eb41d31943a4495bf4c4674d52d0b9631a7446instead, to stay onmasterbut incorporate that specific fix. YMMV. -
RE: How to update the master branch?
@e3v3a I take your point; in my case I’m running a reasonable size card and Raspbian/MM are all that is on the card. I do also mention to delete
MM-Backupwhen they’re done. I really just wanted to give them the extra insurance of a full backup. Good call ontar, but they then need to know how to unpack it.@strawberry-3.141 If you’re using git to stash changes, then you’ve clearly modified other files (IIRC,
config.jsand maybecustom.cssare ignored). As above, I just wanted to give extra assurance that they had a full copy if anything went totally awry. -
RE: updating without losing settings in config, and js files?
@navyvette87 @Cyberwrights is right, and where possible you should migrate your changes into
config.js,custom.css, etc.When updating,
gitinsists that your files not have changes that conflict with those of the repository. Usegit stashas outlined here to store your local changes, pull updates from the repo, then restore your own changes. -
RE: Exporting a file from Google Drive with specific mimeType
@luckylooke Great news, is it up and working? Sorry, I never got mine working, but may now try again. Thanks!
-
RE: Displaying data from MySQL database
@wolkenaj
/Testwill tell the shell to look in the root of the filesystem (/) forTest. Instead,./will tell it to look in the current working directory (cwd), which I suspect is~/MagicMirror. So./Testis likely what you want.Worst case, you could use the complete path (
~/MagicMirror/Testor/home/pi/MagicMirror/Test) which should also work. I also suggest renamingTesttotest.sh, just so it’s always immediately apparent that it’s a shell script. -
RE: Request a Twitterfeed
@mediathreat
newsfeedwill refresh the feeds based on theupdateinterval, so it depends on whether (and how often) TwitRSS refreshes the feeds. -
RE: Improve updatenotification module (to be module selective)
Although I concede I’m not sure how to set the
configparameters forupdatenotificationinconfig.js(whether you can set params without instantiating the module). -
RE: Improve updatenotification module (to be module selective)
@E3V3A But also means you lose the metadata stored in
.gitto manage (incl. update later) via.gitwithout renaming the folder.Why not have
updatenotificationiterate over/skip modules on the blacklist? Something like changing this line innode_helper.js:if (defaultModules.indexOf(moduleName) < 0) {To the following?
if (defaultModules.indexOf(moduleName) < 0 && this.config.ignoreModules.indexOf(moduleName) < 0){This means if the module is either (1) in
defaultModulesor (2) in the (new)ignoreModulesit gets skipped.Remember to also add
ignoreModules: []todefaultsinupdatenotification. You can then avoid altering the filesystem whatsoever. -
RE: Raspberry Pi 3's case and fan
@Ismail Are there screw holes to mount on that cover under the Raspberry logo (holes)? There are plenty of videos to see how to connect the pins and secure the fan to the case.
-
RE: change font of modules (local fonts)
@bekirs Did you try using
url("file:///home/pi/MagicMirror/fonts/Verdana.ttf")? -
RE: MMM-CalendarExt
@abetterway I think you mean switch the origin branch of the MMM-CalendarExt repository to
forRPI1.In this case, use
git checkout forRPI1within the~/MagicMirror/modules/MMM-CalendarExtdirectory. -
RE: Displaying data from MySQL database
@wolkenaj MMM-PIR-Sensor uses shell scripting in node_helper.js to turn the screen on and off with
tvservice. -
RE: 3D Content
@mirrX Follow your link, and click on Embed. They will give you the markup to create an iFrame.
You can then integrate this with something like MMM-iframe or MMM-HTMLBox.
You may however have to coax it into displaying VR; I note the iFrame markup provided by Sketchfab has a
allowvrproperty. -
RE: Todoist accesstoken
- Create an app (e.g. “My Private MagicMirror”) in the developer’s console. If you don’t have a website, use
example.com. - Then with your client ID and secret, construct an OAuth query (with whatever
scopeyour app will need) and visit in a browser. - It will then redirect you to your app’s website with a
codeparameter. (If usingexample.com, it will fail to reach the site; just look at the address bar and find thecodeparameter.) - Use the
codeparameter to exchange for an access token (e.g. usingcurl):
$ curl "https://todoist.com/oauth/access_token" \ -d "client_id=0123456789abcdef" \ -d "client_secret=secret" \ -d "code=abcdef" \ -d "redirect_uri=https://example.com" - Create an app (e.g. “My Private MagicMirror”) in the developer’s console. If you don’t have a website, use
-
RE: How to autorestart MM once a day
@MaxPower It stacks every 1-2 days? I don’t quite understand what that means.
In any case, what command are you using to restart? Are you trying to restart MM (recommended) or the RPi? If you have
pm2installed and managing your MM process, I suggest usingpm2 restart mm. Whatever commend you choose, run it in Terminal first to ensure it will do what you intend.There are lots of videos and walkthroughs available online on how to use
crontab.I recommend you then add the following
crontabtask:* 4 * * * pm2 restart mmThis will restart MM every day at 4am (when I assume you’re not using it) so that it’s ready in the morning.
-
RE: GIF update from URL with MMM-EyeCandy
@Mykle1 Yep, just needs to be a
?before the first parameter. Anything after gets appended with an&, e.g.https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=1521767776&otherseed=4846528&page=2.Making your code the following:
... // img creation, etc var getTimeStamp = new Date().getTime(); img.src = "https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?seed=" + getTimeStamp; pic.appendChild(img); wrapper.appendChild(pic); -
RE: GIF update from URL with MMM-EyeCandy
@Mykle1 How did you seed the url with a timestamp? When I visit
https://icons.wxug.com/data/weather-maps/radar/united-states/united-states-current-radar-animation.gif?1521767776, I get the image returned (not a404).