• 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.

Calendar Broadcast

Scheduled Pinned Locked Moved Solved Development
3 Posts 2 Posters 1.9k Views 2 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.
  • D Offline
    Daveladd
    last edited by Apr 18, 2017, 7:51 PM

    I am looking to develop a module that receives the broadcast notification from MM/default/calendar (which is presently being used as a work schedule) and can, for example, parse out the array and display a picture of the person next on the schedule. As of yet I cannot seem to get any even basic output from the CALENDAR_EVENTS notification let alone parse out the array into something useful. Any help would be much appreciated.

    1 Reply Last reply Reply Quote 0
    • A Offline
      Anhalter42
      last edited by Apr 19, 2017, 1:02 AM

      If you are already receiving CALENDAR_EVENTS notifications, you should be able to iterate over the payload of the notification and access the desired properties, because the documentation says “The event objects are stored in an array and contain the following fields: title, startDate, endDate, fullDayEvent, location and geo.”

      So, you could put the names of the persons as title and access them via the title field while iterating through the array. Then, you can show the picture of that person or whatever you want to do.

      If this doesn’t help, I suggest to rephrase your question. What have you already achieved in this context? What did you try that failed at the end (error messages)?

      1 Reply Last reply Reply Quote 0
      • D Offline
        Daveladd
        last edited by yawns Apr 23, 2017, 9:15 AM Apr 23, 2017, 3:55 AM

        Apologies for not being specific enough. Was having troubles unpacking the notification payload. Found that this method works:

        notificationReceived:function(notification, payload, sender) {
            if (notification === 'CALENDAR_EVENTS' && sender.name === 'calendar') {
                var x = payload;
                    for (let value of x) {
        

        then I was able to use variables such as x[0] or value.title/startDate/endDate etc, to access the data.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        1 / 1
        • First post
          3/3
          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