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.

    mmm-suncalc - Text only display of sunrise, sunset and other sun events

    Scheduled Pinned Locked Moved Utilities
    29 Posts 8 Posters 15.4k Views 8 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.
    • J Offline
      jag
      last edited by paviro

      This module is displaying various times for sun rise, set when it’s at the highest point.
      The displayed message is configurable.

      Calculations are done using SunCalc
      The module can be downloaded from github

      Please give it at try, and give me some feedback.
      [card:janbanan007/mmm-suncalc]

      1 Reply Last reply Reply Quote 1
      • paviroP Offline
        paviro
        last edited by

        Please add some screenshots! :)

        We're all stories in the end. Just make it a good one, eh?

        – The Doctor

        1 Reply Last reply Reply Quote 0
        • J Offline
          jag
          last edited by

          No so much screenshots.
          This is a text only module.
          Using a template, like “Sunrise at , sunset at , highest point at ”
          Will be displayed as “Sunrise at 09:15, sunset at 15:34, highest point at 12:25”.

          Time format is the same as is globally.

          1 Reply Last reply Reply Quote 0
          • paviroP Offline
            paviro
            last edited by

            I see :D It still would be nice to see it in context with a clock for example :)

            We're all stories in the end. Just make it a good one, eh?

            – The Doctor

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

              Hi!
              Thank you for this module! :)
              I can’t get it to change the “text”.
              My config looks like this:

              	{
              		module: "mmm-suncalc",
              		position: "top_left",
              		classes: "default everyone small dimmed",
              		latitude: 56.1171367,
              		longitude: 12.9543434,
              		text: "Soluppgång sunrise, Solnedgång sunset, Solen högst solarNoon, Gryning dusk, Skymmning dawn"
              	},
              

              But the actual screen looks like this:
              0_1484295805906_pic.png

              What am I missing…?

              PS: The example conf on your git repo has one m to too much in the module name and when you “clone” it it’s all in non capitals “mmm-suncalc” (most modules have MMM-Modname). :)

              Obs: had to remove the " > " "< " for the conf to show correct here…

              Thank you.

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

              yawnsY 1 Reply Last reply Reply Quote 0
              • yawnsY Offline
                yawns Moderator @Snille
                last edited by

                {
                module: "mmm-suncalc",
                position: "top_left",
                classes: "default everyone small dimmed",
                config: {
                	latitude: 56.1171367,
                	longitude: 12.9543434,
                	text: "Soluppgång sunrise, Solnedgång sunset, Solen högst solarNoon, Gryning dusk, Skymmning dawn"
                	},
                },
                

                Should work with these settings.

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

                  @yawns Working! :) 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 1
                  • J Offline
                    jag
                    last edited by

                    Thx for downloading and very useful feedback :).
                    Uploaded new version.
                    Added support for css classes.
                    Font size defaults to small.

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      retroflex Project Sponsor Module Developer
                      last edited by retroflex

                      Just found this old module and added it to my mirror. With some unicode and html the result is pretty nice, so I thought I’d share it:

                      0_1542831254681_5c57c520-df2b-48dd-b9b6-266a9d867d37-image.png

                      Ok, in Swedish, but it basically says “The sun… rises: / sets:”. I used dawn-sunrise and sunset-dusk for the time intervals. This gives approximately the time from when it’s almost dark to full day and vice versa.

                      Config:

                      		{
                      			module: 'mmm-suncalc',
                      			position: 'top_left',
                      			header: 'Solen',
                      			config: {
                      				latitude: xx.xxxx,
                      				longitude: xx.xxxx,
                      				text: '<table>' +
                      								'<tr><td>& #9728;</td><td>Går upp:</td><td style="text-align: right">[dawn] - [sunrise]</td></tr>' +
                      								'<tr><td>& #9790;</td><td>Går ner:</td><td style="text-align: right">[sunset] - [dusk]</td></tr>' +
                      							 '</table>'
                      			}
                      		},
                      

                      Note that you need to remove the space between & and # in the config above. It was impossible to write the code in the forum otherwise. Also you need to change [ … ] to < … > for dawn, sunset etc.

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        dankerthrone
                        last edited by

                        Hey, total newbie to everything coding- and mirror-related here. I tried to get suncalc to work while also trying @retroflex 's suggested layout, but whatever I do, nothing ever show’s up on my MM screen. The module just doesn’t do anything. Do I need to also clone the original suncalc repository? Where to, if so?

                        So far, what I got is this:

                        {
                        			module: 'mmm-suncalc',
                        			position: "lower_third",
                        			//classes: "default everyone small dimmed",
                        			header: "Sonne",
                        			config: {
                        				latitude: 51.03586,
                        				longitude: 7.06379,
                        				text: "Aufgang: <dawn> - <sunrise>. Untergang: <sunset> - <dusk>"
                        				//'<table>' + 
                        				//'<tr><td>&#9728;</td><td>Går upp:</td><td><dawn> - <sunrise></td></tr>' +
                        				//'<tr><td>&#9790;</td><td>Går ner:</td><td><sunset> - <dusk></td></tr>' +
                        				//'</table>'
                        				},
                        		},
                        

                        Does that look alright?

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @dankerthrone
                          last edited by

                          @dankerthrone the module is on github

                          https://github.com/janbanan007/mmm-suncalc

                          the readme shows a simple start

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 1
                          • D Offline
                            dankerthrone
                            last edited by

                            Thanks. I think in general people know to cd to the module folder to be installed and then run

                            npm install
                            

                            but I didn’t get that from the readme, thus ran the install command from the ~/MagicMirror folder and as a result never installed anything. No wonder the thing doesn’t run :D

                            It does now, though, so thanks again!

                            1 Reply Last reply Reply Quote 0
                            • LordyL Offline
                              Lordy
                              last edited by

                              Hello,

                              can sunrise and sunset be colored, if so, can you please tell me the line (command) for css?

                              R 1 Reply Last reply Reply Quote 0
                              • R Offline
                                retroflex Project Sponsor Module Developer @Lordy
                                last edited by

                                @Lordy There are no css names to distinguish sunrise and sunset. But you can add html directly to the config instead. See my previous answer to this thread for an example. So something like:

                                text: 'Sunrise < span style="color: #ffff00" >< sunrise >< /span >
                                

                                Remove the extra spaces next to the brackets. Had to include them or otherwise the forum would show nothing.

                                LordyL 1 Reply Last reply Reply Quote 1
                                • LordyL Offline
                                  Lordy @retroflex
                                  last edited by

                                  @retroflex
                                  Where exactly? Here my config:

                                  text: ‘

                                  ’+‘’+‘’+‘
                                  ☀Sonnenaufgang: -
                                  ☾Sonnenuntergang: -
                                  ’

                                  LordyL 1 Reply Last reply Reply Quote 0
                                  • LordyL Offline
                                    Lordy @Lordy
                                    last edited by Lordy

                                    Sunrise.JPG

                                    1 Reply Last reply Reply Quote 0
                                    • R Offline
                                      retroflex Project Sponsor Module Developer
                                      last edited by

                                      @Lordy Aha. Then change one of the < td > to < td style=“color: #ffff00” >

                                      LordyL 1 Reply Last reply Reply Quote 1
                                      • LordyL Offline
                                        Lordy @retroflex
                                        last edited by

                                        @retroflex
                                        Thank U,that’s it. :thumbs_up_light_skin_tone:

                                        LordyL 1 Reply Last reply Reply Quote 0
                                        • LordyL Offline
                                          Lordy @Lordy
                                          last edited by Lordy

                                          Corona Screen.JPG

                                          R 1 Reply Last reply Reply Quote 1
                                          • R Offline
                                            retroflex Project Sponsor Module Developer @Lordy
                                            last edited by

                                            @Lordy Great that it worked out! I like the idea, I’ll colorize mine too now.

                                            LordyL 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
                                            • 1 / 2
                                            • 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