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.

    MMM Compliments

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    6 Posts 3 Posters 1.8k Views 2 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.
    • K Offline
      Kollen
      last edited by

      Hello everybody,
      my MagicMirror is running very well and now I wanted to adjust the compliments a bit.
      I made compliments for different times of the day, but the times I have chosen are ignored. Where do I have to copy this that it works “right”? :-)

                   {
                              module: "compliments",
                              position: "lower_third",
                              config: {
                                         updateInterval: "90000",
                                         morningStartTime: "3",
                                         morningEndTime: "12",
                                         afternoonStartTime: "16",
                                         afternoonEndTime: "20",
                                         eveningStartTime: "20",
                                         eveningEndTime: "23",
                                         compliments: {
                                         anytime: [
                                         "Hey there sexy!",
                                         "Beauty!",
                                         "20.09.2019 what a Day!",
                                         "On a scale from 1 to 10, you're an 15!",
                                         "You`re like sunshine on a rainy day",
                                         "You`re wonderful",
                                         "You, me -home!",
                                         "8000 Watt -immer großes Blatt!",
                                         "I could just hang here all day!",
                                         "Let me high five you \nIN THE FACE!",
                                         "Lorem ipsum"
                                         ],
                                         morning: [
                                         "Good morning, handsome!",
                                         "Enjoy your day!",
                                         "How was your sleep?",
                                      "Start your day!",
                                         "Gude!",
                                         "Start your day with a \nsmile!",
                                         "Jetzt erstmal Kaffee!"  
                                         ],
                                         afternoon: [
                                         "Hello, beauty!",
                                         "You look sexy!",
                                         "Looking good today!",
                                         "Hard day at work, wasn`t it?",
                                         "Gude!",
                                         "Sit down for a sec",
                                         "Durchatmen Krone richten \n weiter machen!",
                                         "For every kiss you give me \nI will give you three!" 
                                         ],
                                         evening: [
                                         "Wow, you look hot!",
                                         "You look nice!",
                                         "Hi, sexy!",
                                         "Let the evening \nbe-GIN",
                                         "Gude!",
                                         "Time for some \nBunga Bunga!",
                                         "Night Owl!" 
                                         ]
                                   }
                             }
                      },
      
      1 Reply Last reply Reply Quote 0
      • brobergB Offline
        broberg Project Sponsor
        last edited by broberg

        @Kollen

        You don’t use the " marks around the numbers.

        so :

        updateInterval: 90000,
        morningStartTime: 3,
        morningEndTime: 12,
        afternoonStartTime: 16,
        afternoonEndTime: 20,
        eveningStartTime: 20,
        eveningEndTime: 23,
        
        1 Reply Last reply Reply Quote 0
        • K Offline
          Kollen
          last edited by

          @broberg OMG I will try ASAP that it was so easy I would not have thought! Thank you for the quick help!

          1 Reply Last reply Reply Quote 0
          • K Offline
            Kollen
            last edited by

            hmm i just changed it from " " to , after the numbers, after a reboot i got a message for afternoon, so it showed no changes.
            Do I have to change anything?

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

              @Kollen the code says

              if current hour is between morning start/end, then use from morning list
              else if current hour is between afternoon start/end then use afternoon list,
              else use evening list if present

              the default times are

                              morningStartTime: 3,
              		morningEndTime: 12,
              		afternoonStartTime: 12,
              		afternoonEndTime: 17
              
              	if (hour >= this.config.morningStartTime && hour < this.config.morningEndTime && this.config.compliments.hasOwnProperty("morning")) {
              			compliments = this.config.compliments.morning.slice(0);
              		} else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) {
              			compliments = this.config.compliments.afternoon.slice(0);
              		} else if(this.config.compliments.hasOwnProperty("evening")) {
              			compliments = this.config.compliments.evening.slice(0);
              		}
              

              it then adds the current weathertype
              it then adds the anytime list
              then takes a random selection of all those

              what time was it when u tested?

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • brobergB Offline
                broberg Project Sponsor
                last edited by

                Looking at the code you only have morning start and end, and afternoon start and end.

                so eveningStartTime & eveningEndTime does nothing.

                So basically the time between afternoonEndTime and morningStartTime is considered evening.
                Anything put in anytime-compliments will be shown regardless of time.

                So if you really want to test it then remove the compliments from anytime and just run 2 morning, 2 afternoon and 2 evening compliments (alter the times you see it change)

                
                             {
                                        module: "compliments",
                                        position: "lower_third",
                                        config: {
                                                   updateInterval: 90000,
                                                   morningStartTime: 14,
                                                   morningEndTime: 15,
                                                   afternoonStartTime: 15,
                                                   afternoonEndTime: 16,
                                                   compliments: {
                                                   anytime: [
                                                   "anytime",
                                                   ],
                                                   morning: [
                                                   "morning1",
                                                   "morning2",
                                                   ],
                                                   afternoon: [
                                                   "afternoon1",
                                                   "afternoon2",
                                                   ],
                                                   evening: [
                                                   "evening1",
                                                   "evening2",
                                                   ]
                                             }
                                       }
                                },
                
                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