MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Modules assistance for MM newbie! Help!



  • Hi,

    Please be gentle as I’m new to the game and I’ve tried to work things out for myself before seeking help. Sadly that point has now come!

    1. Trying to install module: PushBulletNotes. Cloned repository in Modules folder and added configuration block as shown in image below. When starting Mirror I just get a black screen. MagicMirror works fine before adding this config:

    [0_1520248551793_pushbullet.pdf](Uploading 100%)

    1. I’m going for a more ‘grown up’ mirror so the thought of it saying ‘Hi sexy’ isn’t appealing. In the config.js file all it shows is as attachment below. Where do I amend what it’s saying?:

    [0_1520248724921_Compliments.pdf](Uploading 100%)

    1. I have altered the stock weather module to show my location. It shows the temp in fahrenheit rather than celsius which I want. I’ve also noted that it doesn’t show the 5 day forecast on the MagicMirror when running - only today’s weather. Can someone kindly advise on both of these issues? Image to show below:

    [0_1520249023926_Weather.pdf](Uploading 100%)

    Thanks in advance for any assistance!



  • Hey @Fookes,

    Usually the screen going black with config changes means there’s a syntax error crashing the parser. Try pasting it into JSHint.

    For Compliments, see here for the config options. You can either make an object with four arrays in the config, or create a file from which to load them.

    Weather, I’ll have to look. I think the API/feed complains that I cannot use certain forecasts with the free WUndergound account. The same may be happening to you too.

    I can’t see you screenshots. You might instead copy/paste the text into a block quote, like so:

    ````
    // Code goes here
    ````



  • This post is deleted!


  • @ninjabreadman
    Hi, @ninjabreadman - apologies for the delay in responding. I really appreciate your contribution to my queries. Sadly, when I said I was a ‘newbie’ I really meant that I was a newbie! I simply don’t understand some of your answer. ‘Syntax error crashing the parser, try pasting into JSHint’ might as well be written in hieroglyphics. Could you explain in very basic language what I should be doing? I have made slight progress (although I’m unsure how!) on the Pushbullet notifications in so much as the screen is no longer blank and the module displays on my monitor. What it doesn’t do is show any notifications when they come through. It simply says ‘no new notifications’. Here’s (hopefully) how the module is set up. Can you spot anything which is stopping notifications working?

    /{
    module: “PushBulletNotes”,
    header: “iPhone Messages”,
    disabled: false,
    position: “bottom_left”, // Or any valid MagicMirror position.
    config: {
    accessToken: “o.(middle bit left out)i”,
    numberOfNotifications: 5,
    showNotificationIcon: true,
    showMessage: true,
    showCount: true,
    fade: true,
    maxMsgCharacters: 50,
    maxHeaderCharacters: 32
    }
    },
    //

    Thanks in advance!


  • Moderator

    The problem with your code is, as with several other people (mostly on macs) wrong quotation marks.

    {
    module: "PushBulletNotes",
    header: "iPhone Messages",
    disabled: false,
    position: "bottom_left", // Or any valid MagicMirror position.
    config: {
    	accessToken: "o.(middle bit left out)i",
    	numberOfNotifications: 5,
    	showNotificationIcon: true,
    	showMessage: true,
    	showCount: true,
    	fade: true,
    	maxMsgCharacters: 50,
    	maxHeaderCharacters: 32
    	}
    },
    

    Look at the quotation marks. Left is correct, right is using wrong ones. I think this is a problem with Mac keyboard or mac software.
    0_1520525361886_2018-03-08_17-08-50.png



  • Thanks for the response.

    Not that I’m doubting you for a second but wouldn’t that stop other modules working? I have other modules using quotation marks (denoting screen position, header etc) which seem to run without issue.

    Secondly, how would I go about changing these to the correct format as I only have a Mac to use.

    Thank you.


  • Moderator

    That’s a bad question, as I cannot answer that. I don’t have any mac available, so I cannot test it.
    I don’t know if this is an unwanted feature - in this case - of the editor or of the entire operating system. On Windows I use “notepad++”, I’m sure there is something similar for Mac.



  • @yawns It’s usually Macs because they do “smart quote” replacement, including in TextEdit, the default text editor. Straight double quotes (") are different characters from open and close quotes ( or ). Such smart replacement done at a program level on certain word processors, like Microsoft Word, but not in things like Notepad, the default text editor for Windows. This is why it’s more of a problem for Mac users.

    @Fookes The solution is to not use TextEdit (much more like WordPad) for any code. Use a true text editor like Atom, BBEdit, TextMate, etc. Download one, install it, and use that to open/edit/save your config and other code files.



  • @ninjabreadman - thanks for the info. As explained throughout the thread I’m the exact definition of a ‘newbie’. When detailing text editors such as TextEdit, Atom etc, what role do they play in what I am trying to achieve?

    As an example:

    I want to install a TP module I’ve found (as this Pushbullet one is). There is a ‘using this module’ section which tells us to add the following configuration block to the ‘modules’. I have simply been copy and pasting this configuration in to the config.js section and tweaking the parts I can/want to. How and why would I use Atom to do this? Genuine question - I simply have no idea. I’m eager to learn but clearly need basic guidance on this.

    Appreciate it.



  • @Fookes No problem. You need to use a program (app) to open any file. Right now, you’re using what came with your Mac (called TextEdit). But it’s much more of a note taking or word processing program than a text editor for code. It doesn’t understand code, and does things that break it. Once you’ve downloaded and installed Atom (by moving it to your ~/Applications folder on your Mac) you can run it then open the file, or right-click a file and select “Open with…” and choose Atom. Not only will it not break your code, it will colour-code (called “syntax-highlighting”) your code, show you where brackets/braces match, and can help to make your code legible (called “Beautify” in Atom).

    For adding modules, check out this walkthrough for tips: https://forum.magicmirror.builders/topic/4231/how-to-add-modules-for-absolute-beginners