• 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.

Standard Weather Module showing unwanted header

Scheduled Pinned Locked Moved Solved Troubleshooting
11 Posts 3 Posters 231 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.
  • R Offline
    rkorell
    last edited by rkorell Mar 30, 2025, 8:05 AM Mar 30, 2025, 8:04 AM

    Hi Team,
    may there a specialist for the standard weather module who can lead me in right direction…
    It was disappeared for a while but re-introduces for unknown reasons:
    The weather module displays a “standard” header (Location name) despite my personal config.js setting (see below).
    I do have two instances of the module - as many others I guess - one current (classes: weather_current), one forecast (classes: weather_forecast).
    The error is neither consistent nor reproducable:
    Sometimes one of the instances shows a header, sometimes both, sometimes none of them.
    The view is inconsistent, too for (HDMI attached) monitor and browser view!

    And while playing around with custom CSS for this module I’ve identified that setting

    .weather_current .module-header 
     {
    border-bottom-width: 3;
    }
    

    in custom.css makes the module disappearing completely.

    The weather module configuration in config.js is as follows:

    // Wetter aktuell für Müllenborn		
    
    		{
    			module: "weather",
    			disabled: false,
    			position: "top_right", 
                header: "",
                classes: "weather_current", 
    			config: {
    				weatherProvider: "openmeteo",
    				type: "current",
    				lat: 50.24127,
    				lon: 6.61174403,
    				onlyTemp: true, // zeigt nur die temp und icon, kein wind kein gar nix :-) 
    				showSun: false,
    				appendLocationToHeader: false,
    				showFeelsLike: false,
    			}
    		},
    
    
    // Wettervorhersage - 
    
    		{
    			module: "weather",
    			position: "top_right",
    			disabled: false,
    			header: "",
    			classes: "weather_forecast",
    			config: {
    				weatherProvider: "openmeteo",
    				type: "forecast",
    				lat: 50.24127,
    				lon: 6.6174403,
    				appendLocationToHeader: false,				
    
    			}
    		}, 
    
    
    

    currently I have “solved” this with two entries in custom.css:

    .weather_current .module-header 
     {
    color: black;
    border-bottom-width: 0;
    border-bottom-color: black;
    }
    
    .weather_forecast .module-header 
     {
    color: black;
    border-bottom-width: 0;
    border-bottom-color: black;
    }
    
    

    But this is kind of unsatisfactory …

    I guess there is a bug in the module - what do you think?

    Thanks and regards,
    Ralf

    K 1 Reply Last reply Mar 30, 2025, 10:41 AM Reply Quote 0
    • R Offline
      rkorell @sdetweil
      last edited by Mar 30, 2025, 7:57 PM

      @sdetweil said

      appendLocationNameToHeader: false,
      

      Yeah.
      OK, already found this…

      Regards,
      Ralf

      1 Reply Last reply Reply Quote 0
      • K Offline
        karsten13 @rkorell
        last edited by Mar 30, 2025, 10:41 AM

        @rkorell said in Standard Weather Module showing unwanted header:

        appendLocationToHeader

        read the docs, there is no property with above name …

        R 3 Replies Last reply Mar 30, 2025, 11:56 AM Reply Quote 0
        • R Offline
          rkorell @karsten13
          last edited by Mar 30, 2025, 11:56 AM

          @karsten13 OK, have found this as part of an if clause and as member of defaut configuration in module code.
          If this causes the unwanted behaviour: sorry!

          Thanks.
          Ralf

          1 Reply Last reply Reply Quote 0
          • R Offline
            rkorell @karsten13
            last edited by Mar 30, 2025, 12:01 PM

            @karsten13 nope :-(
            Deleting “appendLocationToHeader” doesn’t resolve the issue…
            One of the headers (in this case weather_forecast instance) immediatly shows up if I disable the blackness of text/border-bottom …

            Regards,
            Ralf

            1 Reply Last reply Reply Quote 0
            • R Offline
              rkorell @karsten13
              last edited by Mar 30, 2025, 12:14 PM

              @karsten13 said in Standard Weather Module showing unwanted header:

              there is no property with above name

              the part of module code I’ve meant is obvioulsy doing something wrong:
              getHeader is “explained” as “// Override getHeader method.”

              	getHeader () {
              		if (this.config.appendLocationNameToHeader && this.weatherProvider) {
              			if (this.data.header) return `${this.data.header} ${this.weatherProvider.fetchedLocation()}`;
              			else return this.weatherProvider.fetchedLocation();
              		}
              
              		return this.data.header ? this.data.header : "";
              	},
              

              I’ve simply replaced this with

              
              getHeader () {
              		return "";
              	},
              
              

              And - no surprise - header disappears.

              Regards,
              Ralf

              R 1 Reply Last reply Mar 30, 2025, 12:16 PM Reply Quote 0
              • R Offline
                rkorell @rkorell
                last edited by Mar 30, 2025, 12:16 PM

                @rkorell OK, just seen at least one other mistake:
                I’ve picked “appendLocationToHeader” but this should be “appendLocationNameToHeader” …

                R 1 Reply Last reply Mar 30, 2025, 12:25 PM Reply Quote 0
                • R Offline
                  rkorell @rkorell
                  last edited by rkorell Mar 30, 2025, 12:25 PM Mar 30, 2025, 12:25 PM

                  @karsten13 ,
                  yupp this seems to do the trick.
                  undoing code changes and adding

                  appendLocationNameToHeader: false,
                  

                  to weather config let the header disappear …
                  Thanks!

                  Ralf

                  (not understood why and how but at least this way the header lines are really not present - the blackness idea makes them invisible but they still occupy room.)

                  S 1 Reply Last reply Mar 30, 2025, 1:32 PM Reply Quote 0
                  • S Offline
                    sdetweil @rkorell
                    last edited by sdetweil Mar 30, 2025, 1:34 PM Mar 30, 2025, 1:32 PM

                    @rkorell the old weather api returned the location Name, and someone decided to show it in the MagicMirror module header field

                    but you can disable this function by setting the config property to false (default true)

                    the v3 api does NOT return the location Name, so you need to set the property to false AND YOU have to set the header manually
                    header:“…”, after the module:“weather”,

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    R 1 Reply Last reply Mar 30, 2025, 4:55 PM Reply Quote 0
                    • R Offline
                      rkorell @sdetweil
                      last edited by Mar 30, 2025, 4:55 PM

                      @sdetweil said

                      by setting the config property to false (default true)

                      Dear Sam,
                      Thanks for this.
                      Which one of the config properties are you referencing to?
                      I‘ve set

                      header: „“
                      

                      This definitely doesn‘t work because it‘s overwritten somewhere
                      .
                      Regards,
                      Ralf

                      S 1 Reply Last reply Mar 30, 2025, 5:22 PM Reply Quote 0
                      • S Offline
                        sdetweil @rkorell
                        last edited by Mar 30, 2025, 5:22 PM

                        @rkorell said in Standard Weather Module showing unwanted header:

                        Which one of the config properties are you referencing to?

                        appendLocationNameToHeader: false,
                        

                        and for header

                        {
                             module:"weather",
                             header:"something",
                             position:
                             config: {
                               ...
                             }
                        }
                        

                        all of these properies belong to MagicMirror, same for every module
                        https://docs.magicmirror.builders/modules/configuration.html#module-configuration

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        R 1 Reply Last reply Mar 30, 2025, 7:57 PM Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        1 / 2
                        • First post
                          4/11
                          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