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

MMM-Sunrise-Sunset

Scheduled Pinned Locked Moved Utilities
44 Posts 9 Posters 18.3k Views 10 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.
  • V Offline
    vbloke Module Developer
    last edited by vbloke Oct 25, 2019, 9:56 AM Oct 25, 2019, 8:09 AM

    I’ve created a module that displays the local sunrise, sunset and solar noon times. maybe it’ll be useful for people.

    alt text

    alt text

    Any offers to make it better are gratefully received!

    [card:prydonian/MMM-Sunrise-Sunset]

    1 Reply Last reply Reply Quote 3
    • B Offline
      buzzkc
      last edited by Oct 25, 2019, 6:02 PM

      Looks nice. I may add that to my bedside touch screen…Thanks!

      Darren

      My Build: https://forum.magicmirror.builders/topic/11153/new-non-mirror

      1 Reply Last reply Reply Quote 0
      • M Offline
        mrdenmark
        last edited by Oct 25, 2019, 8:28 PM

        just added it,thanks for your work, a couple of issues i found-

        it doesn’t seem to account for southern hemisphere or timezones or something as i get sunrise at 5.36 pm sunset at 7.23 am and solar noon at 12.30 am,also,in my config inline or list makes no difference,-its always inline.
        heres my config-{
        module: “MMM-Sunrise-Sunset”,
        position: “top_left”,
        config: {
        latitude: “-44.57”,
        longitude: “168.50”,
        Layout: “list”,
        }
        },

        V 1 Reply Last reply Oct 25, 2019, 8:43 PM Reply Quote 0
        • V Offline
          vbloke Module Developer @mrdenmark
          last edited by Oct 25, 2019, 8:43 PM

          @mrdenmark it appears that the API doesn’t like the Southern Hemisphere…

          http://api.sunrise-sunset.org/json?lat=-44.57&lng=168.50&date=today

          Is that config exactly as it appears in your config file? layout should be all lowercase.

          M 1 Reply Last reply Oct 25, 2019, 8:55 PM Reply Quote 1
          • M Offline
            mrdenmark @vbloke
            last edited by Oct 25, 2019, 8:55 PM

            @vbloke i changed the config file to lowercase,that fixed the layout
            as for the api?not sure what the options are,i’ll see if i can an alternative,
            thanks for your help

            V 1 Reply Last reply Oct 25, 2019, 8:58 PM Reply Quote 0
            • V Offline
              vbloke Module Developer @mrdenmark
              last edited by Oct 25, 2019, 8:58 PM

              @mrdenmark the API returns all dates in UTC, so I may look at putting a time zone offset option in the config, or if you feel confident doing that yourself, feel free to try.

              1 Reply Last reply Reply Quote 0
              • M Offline
                mrdenmark
                last edited by Oct 25, 2019, 9:01 PM

                would it be possible to add a line with the day length?i’m not sure how to go about adding a time offset,i’ll do some research

                V 1 Reply Last reply Oct 26, 2019, 7:54 AM Reply Quote 0
                • V Offline
                  vbloke Module Developer @mrdenmark
                  last edited by Oct 26, 2019, 7:54 AM

                  @mrdenmark if you update the module now, it should account for the timezone if you set it in your config. From your latitude/longitude, yours (I think) would be “Pacific/Auckland”.

                  Try this:

                  {
                    module: "MMM-Sunrise-Sunset",
                    position: "top_left",
                    config: {
                  	latitude: "-44.57",
                  	longitude: "168.50",
                  	timezone: "Pacific/Auckland",
                  	layout: "list"
                    }
                  },
                  
                  S 1 Reply Last reply Oct 26, 2019, 9:09 PM Reply Quote 0
                  • M Offline
                    mrdenmark
                    last edited by Oct 26, 2019, 9:05 PM

                    worked,cheers!

                    1 Reply Last reply Reply Quote 1
                    • S Online
                      sdetweil @vbloke
                      last edited by Oct 26, 2019, 9:09 PM

                      @vbloke you can get the timezone from the lat/lng

                      http://www.geonames.org/export/web-services.html#timezone

                      https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 1 / 5
                      1 / 5
                      • First post
                        1/44
                        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