A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
  • 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
    11k 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
    14k 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
    9k 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
    9k 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
    5k Views
    V
    @lolobyte Got it! Thanks! Wife love it.
  • Lesson plan for 2 daughters

    5
    0 Votes
    5 Posts
    3k Views
    A
    Ahh, thanks. I’d search, but didn’t come across that. I’ll give it a try!
  • Need help with Fitbit module returning all zeroes

    5
    0 Votes
    5 Posts
    3k Views
    F
    @darrene Funny, but I had to change the config to remove the square brackets and replace them with curly brackets around the config parameters to get the config.js file to be accepted: { module: 'MMM-fitbit', position: 'top_center', **config: {** credentials: { client_id: <client_id>, client_secret: <client_secret>, }, resources: [ 'steps', 'floors', 'caloriesOut', 'distance', 'activeMinutes', 'sleep', 'heart' ], update_interval: 60 **}** },
  • JSON to a module? How can you do this?

    10
    1 Votes
    10 Posts
    5k Views
    F
    Actually, found it via the excellent MMM-Remote-Control by Jopyth. Thanks for all your help lol and cowboy