• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Compliments module | Can you specify a specific date in an external .json file?

Scheduled Pinned Locked Moved Solved Troubleshooting
4 Posts 2 Posters 207 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.
  • M Offline
    morangen
    last edited by Aug 15, 2024, 2:35 AM

    I recently started setting up my first MagicMirror and moved my compliments to an external compliments.json file. In doing so, I found that it works only if I remove any of the date specific messages that I had specified. For example:

    ...
    ],
        "evening": [
            "Ready for bed?"
        ],
        "....-12-24": ["It's a holiday!"]
    }
    

    When a file with these date specific compliments is included, the file doesn’t load and the module defaults to the standard list of compliments.

    In looking around online I found some instances where people seemed to indicate that it was possible, but the vast majority of examples don’t mention doing this.

    Is what I am attempting possible?

    S 1 Reply Last reply Aug 15, 2024, 10:22 AM Reply Quote 0
    • S Offline
      sdetweil @morangen
      last edited by sdetweil Aug 15, 2024, 10:48 AM Aug 15, 2024, 10:22 AM

      @morangen yes, are you forming file correctly

      {
              "anytime": [....],
              "morning":[...],
              "....mmdd": [....]
      }
      

      note that the quote marks must be vertical, and not tilted/curved , as the latter is a word processing symbol which javascript does not understand

      the file contents must be in JSON format, which requires quote marks around all text elements

      this is different than what you would do in config.js

      from the doc
      IMG_0086.png IMG_0087.png

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Aug 16, 2024, 1:01 PM Reply Quote 0
      • M Offline
        morangen @sdetweil
        last edited by Aug 16, 2024, 1:01 PM

        @sdetweil Thanks for the clarification there. I run my MagicMirror on a Synology NAS, and it looks like the editor I am using might be adding the wrong quote characters or something that causes the json validation to fail for some reason.

        I was able to get this working by copying the initial date line that worked. For some reason typing them out was causing the file to not validate and therefore not get loaded.

        Much appreciated.

        S 1 Reply Last reply Aug 16, 2024, 1:20 PM Reply Quote 0
        • M morangen has marked this topic as solved on Aug 16, 2024, 1:01 PM
        • S Offline
          sdetweil @morangen
          last edited by sdetweil Aug 16, 2024, 1:20 PM Aug 16, 2024, 1:20 PM

          @morangen cool, glad you got it working

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            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