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

Compliments not displaying



  • Hi,
    I am totally new to the programming world and was wondering if I could get some instruction on how to add compliments to magic mirror.
    This is what i’ve got in my config file

    {
            module: 'compliments',
            position: 'lower_third',
            config: {
                    updateInterval: 30000,
                    compliments: {
                            morning: [
                            'Good morning, sunshine!'
                                            ],
                            afternoon: [
                           'Looking good today!'
                                            ],
                            evening: [
                                    'Wasn't the sunset beautiful?',
                                    'You look nice!'
                                    ]
                            }
                    }
            },
    

    Magic Mirror starts up fine but compliments never show, have I messed something up?



  • @jin just put this in your config.js:

                  {
    			module: 'compliments',
    			position: 'lower_third'
    		},
    


  • Compliments not working for me either. On Raspberry Pi Zero W running Jesse Lite. Used Wieber’s guide to get it running (https://forum.magicmirror.builders/topic/1183/how-i-got-my-magic-mirror-working-on-a-raspberry-pi-0-zero).

    By default 'compliments" file does not output to the MM although all other default modules working.
    @cowboysdude : the default config.js is set up the way you described and it still does not work.

    Also edited config.js to place config: { compliments… and manually install compliments similar to what @jin has done but still no output on the MM.

    No errors or crashes and the later modules after compliments still work.



  • You guys would need to post your entire config.js file minus any KEYS you have in there…



  • @jin you either have to escape your single quote inside the string or use double quotes

    evening: [
      'Wasn\'t the sunset beautiful?',
      'You look nice!'
    ]
    
    evening: [
      "Wasn't the sunset beautiful?",
      'You look nice!'
    ]
    


  • thanks for the replys guys
    @cowboysdude it still doesnt show any compliments

    /* Magic Mirror Config Sample
     
    *
     
    * By Michael Teeuw http://michaelteeuw.nl
     
    * MIT Licensed.
     */
    
    
    
    var config = {
    
    	port: 8080,
    
    	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
    
    
    	language: 'en',
    
    	timeFormat: 24,
    
    	units: 'metric',
    
    
    
    	modules: [
    
    		{
    
    			module: 'alert',
    
    		},
    
    		{
    
    			module: "updatenotification",
    
    			position: "top_bar"
    
    		},
    
    		{
    
    			module: 'clock',
    
    			position: 'top_left'
    
    		},
    
    		{
    
    			module: 'calendar',
    
    			header: 'UK Holidays',
    
    			position: 'top_left',
    
    			config: {
    
    				calendars: [
    
    					{
    
    						symbol: 'calendar-check-o ',
    
    						url: 'webcal://www.calendarlabs.com/templates/ical/UK-Holidays.ics'
    
    					},
    
    					{
    
    						url: 'https://calendar.google.com/calendar/ical/private/basic.ics'
    
    					}
    
    				]
    
    			}
    
    		},
    
    		{
    			module: 'compliments',
    			position: 'bottom_center',
    			config: {
    				updateInterval: 30000,
    				compliments: {
    					morning: [
    					'Good morning, sunshine!'
    					],
    					afternoon: [
    					'Looking good today!'
    					],
    					evening: [
    					'Wasn\'t the sunset beautiful?',
    					'You look nice!'
    					]
    				}
    			}
    		},
    
    		{
    
    			module: 'currentweather',
    
    			position: 'top_right',
    
    			config: {
    
    				location: 'New York',
    
    				locationID: '2643741',  //ID from http://www.openweathermap.org
    
    				appid: 'removed'
    
    			}
    
    		},
    
    		{
    
    			module: 'weatherforecast',
    
    			position: 'top_right',
    
    			header: 'Weather Forecast',
    
    			config: {
    
    				location: 'New York',
    
    				locationID: '2643741',  //ID from http://www.openweathermap.org
    
    				appid: 'removed'
    
    			}
    
    		},
    
    		{
    
    			module: 'newsfeed',
    
    			position: 'bottom_bar',
    
    			config: {
    
    				feeds: [
    
    					{
    
    						title: "BBC News",
    
    						url: "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml"
    
    					}
    
    				],
    
    				showSourceTitle: true,
    
    				showPublishDate: true
    
    			}
    
    		},
    
    	]
    
    
    };
    
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    
    if (typeof module !== 'undefined') {module.exports = config;}
    
    

    this is the whole config file.



  • @jin the config looks good, I’m receiving the compliments with this. Can you check for errors in the electron console (npm start dev)? and the terminal?

    0_1489146784290_example.PNG



  • @strawberry-3.141
    This is the log file when I run: npm start dev

    0 info it worked if it ends with ok
    1 verbose cli [ ‘/usr/local/bin/node’, ‘/usr/local/bin/npm’, ‘start’, ‘dev’ ]
    2 info using npm@2.14.7
    3 info using node@v4.2.1
    4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
    5 info prestart magicmirror@2.1.0
    6 info start magicmirror@2.1.0
    7 verbose unsafe-perm in lifecycle true
    8 info magicmirror@2.1.0 Failed to exec start script
    9 verbose stack Error: magicmirror@2.1.0 start: electron js/electron.js "dev"
    9 verbose stack spawn ENOENT
    9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:17:16)
    9 verbose stack at emitTwo (events.js:87:13)
    9 verbose stack at ChildProcess.emit (events.js:172:7)
    9 verbose stack at maybeClose (internal/child_process.js:818:16)
    9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
    10 verbose pkgid magicmirror@2.1.0
    11 verbose cwd /home/pi/MagicMirror
    12 error Linux 4.4.50+
    13 error argv “/usr/local/bin/node” “/usr/local/bin/npm” “start” "dev"
    14 error node v4.2.1
    15 error npm v2.14.7
    16 error file sh
    17 error code ELIFECYCLE
    18 error errno ENOENT
    19 error syscall spawn
    20 error magicmirror@2.1.0 start: electron js/electron.js "dev"
    20 error spawn ENOENT
    21 error Failed at the magicmirror@2.1.0 start script ‘electron js/electron.js “dev”’.
    21 error This is most likely a problem with the magicmirror package,
    21 error not with npm itself.
    21 error Tell the author that this fails on your system:
    21 error electron js/electron.js "dev"
    21 error You can get their info via:
    21 error npm owner ls magicmirror
    21 error There is likely additional logging output above.
    22 verbose exit [ 1, true ]

    sorry, I’m also new to programming. Any ideas for next step?



  • @strawberry-3.141 all i get when i run npm start dev is

    > magicmirror@2.1.0 start /home/pi/MagicMirror
    >electron js/electron.js "dev"
    

    no log file or anything



  • Probably not a coincidence, but both @jin and I are using raspberry pi zero ‘W’ with midori as our browser.