MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Editing core modules

    Troubleshooting
    2
    7
    210
    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.
    • C
      CheapDad last edited by

      Thank you @sdetweil for helping me along. I’m working on editing the core modules to fit the config that I’d like. The problem I’m running into is that despite using the syntax that appears in the documentation, I’m getting errors.

      For example, my weather module is displaying either Kelvin or Celsius and I’d like it to be imperial. According to the documentation, I think all I need to do is add:

      units: “Imperial”,

      to the config file and I should be golden. However, that’s not what’s happened:

      		{
      			module: "weather",
      			position: "top_right",
      			config: {
      				weatherProvider: "openweathermap",
      				type: "current",
      				location: "Gainesville, US",
      				locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
      				apiKey: "663f6e5e85dfb8bf8d3293ab7cc8cbd1"
      				units: "imperial",
      			}
      

      For us super noobs, it might be helpful to have a sample of the config section, where a user can simply delete the lines that they don’t need.

      BTW, I appreciate that will only help a very small subset of users and I’m grateful for the patience you all show us noobs.

      CheapDad

      C 1 Reply Last reply Reply Quote 0
      • C
        CheapDad @CheapDad last edited by CheapDad

        So, I fixed my own problem but created another! For the weather module, I placed the units code and round up code as the first entries in config and it worked! Well, sort of. I do get Fahrenheit and the temperatures are rounded up, except my “feels like” output is 293 degrees!

        Additionally, the time in the current weather field is about 8 hours different than the time in the time module (upper left).

        The code:

        {
        			module: "weather",
        			position: "top_right",
        			config: {
        				units: "Imperial",
        				roundTemp: "True",
        				weatherProvider: "openweathermap",
        				type: "current",
        				location: "Gainesville, US",
        				locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
        				apiKey: "663f6e5e85dfb8bf8d3293ab7cc8cbd1"
        			}
        		},
        		{
        			module: "weather",
        			position: "top_right",
        			header: "Weather Forecast",
        			config: {
        				units: "Imperial",
        				roundTemp: "True",
        				weatherProvider: "openweathermap",
        				type: "forecast",
        				location: "Gainesville, US",
        				locationID: "", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
        				apiKey: "663f6e5e85dfb8bf8d3293ab7cc8cbd1"
        			}
        
        S 2 Replies Last reply Reply Quote 0
        • S
          sdetweil @CheapDad last edited by

          @cheapdad gotta have that locationID

          many authors provide sample config layouts

          not all, and not the base.

          your welcome to edit the doc and submit updates

          Sam

          Create a working config
          How to add modules

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

            @cheapdad also like to correct your words. u are not editing any of the core FILES, you are editing the configuration for the core modules.

            Sam

            Create a working config
            How to add modules

            C 1 Reply Last reply Reply Quote 0
            • C
              CheapDad @sdetweil last edited by

              @sdetweil On the location ID, the documentation indicates that it is not needed if you have “location” entered. If using just “location” without “location ID” is causing the error, then I’ll make the switch. Interestingly, its only the “feels like” that is off. (I figured out the that time difference is sunrise/sunset.)

              On config layouts, I may just do that. Generally, is there any required order of the config lines?

              CheapDad

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

                @cheapdad said in Editing core modules:

                Generally, is there any required order of the config lines?

                no… any order is fine… the modules definitions go inside the

                modules: [ 
                ]
                

                list
                order is fifo (first in, first out)

                by position

                three in the top_left,
                from top of config.js down that is the order they will appear

                Sam

                Create a working config
                How to add modules

                1 Reply Last reply Reply Quote 0
                • C
                  CheapDad last edited by

                  @sdetweil I’ll check that out; thank you!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy