A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • Calendar customization

    6
    0 Votes
    6 Posts
    5k Views
    D

    @broberg Thanks, i had changed the urgency to 0 after seeing what it did. Now i just had to solve the problem that all events within 6h would say “in 2 hours” instead of displaying the actual event time… After a bit of searching in the code i found this section: if (event.startDate - now < 6 * one_hour) and changed it to if (event.startDate - now < 1 * one_hour) , hence the calendar wold display the exact time not the time untill. (see code below)
    calendar.js

    if (event.startDate >= new Date()) { if (event.startDate - now < 2 * one_day) { // This event is within the next 48 hours (2 days) if (event.startDate - now < 1 * one_hour) { // If event is within 1 hour, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = moment(event.startDate, "x").fromNow(); } else { // Otherwise just say 'Today/Tomorrow at such-n-such time' timeWrapper.innerHTML = moment(event.startDate, "x").calendar(); }
  • currentWeather & weatherForecast "Loading..."

    2
    0 Votes
    2 Posts
    1k Views
    D

    Noticed that it the position doesn’t affect the successrate of the currentWeather module… Just says “Loading…”

  • PIR motion works but screen ceeps alive

    5
    0 Votes
    5 Posts
    3k Views
    cowboysdudeC

    @hmoed said in PIR motion works but screen ceeps alive:

    thanks for the quick replay.
    I did instyall the unclutter for mouse pointer disable but not the way you discriped.
    I wil try what you typed above.

    sudo apt-get install x11-xserver-utils unclutter disabling the screensaver

    Afther that i take a look at the install of the remote control module.

    The Python script was only to show that the PIR is working outside MM2
    And i don’t run it the same time.

    i will inform back.

    The easiest way I find to disable the screen saver is to install xscreensaver and disable it! :) Quick and easy!

  • Trying to fix my module

    9
    0 Votes
    9 Posts
    3k Views
    S

    Oh you are right, I also forget a curly brace after the ‘else’, I changed all that but it still doesn’t work
    I paste the code again if you want to see it clear

    Module.register(“schedules”, {

    defaults: { updateInterval: 20000 fadeSpeed: 4000 }, getScripts: function() { return ["moment.js"] }, getStyles: function() { return ["font-awesome.css", "schedules.css"] }, start: function() { Log.info("Starting module: " + this.name); setInterval(() => { this.getData(); this.updateDom(); }, 20 * 1000); //calls getData every 20 seconds }, getDom: function() { var wrapper = document.createElement("div") if (this.dataDirSM && this.data) { var realtable = document.createElement('table'); realtable.appendChild(this.createUpperRow()); for (var i = 0; i < Math.min(this.data.response.schedules.length, this.dataDirSM.response.schedules.length); i++) { var row = document.createElement('tr') row.appendChild(this.boxHeader(this.data.response.schedules[i].message)) row.appendChild(this.boxHeader(this.data.response.schedules[i].id)) row.appendChild(this.boxHeader(this.dataDirSM.response.schedules[i].id)) row.appendChild(this.boxHeader(this.dataDirSM.response.schedules[i].message)) realtable.appendChild(row) } wrapper.appendChild(realtable) } else { wrapper.innerHTML = "NO DATA"; }; return wrapper }, getData: function() { this.dataDirSM = loadJSON("https://api-ratp.pierre-grimaud.fr/v2/rers/B/stations/les+baconnets?destination=robinson+saint+remy+les+chevreuse&endingstation=les+baconnets"); this.data = loadJSON("https://api-ratp.pierre-grimaud.fr/v2/rers/B/stations/les+baconnets?destination=charles+de+gaulle+mitry+claye&endingstation=les+baconnets"); }, createUpperRow: function() { var firstTableRow = document.createElement('tr'); var tableh1 = document.createElement('th'); tableh1.classList.add('align-left'); var tx1 = document.createTextNode('Time'); tableh1.appendChild(tx1); firstTableRow.appendChild(tableh1); var tableh2 = document.createElement('th'); tableh2.classList.add('align-left'); var tx2 = document.createTextNode('Paris'); tableh2.appendChild(tx2); firstTableRow.appendChild(tableh2); // deuxième moitier var tableh3 = document.createElement('th'); tableh3.classList.add('align-right'); var tx3 = document.createTextNode('Sud'); tableh3.appendChild(tx3); firstTableRow.appendChild(tableh3); var tableh4 = document.createElement('th'); tableh4.classList.add('align-right'); var tx4 = document.createTextNode('Time'); tableh4.appendChild(tx4); firstTableRow.appendChild(tableh4); return firstTableRow; }, boxHeader: function(inside) { if (inside == 'Train à l\'approche' || inside == 'Train à quai') { inside = 'no way' } else if (inside == 'Train retardé') { inside = 'retard' } var fillNode = document.createTextNode(inside); var realBox = document.createElement('td') realBox.appendChild(fillNode); return realBox; }

    })

  • Adding 3rd Party Modules Issue

    2
    0 Votes
    2 Posts
    1k Views
    strawberry 3.141S

    @Allred One problem could be the single slash in front of the compliments module it gets interpretest as the start of an regular expression

    correct comments in javascript are for single line // or for multiple lines /* */

    Please use proper markdown syntax next time when you post code blocks

    EDIT: Dont share the appids to public

  • Facial Recognition - Where do elements go go?

    11
    0 Votes
    11 Posts
    8k Views
    X

    @plumcraft said in Facial Recognition - Where do elements go go?:

    Hello,

    I’m trying to use facial trainer but i got this error ( when executing python capture.py)
    reference : https://github.com/paviro/MMM-Facial-Recognition-Tools/tree/master/facetrainer

    What do you want to do?
    [1] Capture training images from webcam
    [2] Convert ‘*.jpg’ pictures from other cameras to training images
    –> 1

    Enter the name of the person you want to capture or convert images for.
    –> plumcraft
    Images will be placed in ./training_data/plumcraft

    Starting process…

    Capturing positive training images.
    Press enter to capture an image.
    Press Ctrl-C to quit.

    Capturing image…
    OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/color.cpp, line 3737
    Traceback (most recent call last):
    File “capture.py”, line 35, in
    capture.capture()
    File “/home/pi/MMM-Facial-Recognition-Tools/facetrainer/lib/capture.py”, line 57, in capture
    image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
    cv2.error: /build/opencv-ISmtkH/opencv-2.4.9.1+dfsg/modules/imgproc/src/color.cpp:3737: error: (-215) scn == 3 || scn == 4 in function cvtColor

    I’m using a raspberry pi 3 with pi camera.

    Looking forward to use this module.

    Thanks

    I have the same error. Can everybody help me? I also use Raspberry Pi 3 with pi Camera.

    Thanks a lot!

  • MMM-SpotifyConnectUI

    7
    0 Votes
    7 Posts
    3k Views
    CatoC

    @Cato Auto correct error in my second post above: sorry = support

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
  • How To Change Greeting

    4
    0 Votes
    4 Posts
    4k Views
    C

    @AAPS you’re welcome :-)

  • How to add custom birthdays to the calendar module

    4
    0 Votes
    4 Posts
    3k Views
    J

    I just setup another google calendar and have everything working that way thanks.

  • Calendar - Syntax for additional config options?

    6
    0 Votes
    6 Posts
    3k Views
    V

    omg haha. Thanks!

  • MMM-Button doesn't work

    18
    0 Votes
    18 Posts
    11k Views
    ?

    I had the same issue and was able to fix it.
    You need to execute electron-rebuild.
    Just follow these steps: https://github.com/electron/electron-rebuild

  • Calendar 'line' - where is the code?

    11
    0 Votes
    11 Posts
    6k Views
    V

    @Hacksaw Thanks, but is there no way to do so without modifying the actual module js code so that the only changes are to custom.css?

  • How to implement specific module?

    12
    0 Votes
    12 Posts
    7k Views
    chamaeleon82C

    @Jeff - You can easily integrate this module with iFrame Module. You only need to update the iFrame page via javascript. Not perfect but running up until I’ve found a better way.

  • News feed not loading and how not to translate them

    5
    0 Votes
    5 Posts
    3k Views
    A

    Perfect! It works. Thank you very much @chrisfoerg

  • problems with wrong displayed events from google calender

    2
    0 Votes
    2 Posts
    2k Views
    B

    Ok problem solved :-)
    I have set up a new calendar, something was probably a bit strange with the old one …

  • No modules work

    2
    0 Votes
    2 Posts
    2k Views
    C

    your third modules should be between
    },
    and
    ]

    not a second

    modules: [
    {

  • Black screen without error when using MM modules

    3
    0 Votes
    3 Posts
    2k Views
    T

    Issues have been solved: Despite the detailed description I did not place the specific module folders in the “module” folder.
    Works now.

    Thanks a lot - Post can be deleted.

  • News feed not working

    5
    0 Votes
    5 Posts
    3k Views
    A

    I got it!
    But still says it is charging. How can I make so that the news don’t get translated??
    Thanks

  • Advent Module not working for me...?

    8
    0 Votes
    8 Posts
    4k Views
    V

    @lolobyte Got it! Thanks! Wife love it.