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.

    Changing icons of the modules Current Weather and Weather Forecast

    Scheduled Pinned Locked Moved Development
    301 Posts 30 Posters 1.6m Views 33 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.
    • S Offline
      sdetweil @Manu85
      last edited by

      @Manu85 show me a couple entries from you custom.css now

      remember to use the code block

      and the icons ARE in the css/icons folder, correct?
      mine are in css/icons/static , as I unzipped the zip file from your link into the css/icons folder

      .weather .wi-day-sunny {
      content: url("/css/icons/static/day.svg");
      }
      
      .weather .wi-day-cloudy {
      content: url("/css/icons/static/cloudy-day-1.svg");
      }
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        Manu85 @sdetweil
        last edited by

        @sdetweil dans mon custom css j’ai fait ces entrées par exemple (je ne sais pas si c’est ce que vous voulez…):

        /*
         * SONDE DHT 22 temperature interieur
        */
        #dht_temp {
          font-size: 40px;
        
        /*
         * TEMPERATURE CPU
        */
        }
        #pi_temp {
          font-size: 30px;
        }
        
        /*
         * CALENDRIER ICONES AGENDA
        */
        .fa.fa-male {
          color: #2B60DE; /* Dodger Blue */
        }
        .fa.fa-birthday-cake {
          color: #ff0000; /* Red */
        }
         
        .fa.fa-trash-o {
          color: #00FF00; /* Green */
        }
        
        .fa.fa-calendar {
          color: #F660AB; /* Hot Pink */
        
        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @Manu85
          last edited by

          @Manu85 well, I meant the css info for the icons for weather

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            Manu85 @sdetweil
            last edited by

            @sdetweil ah ok here are the entries in my custom css file for the weather, is this what you want?

            .weather .wi-day-sunny {
            content: url(“/css/icons/day.svg”);
            }
            
            .weather .wi-day-cloudy {
            content: url(“/css/icons/cloudy-day-1.svg”);
            }
            
            .weather .wi-rain {
            content: url(“/css/icons/rainy-6.svg”);
            }
            
            .weather .wi-night-clear {
            content: url(“/css/icons/night.svg”);
            }
            
            .weather .wi-night-cloudy {
            content: url(“/css/icons/cloudy-night-2.svg”);
            padding-right: 15px;
            padding-top: 10px;
            }
            
            .weather .wi-cloudy {
            content: url(“/css/icons/cloudy.svg”);
            }
            
            .weather .wi-showers {
            content: url(“/css/icons/rainy-7.svg”);
            }
            
            .weather .wi-thunderstorm {
            content: url(“/css/icons/thunder.svg”);
            }
            
            .weather .wi-snow {
            content: url(“/css/icons/snowy-6.svg”);
            }
            
            .weather .wi-cloudy-windy {
            content: url(“/css/icons/cloudy-day-3.svg”);
            }
            
            .weather .wi-night-rain {
            content: url(“/css/icons/rainy-6.svg”);
            }
            
            .weather .wi-night-snow {
            content: url(“/css/icons/snowy-6.svg”);
            }
            
            .weather .wi-night-thunderstorm {
            content: url(“/css/icons/thunder.svg”);
            }
            
            .weather .wi-night-showers {
            content: url(“/css/icons/rainy-7.svg”);
            }
            
            .weather .wi-fog {
            content: url(“/css/icons/cloudy.svg”);
            }
            
            .weather .wi-night-alt-cloudy-windy {
            content: url(“/css/icons/cloudy-night-1.svg”);
            }
            
            /* Aenderungen Wettervorhersage */
            
            .weather .weathericon {
            position: absolute;
            left: 35px;
            z-index: 1;
            margin-top: -30px;
            height: 60px;
            }
            
            .weather .wi-day-sunny {
            content: url(“/css/icons/day.svg”);
            padding-left: 6px;
            padding-top: 5px;
            height: 50px;
            }
            
            .weather .wi-day-cloudy {
            content: url(“/css/icons/cloudy-day-1.svg”);
            }
            
            .weather .wi-rain {
            content: url(“/css/icons/rainy-6.svg”);
            padding-left: 8px;
            padding-top: 5px;
            height: 45px;
            }
            
            .weather .wi-night-clear {
            content: url(“/css/icons/night.svg”);
            }
            
            .weather .wi-night-cloudy {
            content: url(“/css/icons/cloudy-night-2.svg”);
            height: 50px;
            padding-left: 5px;
            padding-top: 7px;
            }
            
            .weather .wi-cloudy {
            content: url(“/css/icons/cloudy.svg”);
            }
            
            .weather .wi-showers {
            content: url(“/css/icons/rainy-7.svg”);
            }
            
            .weather .wi-thunderstorm {
            content: url(“/css/icons/thunder.svg”);
            }
            
            .weather .wi-snow {
            content: url(“/css/icons/snowy-6.svg”);
            }
            
            .weather .wi-cloudy-windy {
            content: url(“/css/icons/cloudy-day-3.svg”);
            height: 45px;
            padding-left: 8px;
            padding-top: 7px;
            }
            
            .weather .wi-night-rain {
            content: url(“/css/icons/rainy-6.svg”);
            padding-left: 8px;
            padding-top: 5px;
            height: 45px;
            }
            
            .weather .wi-night-snow {
            content: url(“/css/icons/snowy-6.svg”);
            }
            
            .weather .wi-night-thunderstorm {
            content: url(“/css/icons/thunder.svg”);
            }
            
            .weather .wi-night-showers {
            content: url(“/css/icons/rainy-7.svg”);
            }
            
            .weather .wi-fog {
            content: url(“/css/icons/cloudy.svg”);
            }
            
            .weather .wi-night-alt-cloudy-windy {
            content: url(“/css/icons/cloudy-night-1.svg”);
            height: 50px;
            padding-left: 5px;
            padding-top: 7px;
            }
            
            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @Manu85
              last edited by

              @Manu85 said in Changing icons of the modules Current Weather and Weather Forecast:

              > content: url(“/css/icons/rainy-6.svg”);
              

              note that the quotes are leaning, not straight up and down

              change like this

              content: url("/css/icons/rainy-6.svg");
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              M 1 Reply Last reply Reply Quote 0
              • M Offline
                Manu85 @sdetweil
                last edited by

                @sdetweil do they have to be like that? because that’s how they were before I modified them with </>
                }

                .currentweather .wi-day-sunny {
                content: url(“/css/icons/day.svg”);
                }

                .currentweather .wi-day-cloudy {
                content: url(“/css/icons/cloudy-day-1.svg”);
                }

                .currentweather .wi-rain {
                content: url(“/css/icons/rainy-6.svg”);

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

                  @Manu85 they ALL must be straight up and down…

                  I was warning you that the copy you did originally had the wrong quote marks

                  they ALL MUST BE ONLY

                  "
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  M 1 Reply Last reply Reply Quote 0
                  • M Offline
                    Manu85 @sdetweil
                    last edited by sdetweil

                    @sdetweil like that ?

                    .currentweather .wi-night-clear {
                    content: url("/css/icons/night.svg");
                    }
                    
                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @Manu85
                      last edited by

                      @Manu85 yes

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      M 3 Replies Last reply Reply Quote 0
                      • M Offline
                        Manu85 @sdetweil
                        last edited by

                        @sdetweil excuse me, I’ll do it right away

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          Manu85 @sdetweil
                          last edited by

                          @sdetweil by putting them straight up and down my weather has the original icons

                          avec guillemets droit.JPG

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            Manu85 @sdetweil
                            last edited by

                            @sdetweil sorry for my mistakes

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              Manu85
                              last edited by

                              Your precious help allowed me to succeed in having the icons on the mirror :-), I added a few lines in the custom to position each icon, for example:
                              .weather .wi-day-sunny {
                              content: url(“/css/icons/day.svg”);
                              padding-left: 60px;
                              padding-top: 7px;
                              height: 50px;
                              }
                              the last thing to do is how to manage the current day icon (position and size) because on the original file there was a part:.currentweather .weathericon { and another part:.weatherforecast .weathericon {
                              Following your help I named everything: .weather .weathericon { so that it works and I think that now it no longer makes a difference between current and forecast and I cannot manage the icon of the current day. Do you have any ideas on how to handle this?
                              Thank you for your valuable help

                              17 01 2024.JPG

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

                                @Manu85 yes the current/forecast are not unique modules now…but mm provides a way to differentiate between two of the same module

                                you can add arbitrary names that are used in the class of the module in the html tree, and then use that class in your custom.css

                                I wish I had thought of the sooner

                                in the config.js for one of the weather modules, showing forecast for instance, after the module name line add

                                    module:"weather",
                                    classes:"forecast",
                                ...
                                ...
                                

                                then in the custom.css, for the icons used in forecast change the primary selector
                                from

                                .weather
                                

                                to

                                .forecast
                                

                                if I had thought of this first, we would have just added the two classes lines in config.js

                                one for currentweather and one for weatherforecast, each on the appropriate weather module instance

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                M 2 Replies Last reply Reply Quote 1
                                • M Offline
                                  Manu85 @sdetweil
                                  last edited by

                                  @sdetweil Ok, I will try, thanks for your help, you are the best:clapping_hands:

                                  1 Reply Last reply Reply Quote 1
                                  • M Offline
                                    Manu85 @sdetweil
                                    last edited by sdetweil

                                    @sdetweil I tried but it doesn’t work, I don’t know if I did things wrong, in config.js I added the line < classes: “current”,’ > I changed forecast to current:

                                    {
                                    			disabled: false,
                                    			module: "weather",
                                    			classes: "current",
                                    			position: "top_right",
                                    			header: "Meteo Ile d'Olonne",
                                    			config: {
                                    				weatherProvider: "openweathermap",
                                    				type: "current",
                                    				location: "Olonne-sur-Mer,France",
                                    				locationID: "2989572", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                                    				apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                                    			}
                                    		},
                                    		
                                    		{
                                    			disabled: false,
                                    			module: "weather",
                                    			position: "top_right",
                                    			header: "Meteo",
                                    			config: {
                                    				weatherProvider: "openweathermap",
                                    				type: "forecast",
                                    				location: "Olonne-sur-Mer,France",
                                    				locationID: "2989572", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                                    				apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                                    				
                                    			}
                                    

                                    then I changed the first part of the lines in my custom ccs by adding current, I send you the first lines, but it doesn’t change anything, the icons are still identical:

                                    /* Aenderungen Wetter Icon */
                                    /* Aenderungen aktuelles Wetter */
                                    
                                    .current .weathericon {
                                      position: absolute;
                                      z-index: 0;
                                      height: 200px;
                                      right: 180px;
                                      margin-top: -65px;
                                    }
                                    
                                    .current .wi-day-sunny {
                                    content: url("/css/icons/day.svg");
                                    padding-left: 60px;
                                    padding-top: 7px;
                                    height: 100px;
                                    }
                                    
                                    .current .wi-day-cloudy {
                                    content: url("/css/icons/cloudy-day-1.svg");
                                    padding-left: 60px;
                                    padding-top: 7px;
                                    height: 100px;
                                    }
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • S Offline
                                      sdetweil
                                      last edited by sdetweil

                                      @Manu85 and you restarted MM, correct?
                                      can u open the developers window, ctrl-shift-i on the browser being used to display MM,

                                      then select the elements tab, and the pointer in the top left corner and move the mouse over the page content til it select all the current weather content, then click

                                      on the right side you will see the css classes used and where they came from
                                      main.css at the bottom and the stck over overrides bottom to top…

                                      strikethru means overridden by some class higher up

                                      in the module css you should see the name current

                                      here is alink to a topic about using the dev window elements tab
                                      https://forum.magicmirror.builders/post/90135

                                      here I used forecast (.forecast in the custom.css) the yellow rectangles mark the content of interest
                                      top left confirms that the the classes: was used
                                      bottom left indicates the icon class to be used
                                      top right shows that icon class, and its source (right edge)
                                      Screenshot at 2024-01-17 10-36-48.png

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

                                      M 1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        Manu85 @sdetweil
                                        last edited by

                                        @sdetweil
                                        I use RealVNC Viewer and when I do ctrl-shift-i I have this window which opens I click at the top left and with my mouse I browse the lines, I have several lines with weather but when I click on them none opens another window
                                        63d8825a-d372-4332-b8f1-54790bb6d94b-image.png

                                        cd91fd68-9f02-48da-be91-a88932d37e57-image.png

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

                                          @Manu85 yes, good

                                          click the arrow pointer in the red box
                                          then move the mouse over the weather content in the left side page, it will select the content as it goes… make sure the entire weather content is selected
                                          then click
                                          mmimage.png

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

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

                                            @Manu85 when its auto selected it will look like this

                                            Screenshot at 2024-01-17 11-06-41.png

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            M 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
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 15
                                            • 16
                                            • 5 / 16
                                            • 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