• 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 15.0k 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.
  • M Offline
    Mykle1 Project Sponsor Module Developer @vbloke
    last edited by Oct 29, 2019, 11:49 PM

    @vbloke

    This is right out of my MMM-SunRiseSet module.

    Feel free to use it if you like. :thumbsup:

    // sunrise set to local time using moment
       var sunrise = document.createElement("div");
       sunrise.classList.add("small", "bright", "sunrise");
       sunrise.innerHTML = "Sunrise is at " + moment(SunRiseSet.sunrise).local().format("h:mm a") + " &nbsp &nbsp "
    + "Sunset is at " + moment(SunRiseSet.sunset).local().format("h:mm a");
       wrapper.appendChild(sunrise);
    

    Create a working config
    How to add modules

    1 Reply Last reply Reply Quote 0
    • P Offline
      pugsly @henry2man
      last edited by Nov 18, 2019, 11:46 PM

      @henry2man
      I am having the same problem, whenever I put it in my config the display is blank.

      S 1 Reply Last reply Nov 18, 2019, 11:47 PM Reply Quote 0
      • S Away
        sdetweil @pugsly
        last edited by Nov 18, 2019, 11:47 PM

        @pugsly not in config… you have to edit the actual module code

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        P 1 Reply Last reply Nov 18, 2019, 11:53 PM Reply Quote 0
        • P Offline
          pugsly @sdetweil
          last edited by Nov 18, 2019, 11:53 PM

          @sdetweil Not sure I know what you mean. When I put this in my config the screen is all blank:

              {
                  module: "MMM-Sunrise-Sunset",
                  position: "top_right",
                  header: "Sunrise",
                  config: {
                      latitude: "39.2907",
                      longitude: "-75.6344",
                      apikey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                      layout: "inline"
                          }
              },
          
          S 2 Replies Last reply Nov 18, 2019, 11:58 PM Reply Quote 0
          • S Away
            sdetweil @pugsly
            last edited by Nov 18, 2019, 11:58 PM

            @pugsly open the developers window on your blank screen MM, using ctrl-shift-i on the keyboard… select the tab labeled console and scroll up to find any errors

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            P 1 Reply Last reply Nov 19, 2019, 12:01 AM Reply Quote 0
            • P Offline
              pugsly @sdetweil
              last edited by Nov 19, 2019, 12:01 AM

              @sdetweil

              Uncaught ReferenceError: $ is not defined
              at Class.updateSun (MMM-Sunrise-Sunset.js:33)
              at Class.start (MMM-Sunrise-Sunset.js:12)
              at startModules (loader.js:55)
              at loader.js:40
              at HTMLLinkElement.stylesheet.onload (loader.js:200)

              S 1 Reply Last reply Nov 19, 2019, 12:07 AM Reply Quote 0
              • S Away
                sdetweil @pugsly
                last edited by sdetweil Nov 19, 2019, 12:10 AM Nov 19, 2019, 12:07 AM

                @pugsly said in MMM-Sunrise-Sunset:

                Uncaught ReferenceError: $ is not defined

                this module depends on jquery library being installed for this module, but its not…,

                I am working on instructions for you… hang on

                do

                cd ~/MagicMirror/modules/MMM-Sunrise-Sunset
                npm install jquery
                # note the trailing dot (.) on the next line
                cp node_modules/jquery/dist/jquery.js .
                

                then start your mirror again

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                P D 2 Replies Last reply Nov 19, 2019, 12:17 AM Reply Quote 0
                • P Offline
                  pugsly @sdetweil
                  last edited by Nov 19, 2019, 12:17 AM

                  @sdetweil said in MMM-Sunrise-Sunset:

                  cp node_modules/jquery/dist/jquery.js .

                  Slightly better, its displaying now but just says ‘Loading’

                  S 1 Reply Last reply Nov 19, 2019, 12:19 AM Reply Quote 0
                  • S Away
                    sdetweil @pugsly
                    last edited by Nov 19, 2019, 12:19 AM

                    @pugsly ok, open the developers window again

                    this usually means that the api key is wrong … the api isn’t returning data

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    P 1 Reply Last reply Nov 19, 2019, 12:25 AM Reply Quote 0
                    • P Offline
                      pugsly @sdetweil
                      last edited by Nov 19, 2019, 12:25 AM

                      @sdetweil
                      Its not passing the API key in the HTML request.

                      https://api.ipgeolocation.io/astronomy?apiKey=&lang=en&lat=39.2907&long=-75.6344 401

                      P 1 Reply Last reply Nov 19, 2019, 12:27 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 3 / 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