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 Development
    17 Posts 10 Posters 21.3k 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.
    • ? Offline
      A Former User
      last edited by

      I am totally new to the programming world and was wondering if I could get some instruction on how to change the compliments module to reflect personalized statements. Do I have to change the .css file? How is this done? Also do/can I change the config.js.sample file to reflect these changes for future installations?

      bheplerB 1 Reply Last reply Reply Quote 0
      • bheplerB Offline
        bhepler Module Developer @Guest
        last edited by

        @artworks79 Sure, no problem.
        For starters, you probably copied the config.js.sample file to config.js to get you started. That’s great, as the config.js file is what the Magic Mirror software reads in order to arrange and configure the various modules. For future installations, I recommend making a local copy of the config.js file and then dropping that in your new mirrors.

        In the config.js file, you’ll see an entry for the compliments module that tells the system which module to load (compliments), where to place it and what configuration values to pass into the module (config: {...}). This part of the config.js file modifies how the Magic Mirror software treats the compliments module.

        Inside that config section, you can modify the behavior of the module itself. You can change the update interval or change the compliments themselves. Here’s the one pulled from my config.js.

        {
                module: 'compliments',
                position: 'bottom_center',
                config: {
                        updateInterval: 30000,
                        compliments: {
                                morning: [
                                "Good morning, sunshine!"
                                                ],
                                afternoon: [
                                "It's a pretty day outside. Go play in it!"
                                                ],
                                evening: [
                                        "Wasn't the sunset beautiful?",
                                        "Wasn't the day just spectacular?"
                                        ]
                                }
                        }
                },
        

        Inside the config: {...} section there is a variable called compliments. The value of this variable must be an array, as specified by the morning: structure. Please note that arrays require square brackets. Each compliment must be enclosed in double quotes " and each compliment is separated by a comma. You can have as many compliments as you like in each array. In the compliments:{...} variable you are allowed a morning array, an afternoon array and an evening array. No other array names will have any effect.

        ? V 2 Replies Last reply Reply Quote 1
        • ? Offline
          A Former User @bhepler
          last edited by

          @bhepler Thanks for the assistance. When I get a chance I will definitely give it a try.

          1 Reply Last reply Reply Quote -1
          • V Offline
            VirtualLeonard @bhepler
            last edited by

            @bhepler I have hade a lot of trouble getting compliments to work correctly on my mirror. I then simply copy and pasted your code into my config.js file and I am still having the same issue. When I run Magic Mirror (even when using your exact code) the module only shows “compliments” in a larger font then “module_2_compliments” underneath. I am not sure what I am doing wrong, is this an easy fix?

            MichMichM bheplerB 2 Replies Last reply Reply Quote 0
            • MichMichM Offline
              MichMich @VirtualLeonard
              last edited by

              @VirtualLeonard You probably modified the compliments module. Which is something you shouldn’t do. I suggest you backup you config and reinstall the mirror.

              All customisations should be done using the config.js, you should never need to modify a default module.

              1 Reply Last reply Reply Quote 0
              • bheplerB Offline
                bhepler Module Developer @VirtualLeonard
                last edited by

                @VirtualLeonard Hmm. Give @MichMich 's suggestion a try. Don’t forget that after you reinstall the mirror software you drop your config.js file back into its proper place.

                If that still doesn’t work, either post your config.js file here and let us take a look at it or upload it somewhere such as dropbox so we can try to drop it into our mirrors.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  AAPS
                  last edited by

                  What exactly should the config.js file look like when I try to change the compliments?

                  bheplerB 1 Reply Last reply Reply Quote 0
                  • bheplerB Offline
                    bhepler Module Developer @AAPS
                    last edited by

                    @AAPS See my post in this thread from November 4th. If you compare the code I included to the default entry for the compliments module, it should get you started. The default code is only this:

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

                    Basically, everything I included in the config section on Nov 4th is new code that will modify how the module behaves.

                    1 Reply Last reply Reply Quote 2
                    • M Offline
                      matic55maci
                      last edited by

                      hello,

                      this helped me a lot. I only have one problem left and that’s when I tried to put more than 3 compliments for each part of a day, the mirror didn’t want to show any of compliments. Is there a ways to change the amount of compliments for each part or is it limited to only 3?

                      Thank you

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

                        @matic55maci

                        I think it’s likely that there is an error in the way you added the compliments (formatting?). Post your config for compliments in a code block

                        Create a working config
                        How to add modules

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Algl
                          last edited by

                          Hello
                          is there an option to define compliments in languages other than English ?
                          thanks.

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

                            @algl

                            You can simply add your own compliments in any language you want and they will appear as you enter them.

                            Create a working config
                            How to add modules

                            O 1 Reply Last reply Reply Quote 1
                            • O Offline
                              orbezo @Mykle1
                              last edited by

                              @mykle1 Would you happen to know about special characters?
                              In the Spanish language, we “open” exclamation and interrogation marks (¡Text! ¿Text?), I’ve typed those characters directly, and they end up as a weird symbol once I run MM, then I tried specifying the encoding table (ISO-8859-1 and/or UTF-8) and it seems I missplaced the code, as MM told me there was no config.js file, then I tried using common HTML code using & # 1 6 1 ; (without spaces) for the “inverted” exclamation mark, and didn’t work either (I got the full “& # 1 6 1 ;” string displaced preceding the compliment’s normal text.

                              Mykle1M ? 3 Replies Last reply Reply Quote 0
                              • Mykle1M Offline
                                Mykle1 Project Sponsor Module Developer @orbezo
                                last edited by

                                @orbezo

                                Sorry, but I don’t know what special characters are available within MM. Perhaps someone else will chime in on that.

                                However, if you have a font that has those special characters, you might then assign that font to the compliments module through your custom.css file.

                                Create a working config
                                How to add modules

                                1 Reply Last reply Reply Quote 0
                                • ? Offline
                                  A Former User @orbezo
                                  last edited by A Former User

                                  @orbezo I think that might be caused by missing characters in Roboto fonts. As I know, Roboto font set with MM is not complete. There are some missed characters. You should install supplements by yourself.

                                  1 Reply Last reply Reply Quote 0
                                  • ? Offline
                                    A Former User @orbezo
                                    last edited by

                                    @orbezo
                                    See this;
                                    https://forum.magicmirror.builders/topic/5406/issue-with-polish-letters-font-missing-diacritical-marks/8

                                    1 Reply Last reply Reply Quote 0
                                    • O Offline
                                      orbezo
                                      last edited by

                                      Thanks everyone for your answers, will read them carefully and follow your advice, will post back soon.

                                      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 / 1
                                      • 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