hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
162 stars 62 forks source link
google-photos googlephotos javascript magicmirror magicmirror2 nodejs photos raspberry-pi

MMM-GooglePhotos

Display your photos from album of Google Photos on MagicMirror².

Screenshot

screenshot

screenshot

Installation & Upgrade

INSTALL.md

Configuration

{
  module: "MMM-GooglePhotos",
  position: "top_right",
  config: {
    albums: [], // Set your album name. like ["My wedding", "family share", "Travle to Paris"]
    updateInterval: 1000 * 60, // minimum 10 seconds.
    sort: "new", // "old", "random"
    uploadAlbum: null, // Only album created by `create_uploadable_album.js`.
    condition: {
      fromDate: null, // Or "2018-03", RFC ... format available
      toDate: null, // Or "2019-12-25",
      minWidth: null, // Or 400
      maxWidth: null, // Or 8000
      minHeight: null, // Or 400
      maxHeight: null, // Or 8000
      minWHRatio: null,
      maxWHRatio: null,
      // WHRatio = Width/Height ratio ( ==1 : Squared Photo,   < 1 : Portraited Photo, > 1 : Landscaped Photo)
    },
    showWidth: 1080, // These values will be used for quality of downloaded photos to show. real size to show in your MagicMirror region is recommended.
    showHeight: 1920,
    timeFormat: "YYYY/MM/DD HH:mm", // Or `relative` can be used.
  }
},

Usage

albums

Now this module can access not only your owns but also shared. You can specify album title like this.

albums: ["My wedding", "family share", "Travle to Paris", "from Tom"],

updateInterval

sort

uploadAlbum

this.sendNotification("GPHOTO_UPLOAD", path);
node create_uploadable_album.js MyMagicMirrorAlbum

condition

condition: {
  fromDate: "2018-01-01", // I don't want older photos than this.
  minWidth: 600, // I don't want to display some icons or meme-pictures from my garbage collecting albums.
  maxWHRatio: 1, // I want to display photos which are portrait.
}

showWidth, showHeight

timeFormat

debug

autoInfoPosition

autoInfoPosition: true, // or false

// User custom callback
autoInfoPosition: (album, photo)=> {
 return ['10px', '10px', 'none', 'none'] // This will show photo info top-left corner.
}

Tip

#GPHOTO_INFO {
  display: none;
}
#GPHOTO_INFO {
  top: 10px;
  left: 10px;
  bottom: inherit;
  right: inherit;
}
#GPHOTO_BACK {
  display: none;
}
#GPHOTO_CURRENT {
  background-size: cover;
}
#GPHOTO_CURRENT {
  background-size: contain;
}
.clock {
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
}
@keyframes trans {
  from {opacity: 0}
  to {opacity: 0.5}
}
#GPHOTO_CURRENT {
  background-size:cover;
  opacity:0.5;
}

Notice

Last Tested