Giter VIP home page Giter VIP logo

mmm-sunriseset's Introduction

MMM-SunRiseSet

More information than you ever wanted to know about the rising and setting of the sun.

The information

  • Sunrise: The actual time the rising sun breaches the horizon.
  • Sunset: The actual time the sun falls completely below the horizon.
  • Solar Noon: The actual time when the sun is at its highest altitude in the sky.
  • Day Length: The length of time between sunrise and sunset.
  • Civil Twilight: The geometric center of the Sun is at most 6 degrees below the horizon.
  • Nautical Twilight: The geometric center of the Sun is between 6 and 12 degrees below the horizon.
  • Astronomical Twilight: The geometric center of the Sun is between 12 and 18 degrees below the horizon.

Examples with static graph

  • MMM-Lunartic in top_left region

  • MMM-SunRiseSet in bottom_left region

Example animation instead of static graph

,

  • Obviously, day or night will move much more slowly

Or animated earth image

  • Updates to show daylight approaching or night approaching

  • Config option to show just animated world or map without the data

Annotated .css file included for aligning and coloring text. css file also used to display as little or as much data as you like.

Installation

  • git clone https://github.com/mykle1/MMM-SunRiseSet into the ~/MagicMirror/modules directory.

  • No API key needed! No dependencies needed! No kidding!

Config.js entry and options

{
	disabled: false,
	module: "MMM-SunRiseSet",
	position: "bottom_left",
	config: {
		lat: "41.111111",      // Your latitude (for the data)
		lng: "-75.111111",     // Your longitude (for the data)
		image: "map",          // "world" (animation), "map" (animation), "static" (graph)
		imageOnly: "no",       // no = all data, yes = only animated world or map
		dayOrNight: "night",   // "night" approaching, "day" approaching (imageOnly: must be "yes", image: must be "world")
		timeFormat: "h:mm a", // Examples: "h:mm a" or "H:mm"
		useHeader: false,      // true if you want a header
		header: "Header",      // useHeader must be true
		maxWidth: "515px",
    }
},

Thanks go to SpaceCowboysDude for UTC and moment advice

Thanks also to Sean and Strawberry for updateDOM guidance

mmm-sunriseset's People

Contributors

mykle1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mmm-sunriseset's Issues

Select Desired Data

This looks like a really nice module. Is it possible to hide / turn off certain parts of the information? For example, if I didn't need the information about twilight and / or the graph.

wrong url for getting map info

Hi,
The url for getting map does not return an image.
"img.src = "http://api.usno.navy.mil/imagery/earth.png?date=today&seed=" + getTimeStamp; "
needs to change to ...

"

  •   var dd = today.date();^M
    
  •   var mm = today.month()+1; //January is 0!^M
    
  •   var yyyy = today.year();^M
    
  •   var GMTtime = today.format("h:mm a");^M
    
  •   if(dd<10){^M
    
  •       dd='0'+dd;^M
    
  •   } ^M
    
  •   if(mm<10){^M
    
  •       mm='0'+mm;^M
    
  •   } ^M
    
  •   var today = mm+'/'+dd+'/'+yyyy;^M
    
  •           img.src = "http://api.usno.navy.mil/imagery/earth.png?date="+today+"&time="+GMTtime;  ^M
    

"

After this change I get the correct image for map.

Thanks!

URL for Map not working again

Saw the other 2 same issues closed so I checked the links and they don't work. Seems the Navy site is shut down. Any thoughts on a new link that would make the map work?
Thx.
Ki

Images not loading

I just installed the module and the images for 'world and ''map" are not loading. "static" works. Is the source they are being pulled from unavailable? Here is my config and a screenshot of what ends up displaying in MM:

{
disabled: false,
module: "MMM-SunRiseSet",
position: "bottom_center",
config: {
lat: "mylat",
lng: "mylng",
image: "world", //"world" (animation), "map" (animation), "static" (graph)
imageOnly: "yes", // no = all data, yes = only animated world or map
dayOrNight: "day", // "night" approaching, "day" approaching (imageOnly: must be "yes", image: must be "world")
useHeader: true, // true if you want a header
header: "Daylight", // useHeader must be true
maxWidth: "515px", //default was 515px
}
},

mmm-sunriseset error

USNO API

Hey, I know you mentioned the USNO API is down and was expected to be completed April 2020, but for me the animated maps are not working. Do you know if there is somewhere that has a status update I can follow? I hate to keep bothering you directly. Thanks.

wrong url for getting map info, again

Hello!
The url for the map does not work for me either, as the other issue that is closed said.

I tryed the proposed change, but it did not get it to work.
Perhaps i made the change in the wrong place.

translations

Spanish translation and files for translations directory,
It will be necessary to change the lines in the file MMM-SunRiseSet.js

On directory /translations/ :

en.json:

{
"Sunrise is at ": "Sunrise is at ",
"Sunset is at ": "Sunset is at ",
"Solar noon is at ": "Solar noon is at ",
"Length of day is ": "Length of day is ",
"Civil twilight begins at ": "The next new moon is ",
"Civil twilight ends at ": "Civil twilight ends at ",
"Nautical twilight begins at ": "Nautical twilight begins at ",
"Nautical twilight ends at ": "Nautical twilight ends at ",
"Astronomical twilight begins at ": "Astronomical twilight begins at ",
"Astronomical twilight ends at ": "Astronomical twilight ends at "
}

es.json:

{
"Sunrise is at ": "Sale el Sol a las ",
"Sunset is at ": "Se pone el Sol a las ",
"Solar noon is at ": "Mediodia Solar a las ",
"Length of day is ": "La duración del día es ",
"Civil twilight begins at ": "La Nueva Luna Llena ",
"Civil twilight ends at ": "Crepúsculo civil termina ",
"Nautical twilight begins at ": "Crepúsculo náutico comienza ",
"Nautical twilight ends at ": "Crepúsculo náutico termina ",
"Astronomical twilight begins at ": "Crepúsculo astronómico comienza ",
"Astronomical twilight ends at ": "Crepúsculo astronómico termina "
}

Module not working

Hi, i was wondering if this module is still working?
I can't get it to work. My mirror gives a black page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.