MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Changing compliments

    Scheduled Pinned Locked Moved Troubleshooting
    49 Posts 9 Posters 43.0k Views 9 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      Stacy
      last edited by

      Totally new to Linux and Magic Mirror. I tried to change a complimenT in the config.js file of the compliment module and I got the error to install a configuration file. I kept my changes in between the double quotes. Am I doing this wrong? Thanks.

      1 Reply Last reply Reply Quote 0
      • cruunnerrC Offline
        cruunnerr
        last edited by cruunnerr

        @Stacy
        you don’t need to change compliments in the config of the module. When u ever update your mirror the changes will be overwrite.

        Just do it in the normal “MagicMirror/config/config.js”

        Your compliments sector should look like this:

                    {
        			module: "compliments",
        			position: "lower_third",
                                config: {
        	                           compliments: {
        		                   anytime: [
        			           "Hey there sexy!"
        		                   ],
        		                   morning: [
        			           "Good morning, handsome!",
        			           "Enjoy your day!",
        			           "How was your sleep?"
        		                   ],
        		                   afternoon: [
        			           "Hello, beauty!",
        			           "You look sexy!",
        			           "Looking good today!"
        		                   ],
        		                   evening: [
        			           "Wow, you look hot!",
        			           "You look nice!",
        			           "Hi, sexy!"
        		                   ]
        	                     }
                               }
        		},
        

        instead of just using “morning, afternoon, evening” u can also use these:

        day_sunny
        day_cloudy
        cloudy
        cloudy_windy
        showers
        rain
        thunderstorm
        snow
        fog
        night_clear
        night_cloudy
        night_showers
        night_rain
        night_thunderstorm
        night_snow
        night_alt_cloudy_windy
        

        just take a look here: https://github.com/MichMich/MagicMirror/tree/master/modules/default/compliments

        S 1 Reply Last reply Reply Quote 1
        • S Offline
          Stacy @cruunnerr
          last edited by

          @cruunnerr Thanks for your reply. That is where I changed the compliment and I got the error message. I am not sure what I am doing wrong.

          lavolp3L 1 Reply Last reply Reply Quote 0
          • cruunnerrC Offline
            cruunnerr
            last edited by

            post your whole config file (hide personal stuff as calendar or APIs) in a code box and i will check.

            Or try it yourself by using www.jshint.com

            1 Reply Last reply Reply Quote 0
            • lavolp3L Offline
              lavolp3 Module Developer @Stacy
              last edited by

              @Stacy you have a synthax error in the config. Just check it by running

              npm run config:check
              

              from the magicmirror directory.
              OR post your compliments part of the config here.

              How to troubleshoot modules
              MMM-soccer v2, MMM-AVStock

              S 1 Reply Last reply Reply Quote 1
              • S Offline
                Stacy @lavolp3
                last edited by

                @lavolp3 after I make changes to config/config.J’s did I save it as the same file or give it a new name?

                S lavolp3L 2 Replies Last reply Reply Quote 0
                • S Offline
                  Stacy @Stacy
                  last edited by

                  @Stacy do I

                  1 Reply Last reply Reply Quote 0
                  • lavolp3L Offline
                    lavolp3 Module Developer @Stacy
                    last edited by

                    @Stacy save it as the same file. But please do not use windows programs like word or wordpad to edit it. They will break the file. In windows you should use e.g. notepad or notepad++. On debian/raspbian you can use whatever you like

                    How to troubleshoot modules
                    MMM-soccer v2, MMM-AVStock

                    S 2 Replies Last reply Reply Quote 0
                    • S Offline
                      Stacy @lavolp3
                      last edited by

                      @lavolp3 thanks. I am using nano.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        Stacy @Stacy
                        last edited by

                        @Stacy so, just to clear, I go to modules folder, then default, then compliments, then compliments.js. to edit?

                        lavolp3L 1 Reply Last reply Reply Quote 0
                        • S Offline
                          Stacy @lavolp3
                          last edited by

                          @lavolp3 so I go to modules, default, compliments, and change it there? I just want to make sure I am in the right folder. Thank u SO much for helping.

                          1 Reply Last reply Reply Quote 0
                          • lavolp3L Offline
                            lavolp3 Module Developer @Stacy
                            last edited by

                            @Stacy No.
                            I thought you had changed the config/config.js file. This is the central MM config file. If there is one synthax error in this file, the mirror won’t load. Post the content of that here without personal info (like API keys or passwords) OR go into the magicmirror folder and do “npm run config:check”, which will tell you where the error is.

                            How to troubleshoot modules
                            MMM-soccer v2, MMM-AVStock

                            S 1 Reply Last reply Reply Quote 0
                            • S Offline
                              Stacy @lavolp3
                              last edited by

                              @lavolp3 so how do I get to the modules to change them?

                              Mykle1M 1 Reply Last reply Reply Quote 0
                              • Mykle1M Offline
                                Mykle1 Project Sponsor Module Developer @Stacy
                                last edited by

                                @Stacy

                                MagicMirror/config/config.js is the file you want to edit.

                                If you edit the actual modules files (which is not recommended) then you risk breaking MM altogether.

                                Create a working config
                                How to add modules

                                1 Reply Last reply Reply Quote 1
                                • D Offline
                                  doubleT Module Developer
                                  last edited by

                                  @Stacy said in Changing compliments:

                                  @lavolp3 so how do I get to the modules to change them?

                                  All the modules get their information from the config.js cruunnerr and Mykle mentioned. You don’t need to change anything in the module folders.

                                  If the module code is broken at the moment, you can rebuild it from – or completely replace it with – the original here if you don’t want to start over again.

                                  This is the basic code for the compliment module to be added/changed/edited in the MagicMirror/config/config.js :

                                      {
                                          module: "compliments",
                                          position: "lower_third",	// This can be any of the regions.
                                                                          // Best results in one of the middle regions like: lower_third
                                          config: {
                                              compliments: {
                                                  anytime: [
                                                      "Hey!",   // properties are followed by commas – most common mistake
                                                      "Hello."  // last property within brackets doesn't get a comma
                                                  ],
                                                  morning: [
                                                      "Hey!"
                                                  ],
                                                  evening: [
                                                      "Hey!"
                                                  ]
                                              }
                                          }
                                      } // add a comma (,) if another module's config is following
                                  

                                  See the comments in the code. The most common mistakes are missing commas or missing brackets.

                                  S 1 Reply Last reply Reply Quote 1
                                  • S Offline
                                    Stacy @doubleT
                                    last edited by

                                    @doubleT So, I am in the directory MagicMirror. I opened nano to the file MagicMirror/config/config.js
                                    I chose the config.js file

                                    I added my city and I’d to the current weat her and weather forecast. I added some compliments as shown above.

                                    When I tried to save I got an error writing to MagicMirror/config/config.js. no such file or directory

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      doubleT Module Developer
                                      last edited by

                                      That’s the correct file.
                                      Try sudo nano MagicMirror/config/config.js if you haven’t used sudo, that gives you advanced rights.

                                      Did you create config.js? I have a suspicion. At the beginning, there’s no config.js, you have to create it. But there’s a sample file.

                                      Let’s check.
                                      You’re in the dir MagicMirror,
                                      cd config change the directory to config
                                      ls list the dir contents. There should be a config.js.sample. If there is also a config.js, ignore the next step.
                                      sudo cp config.js.sample config.js makes a copy of config.js.sample and creates config.js
                                      ls should now show both files.
                                      sudo nano config.js to edit the config.js

                                      S 1 Reply Last reply Reply Quote 1
                                      • Mykle1M Offline
                                        Mykle1 Project Sponsor Module Developer
                                        last edited by

                                        2 cents:

                                        If you are struggling with using the terminal (I did) then I highly recommend that you download any one of the many free text editors for code. I use notepad++ (notepadqq for linux). Using such an editor makes a world of difference when editing MM files. You navigate to the file just as you would on your Windows or Mac (by clicking through your folders) and open the file using the text editor. Make your edits. Save. Done. They color the code, making it easy to see mistakes and they keep track of your brackets and such. They should eliminate your quote problem as well.

                                        Peace

                                        Create a working config
                                        How to add modules

                                        1 Reply Last reply Reply Quote 1
                                        • Mykle1M Offline
                                          Mykle1 Project Sponsor Module Developer
                                          last edited by

                                          This should help you. It’s a pretty damn good tutorial for getting started with your config. :-)

                                          https://forum.magicmirror.builders/topic/4528/how-to-create-a-working-config-for-absolute-beginners

                                          Create a working config
                                          How to add modules

                                          1 Reply Last reply Reply Quote 1
                                          • S Offline
                                            Stacy @doubleT
                                            last edited by

                                            @doubleT First of all, many thanks to everyone helping.

                                            I do have a config.js file, I checked using the tutorial you gave.

                                            This time i used sudo and it atii won’t let me save, but the changes we made earlier are still in the file. They are not showing up in the MM program, though.

                                            Curious.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy