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.

    remoteFile in compliments module

    Scheduled Pinned Locked Moved Troubleshooting
    71 Posts 14 Posters 88.3k Views 15 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.
    • schlachtkreuzer6S Offline
      schlachtkreuzer6 @bhepler
      last edited by schlachtkreuzer6

      @bhepler okay a bit weird^^ anyway thank you! It worked perfecly!
      @Steff the config above :)

      1 Reply Last reply Reply Quote 0
      • R Offline
        roramirez Core Contributors @bhepler
        last edited by

        @bhepler said in remoteFile in compliments module:

        I’m going to work on this a bit and hopefully the next release of the MirrorMirror software will be a bit more friendly. As an aside, I’ve noticed that the weather integration technique continually adds to the arrays. So the memory usage will grow and grow at whatever frequency you set the compliment refresh. This isn’t terrible, as straight text doesn’t take a whole lot of memory. But it may have unintended effects if you leave your mirror running for months at a time or if you are expecting a true randomization of the compliments you enter.

        Hi, when I worked in this feature I remember was a flashing about this.

        If you can help how improved this is welcome :)

        Easy module development with MagicMirror Module Template

        J 1 Reply Last reply Reply Quote 0
        • SnilleS Offline
          Snille Module Developer
          last edited by

          Hi! I’m using a separate compliments file (for each user). I’ve noticed that when I use non english characters they are not shown correctly.
          The complement in the picture should say: “Tänk positivt”.
          Now it says:
          0_1485080075531_charaters.png

          If I don’t use a compliments file and put the compliments directly in the config, it works fine.

          What to do? :)

          Best regards Snille

          If you cant find it, make it and share it!
          Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

          strawberry 3.141S 1 Reply Last reply Reply Quote 0
          • strawberry 3.141S Offline
            strawberry 3.141 Project Sponsor Module Developer @Snille
            last edited by

            @Snille did you save the compliments file as utf8 encoded?

            Please create a github issue if you need help, so I can keep track

            SnilleS 1 Reply Last reply Reply Quote 1
            • SnilleS Offline
              Snille Module Developer @strawberry 3.141
              last edited by

              @strawberry-3.141 I had not, now I did and it works! :)
              Thank you!

              If you cant find it, make it and share it!
              Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

              1 Reply Last reply Reply Quote 0
              • J Offline
                jm @roramirez
                last edited by

                @roramirez Is there already a solution for the memory ‘bug’?

                R 1 Reply Last reply Reply Quote 0
                • R Offline
                  roramirez Core Contributors @jm
                  last edited by

                  @jm What memory bug? I’ve don’t touch nothing there. @bhepler said about the improvement

                  If you can help with this the Pull Requests are welcome :)

                  Easy module development with MagicMirror Module Template

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jm @roramirez
                    last edited by

                    @roramirez I meant this comment:

                    “As an aside, I’ve noticed that the weather integration technique continually adds to the arrays. So the memory usage will grow and grow at whatever frequency you set the compliment refresh. This isn’t terrible, as straight text doesn’t take a whole lot of memory. But it may have unintended effects”

                    I don’t know whether to call this a bug, but you get my point ;) I’m not an experienced coder whatsoever, so I doubt I might be of help, but I am always willing to test / assist.

                    strawberry 3.141S 1 Reply Last reply Reply Quote 0
                    • strawberry 3.141S Offline
                      strawberry 3.141 Project Sponsor Module Developer @jm
                      last edited by

                      @jm I can’t see that this is still happening on the current code base. Every time it tries to update an array will be generated with all possible values, after that the garbage collector will do his job and delete the array after usage.

                      Please create a github issue if you need help, so I can keep track

                      1 Reply Last reply Reply Quote 1
                      • Z Offline
                        ZtM
                        last edited by

                        Here is how I got the remote file compliments to work:

                        1. The config.js settings must name the remote file with no path:
                        		{
                        			module: 'compliments',
                        			position: 'bottom_bar',
                        			config: {
                        				remoteFile: 'compliments.json'
                        			}
                        		},        
                        

                        IMO it would be great if it were possible to put a full path the the remote file so it can be stored in the config directory.

                        1. Create a compliments.json file and be sure to put double quotes around the array names like so:
                        {
                        	"morning" : [
                        		"You're good enough, you're smart enough and doggone it, people like you!"
                        	],
                        	"afternoon" : [
                        		"Yes those jeans make you look fat."
                        	],
                        	"evening" : [
                        		"Please put on some pants."
                        	]
                        }
                        
                        
                        1. Put the remote file (compliments.json) into the ~/MagicMirror/modules/default/compliments directory.

                        2. Restart MM. It will show the default compliment (usually “Hi Sexy”) for the first interval and then will start showing compliments from the external file.

                        Hope this helps

                        1 Reply Last reply Reply Quote 2
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 6
                        • 7
                        • 8
                        • 8 / 8
                        • 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