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 19.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.
    • vblokeV Offline
      vbloke Module Developer @mrdenmark
      last edited by

      @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

        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

        vblokeV 1 Reply Last reply Reply Quote 0
        • vblokeV Offline
          vbloke Module Developer @mrdenmark
          last edited by

          @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 Reply Quote 0
          • M Offline
            mrdenmark
            last edited by

            worked,cheers!

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

              @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
              • vblokeV Offline
                vbloke Module Developer
                last edited by

                https://github.com/prydonian/MMM-Sunrise-Sunset

                Made a fairly big update using a different API that needs a free key.
                https://ipgeolocation.io/signup.html

                It now gives you moonrise and moonset times and day length.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  henry2man
                  last edited by

                  I tried this module but activating this causes my MM to show nothing. I had no error messages on MM logs (in my case, a docker server-only instance) and nor on my Chrome console.

                  In other words it looks that the IPGeo free key expires in 1 day…

                  vblokeV pugslyP 2 Replies Last reply Reply Quote 0
                  • vblokeV Offline
                    vbloke Module Developer @henry2man
                    last edited by vbloke

                    @henry2man the API is limited to 1000 calls per day. It doesn’t appear to expire after a day.

                    Can you post the config for the module?

                    it should look like this:

                        {
                          module: "MMM-Sunrise-Sunset",
                          position: "bottom_bar",
                          config: {
                    		apiKey: "API_KEY",
                    		latitude: "123.123",
                    		longitude: "23.456",
                    		layout: "inline"
                          }
                        },
                    
                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      henry2man
                      last edited by

                      I removed the config but seemed like yours. I followed the README from master. I’ll try again later, but also I’ve reviewed this API

                      https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&formatted=0

                      It has enough information and seems to be free.

                      What do you think?

                      vblokeV 1 Reply Last reply Reply Quote 0
                      • vblokeV Offline
                        vbloke Module Developer @henry2man
                        last edited by

                        @henry2man that’s the one I was using before, but it required a lot of work to get the time in your local time zone as all times were returned as UTC.

                        The new API uses your location to format the time automatically.

                        H Mykle1M 2 Replies Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 4
                        • 5
                        • 4 / 5
                        • 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