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-DarkSkyForecast

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 2 Posters 886 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.
    • E Offline
      efkelly
      last edited by

      Thank you in advance, has anyone configured the sunrise and sunset in the dark sky
      forecast module? I have seen the question asked but cannot find an answer.

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

        I was able to do it, though, I am still learning a lot and how to format it into it’s own area. Right now it just hitches onto the Summary section but it at least shows it. Hopefully it helps.

        https://github.com/jclarke0000/MMM-DarkSkyForecast/issues/13

        E 1 Reply Last reply Reply Quote 0
        • E Offline
          efkelly @smoysauce
          last edited by

          @smoysauce
          Thanks but no joy, I added the following to the MMM.darkskyforecast.js

          var summary;
          if (this.config.concise) {
          summary = this.weatherData.hourly ? this.weatherData.hourly.summary : this.weatherData.currently.summary;
          } else {
          summary = (this.weatherData.minutely ? this.weatherData.minutely.summary : this.weatherData.currently.summary + “.”) + " " +
          (this.weatherData.hourly ? this.weatherData.hourly.summary + " " : “”) +
          (this.weatherData.daily ? this.weatherData.daily.summary : “”) + " | " + "Sunrise: " + moment(new Date(this.weatherData.daily.data[0].sunriseTime * 1000)).format(“LT”) +
          " | Sunset: " + moment(new Date(this.weatherData.daily.data[0].sunsetTime * 1000)).format(“LT”);
          }

          (leaving out the humidity and dew point in the example) now I get the black screen!

          Thank you in advance for any assistance, as you can tell I am a noob.

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

            Did you just add it or did you replace/append the exisiting? If you just added it that won’t work. YOu need to find that section and either replace it or you can append what you want to the end. You also could have removed too much probably missing a comma or semicolon. If you don’t want humidity and dew point you would to the var summary section and use:

                var summary;
                if (this.config.concise) {
                  summary = this.weatherData.hourly ? this.weatherData.hourly.summary : this.weatherData.currently.summary;
                } else {
                  summary = (this.weatherData.minutely ? this.weatherData.minutely.summary : this.weatherData.currently.summary + ".") + " " +  (this.weatherData.hourly ? this.weatherData.hourly.summary + " " : "") + (this.weatherData.daily ? this.weatherData.daily.summary : "") + " | " + "Sunrise: " + moment(new Date(this.weatherData.daily.data[0].sunriseTime * 1000)).format("LT") +
                    " | Sunset: " + moment(new Date(this.weatherData.daily.data[0].sunsetTime * 1000)).format("LT") ;
                }
            

            I would say your best bet is to just go to that section and add + " | " + "Sunrise: " + moment(new Date(this.weatherData.daily.data[0].sunriseTime * 1000)).format("LT") + " | Sunset: " + moment(new Date(this.weatherData.daily.data[0].sunsetTime * 1000)).format("LT") just before the ; at the end.

            E 1 Reply Last reply Reply Quote 0
            • E Offline
              efkelly @smoysauce
              last edited by

              @smoysauce
              Thank you very much it is now working, it had nothing to do with what you had written, I had an error in my config.js, I had inserted showSunriseSunset = true; and that obviously was completely wrong. I removed that line and bingo all is well. Thank you again.

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

                Glad to hear it!

                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 Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy