MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. MMRIZE
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    M
    Offline
    • Profile
    • Following 0
    • Followers 9
    • Topics 29
    • Posts 952
    • Groups 0

    Posts

    Recent Best Controversial
    • MMM-CalendarExt3Timeline

      MMM-CalendarExt3Timeline

      The successor of CalendarExtTimeline, the Magicmirror module. A sibling module of MMM-CalendarExt3. This module would show the timeline of events.

      1c58e72b-d090-4483-88af-0ecb75a9ae6a-image.png

      https://github.com/MMRIZE/MMM-CalendarExt3Timeline

      posted in Utilities
      M
      MMRIZE
    • RE: MMM-OpenmapWeather sunrise and sunset times are GMT

      @rsiggins
      In my test, the module itself returns the right time of the target place converted to my local timezone. Anyway, there may be some special reason for your case.

      Of course, the developer should look inside to know what really happened. But as a emergency cure, you can use some monkey-patching before real fixation from the developer.

      {
      	module: "MMM-ModuleMonkeyPatch",
      	config: {
      		patches: [
      			{
      				module: "MMM-OpenmapWeather",
      				method: "processWeather",
      				patch: function (original, args) {
      					const [ data ] = args
      					const yourDesiredOffset = 5 * 60 * 60 // 5 hours
      					data.sys.sunrise = new Date((data.sys.sunrise + yourDesiredOffset) * 1000).valueOf()
      					data.sys.sunset = new Date((data.sys.sunset + yourDesiredOffset) * 1000).valueOf()
      					original(data)
      				}
      			},
      		]
      	}
      }
      
      
      posted in Troubleshooting
      M
      MMRIZE
    • RE: Need Help Changing Background Image Based on Time

      @tonkxy

      start: function () {
        // init your module.
        // Not recommended doing your real job here. Because this method is evaluated only one time on startup before all the stuff be prepared (e.g, DOM creating)
        this.timer = null
      },
      
      notificationReceived: function (notification, payload, sender) {
        if (notification === 'DOM_OBJECTS_CREATED') {
          // This might be the best position where your real job starts.
          this.myJob()
        }
      },
      
      myJob: function () {
        clearTimeout(this.timer)
        let rand = Math.floor( ... ) // random number to pick
        let hour = (new Date()).getHours() // select hour to pick the folder
        // ...  Your logic for picking image by hour and rand
      
        this.timer = setTimeout(() => {
          // ... Your logic for displaying image picked.
      
          this.myJob() // recursive execution per updateInterval.
          // It would be a better habbit to use setTimeout instead of setInterval
        }, this.config.updateInterval)
      },
      
      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-News

      @mumblebaj
      Thanks for your hard work on my behalf.
      BTW, if you are not maintaining MMM-News any more, can you return the ownership to me again? I want to archive it in my control back.

      posted in Utilities
      M
      MMRIZE
    • RE: MMM-GooglePhotos+MMM-NFL=WTF-Refresh Rates?

      @JeffreyDaro
      To save the daily quota,

      • Specify the album to scan, not whole or many albums. Scanning will consume your Quota, And the number of files in target albums will also affect consumption.
      • You can only show 8640 pictures in a day at most, even with 10 seconds. With 60 seconds, you can show around 1400 pictures per day. If you have thousands of pictures in the album, unused pictures would also scanned. (scan 50 pictures would consume 1 call) It could be more efficient.
      • Let’s compute: If you have 5000 pictures in your target album, you will consume 100 calls per scan, and to serve each image, at least 1 call per image would be consumed. But most of the scanned pictures would not be used at all.
      • So, optimise your album. Carefully collect/select pictures to be shown with a proper number. Gather the pictures in one album like 'MM Wallpaper". Keep the number as low as possible, and assign longer updateInterval as some minutes, not seconds. It will help your quota consumption.
      posted in Troubleshooting
      M
      MMRIZE
    • RE: Need Help Changing Background Image Based on Time

      @tonkxy

      start: function () {
        this.timer = null
        this.targetURL = null
        this.setImageURL()
      },
      
      getDom: function () {
        console.log(">", this.targetURL)
        var dom = document.createElement('div')
        dom.style.backgroundImage = `url(${this.targetURL})`
        dom.style.height = '100vh' // I recommend to control this through CSS, but in this example, I just hardcode it.
        dom.style.width = '100vw'
        dom.style.backgroundSize = 'cover'
        return dom
      },
      
      notificationReceived: function (notification, payload, sender) {
        if (notification === 'DOM_OBJECTS_CREATED') {
          this.job()
        }
      },
      
      
      job: function () {
        clearTimeout(this.timer)
        this.updateDom()
        this.setImageURL()
        this.timer = setTimeout(() => {
          this.job()
        }, this.config.updateInterval)
      },
      
      setImageURL: function () {
        // do your logic for picking image. Here I pick the random unsplash image instead for example.
        let rand = Math.floor(Math.random() * 100000)
        this.targetURL = `https://source.unsplash.com/random?seed=${rand}`
      }
      
      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3

      @bicolorbore586
      Sorry, It can’t be done at this moment. In some day, I have a plan to update. I’ll consider your needs at that time.

      posted in Utilities
      M
      MMRIZE
    • RE: MMM-CalendarExt3Agenda questions.

      @Kelemvor
      75f6b6bf-824f-438c-813c-6bce1bb6cfd6-image.png

      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-Tool stopped displaying in 2.17.1

      @fozi
      Once I was the original creator of this module (and many others)
      For some personal reasons, I couldn’t maintain my modules anymore at that time by myself. But I didn’t want to break the maintenance of the modules for the community. So I transferred all the ownership to any volunteer who wants to take over. I believed that they could keep the module’s maintenance and develop more than me.

      After one and a half years passed, I return to this scene now.
      What I see is, …
      Some modules are being maintained still well, some are abandoned, some are, …

      Well, I will not claim my ownership back, those modules are not mine anymore from my discard. And I believe everyone has his own good mind. So I don’t care.

      However, a little sorry to you for this situation though.

      posted in Troubleshooting
      M
      MMRIZE
    • RE: MMM-CalendarExt3

      @bicolorbore586
      d37a4684-6469-4d59-926c-cfb13fbc924d-image.png
      Since 1.3.0, with manipulateDateCell callback function in configuration, you can handle date cell itself. So you can achieve what you want.

      Here is a simple example; (more tweek might be needed to match with your wants wholely)

      manipulateDateCell: (cell, events) => {
      	if (Array.isArray(events) && events.some(e => e.calendarName === 'Holidays')) {
      		let dateIcon = document.createElement('span')
      		dateIcon.classList.add('fa', 'fa-fas', 'fa-fw', 'fa-gift')
      		dateIcon.style.color = 'red'
      		dateIcon.style.fontSize = '0.9em'
      		let header = cell.querySelector('.cellHeader')
      		let celldate = header.querySelector('.cellDate')
      		header.insertBefore(dateIcon, celldate)
      	}
      }
      

      Anyway, it could be possible.

      posted in Utilities
      M
      MMRIZE
    • 1
    • 2
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 9 / 13