<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-NotificationTrigger transform payload]]></title><description><![CDATA[<p dir="auto">Hi there…<br />
first of all sorry for my english<br />
Can someone explain how I can transfer the payload “title” of the standard calendar module to the payload “massage” of the alert module? This is the configuration I’ve tested:</p>
<pre><code>{
  module: "MMM-NotificationTrigger",
  config: {
    triggers:[
      {
        trigger: "CALENDAR_EVENTS",
        fires: [
          {
            fire:"SHOW_ALERT",
            payload: (payload) =&gt; {
              return {
                type: "notification",
                title: "test",
                message: payload.title
              }
            },
          },
        ],
      },
    ]
  }

},  
</code></pre>
<p dir="auto">The result of this configuration is that I only see the title in the alert.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.magicmirror.builders/topic/11965/mmm-notificationtrigger-transform-payload</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 19:34:38 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/11965.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Jan 2020 11:04:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Thu, 16 Jan 2020 22:55:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> cause calendar payload events is an array, fires once per</p>
]]></description><link>https://forum.magicmirror.builders/post/68143</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68143</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 16 Jan 2020 22:55:26 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Thu, 16 Jan 2020 22:48:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> As far as I understand, it triggers when receiving the CALENDAR_EVENTS noti, and then “fires” a new notification, which is the “SHOW_ALERT” with the new payload.<br />
This does not explain to me why it sends the “SHOW_ALERT” noti apparently 8 times in a row.</p>
]]></description><link>https://forum.magicmirror.builders/post/68142</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68142</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Thu, 16 Jan 2020 22:48:56 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Thu, 16 Jan 2020 22:40:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> said in <a href="/post/68137">MMM-NotificationTrigger transform payload</a>:</p>
<blockquote>
<p dir="auto">For some yet unknown reason, I am getting this alert 8 times! The alert then vanishes quite shortly after.</p>
</blockquote>
<p dir="auto">because it still sends an alert notification, with an empty payload</p>
<p dir="auto">fire:“SHOW_ALERT”,  (always)</p>
]]></description><link>https://forum.magicmirror.builders/post/68139</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68139</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 16 Jan 2020 22:40:49 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Thu, 16 Jan 2020 22:08:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> So I tamed the beast but I’m getting the feeling that @Sean is right.</p>
<p dir="auto">The following would alert you of the next event every time the calendar sends a calendar_event notification:</p>
<pre><code>	{
	  module: "MMM-NotificationTrigger",
	  config: {
		triggers:[
		  {
			trigger: "CALENDAR_EVENTS",
			fires: [
				{
					fire:"SHOW_ALERT",
					payload: (payload) =&gt; {
						var testMessage = "";
						var nextEvent = payload.find(event =&gt; event.startDate &gt; moment().format("x"));
						testMessage = nextEvent.title + " " + moment(nextEvent.startDate, "x").format("HH:mm");
						return {
							type: "notification",
							title: "Next event:",
							message: testMessage
						} 
					},
				}
			],
		  },
		]
	  }	
	}, 
</code></pre>
<p dir="auto">For some yet unknown reason, I am getting this alert 8 times! The alert then vanishes quite shortly after.</p>
<p dir="auto">It is a good idea, but what I would do, no, WILL do, is implement a “Notification Alert Function” directly into the calendar module (or into MMM-CalendarExt, if you’re interested, @Sean).<br />
I think that would be a better way of ontrolling the alert created from a calendar event appearing.</p>
]]></description><link>https://forum.magicmirror.builders/post/68137</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68137</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Thu, 16 Jan 2020 22:08:56 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Wed, 15 Jan 2020 12:10:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> thank you for the time you have spent so far. I would be happy if someone else has an idea how to implement it. Thanks:smiling_face:</p>
]]></description><link>https://forum.magicmirror.builders/post/68042</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68042</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Wed, 15 Jan 2020 12:10:58 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Wed, 15 Jan 2020 08:01:29 GMT]]></title><description><![CDATA[<p dir="auto">I think it’s better to build a new module about alerting events by the condition.</p>
]]></description><link>https://forum.magicmirror.builders/post/68036</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68036</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 15 Jan 2020 08:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 18:01:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> i am debugging it now</p>
<p dir="auto">not making any progress… can’t get the time compare to work</p>
<pre><code>let now = moment()
let end = now.add(15, "minutes")
let event_time=moment(event.startDate)
if(event_time.isAfter(now) &amp;&amp; event_time.isBefore(end))
</code></pre>
<p dir="auto">its 11:53, event starts at 12:00 and ends as 12:15</p>
<pre><code>so 12:00.isAfter(11:53) should be true, but is false
and 12:00.isBefore(12:08), should be true,m but is false
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/68007</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68007</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 18:01:20 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 16:44:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> Well to be honest I did not expect it to work from scratch. But I am considering taking this into my own mirror to remind me of taking out the trash. :smiling_face:<br />
I won’t get it done today.<br />
If you don’t know how to work on from here I need to ask for your patience, and I’ll have a closer look at it myself in the next days.</p>
]]></description><link>https://forum.magicmirror.builders/post/68005</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68005</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Tue, 14 Jan 2020 16:44:41 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 16:37:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> yes i have</p>
]]></description><link>https://forum.magicmirror.builders/post/68004</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68004</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 16:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 16:31:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a>  &gt;what do you mean by “more specific”?</p>
<p dir="auto">all the questions we have been asking…   title, time filter, number to show, …</p>
]]></description><link>https://forum.magicmirror.builders/post/68003</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68003</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 16:31:47 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 16:30:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> did u have an event within the next 15 minutes?</p>
]]></description><link>https://forum.magicmirror.builders/post/68002</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68002</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 16:30:57 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 16:25:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> what do you mean by “more specific”?</p>
]]></description><link>https://forum.magicmirror.builders/post/68001</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/68001</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 16:25:50 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:59:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> Thank you for the fast answer. I tried this code. the result is that I get a notification but so far it only contains the title (test) but not the massage (title of the calendar event)</p>
]]></description><link>https://forum.magicmirror.builders/post/67998</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67998</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:59:05 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:42:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a></p>
<blockquote>
<p dir="auto">can you please post the code?</p>
</blockquote>
<p dir="auto">Took me 10 seconds :smiling_face_with_sunglasses:<br />
No, of course I was already working on it.</p>
<p dir="auto">Seriously, I like the idea, that’s why I did a contribution.But you need to be more specific if you want to have the complete solution</p>
]]></description><link>https://forum.magicmirror.builders/post/67996</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67996</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:42:28 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:41:17 GMT]]></title><description><![CDATA[<pre><code>{
  module: "MMM-NotificationTrigger",
  config: {
    triggers:[
      {
        trigger: "CALENDAR_EVENTS",
        fires: [
          {
            fire:"SHOW_ALERT",
            payload: (payload) =&gt; {
              var testMessage = "";
              payload.forEach(event =&gt; {
                if (moment(event.startDate) &gt; moment() &amp;&amp; moment(event.startDate) &lt; moment().add("15", minutes)) {
                 testMessage += event.title + ", "
                }
              });
              return {
                      type: "notification",
                       title: "test",
                       message: testMessage
              } 
            },
          },
        ],
      },
    ]
  }
},
</code></pre>
<p dir="auto">This will most probably not work and needs to be de-bugged, but might be worth as a starting point. And I hope you get what I’m hinting at.</p>
]]></description><link>https://forum.magicmirror.builders/post/67995</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67995</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:41:17 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:38:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> yes that is exacly wat i want. can you please post the code? Thank you</p>
]]></description><link>https://forum.magicmirror.builders/post/67994</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67994</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:40:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lavolp3" aria-label="Profile: lavolp3">@<bdi>lavolp3</bdi></a> actually payload IS an array<br />
(from my system default cal)</p>
<pre><code>0: {title: "M L King Day", startDate: "1579500000000", endDate: "1579586400000", fullDayEvent: true, location: "United States", …}
1: {title: "Valentine's Day", startDate: "1581660000000", endDate: "1581746400000", fullDayEvent: true, location: "United States", …}
2: {title: "Presidents' Day", startDate: "1581919200000", endDate: "1582005600000", fullDayEvent: true, location: "United States", …}
3: {title: "Good Friday", startDate: "1586494800000", endDate: "1586581200000", fullDayEvent: true, location: "United States", …}
4: {title: "Easter Sunday", startDate: "1586667600000", endDate: "1586754000000", fullDayEvent: true, location: "United States", …}
5: {title: "Mother's Day", startDate: "1589086800000", endDate: "1589173200000", fullDayEvent: true, location: "United States", …}
6: {title: "Memorial Day", startDate: "1590382800000", endDate: "1590469200000", fullDayEvent: true, location: "United States", …}
7: {title: "Father's Day", startDate: "1592715600000", endDate: "1592802000000", fullDayEvent: true, location: "United States", …}
8: {title: "Independence Day Holiday", startDate: "1593752400000", endDate: "1593838800000", fullDayEvent: true, location: "United States", …}
9: {title: "Independence Day", startDate: "1593838800000", endDate: "1593925200000", fullDayEvent: true, location: "United States", …}

</code></pre>
<p dir="auto">so the js would be</p>
<pre><code>payload[0].title 
</code></pre>
<p dir="auto">for the title (cal subject) of the 1st cal entry</p>
<p dir="auto">I found this by using the developers window (ctrl-shift-i), selecting the ‘Sources’ tab,<br />
expanding the modules entry, and then the calendar entry to get to calendar.js</p>
<p dir="auto">then knowing it is a notification,(notificationreceived) i searched (ctrl-f) for ‘sendnotification’<br />
I put a stop on that line, hit refesh(f5), and the web page starts over, and stops on that line, then use the mouse to hover over the eventlist variable name, and it expands to the data layout</p>
]]></description><link>https://forum.magicmirror.builders/post/67993</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67993</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:40:39 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:27:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> Considering you want to alert the next event happening in say 15 minutes, you could first check what event is in a range of the next 15 minutes, then take it’s title and alert that one. Can all be done inside the callback function you’ve shown above.</p>
<p dir="auto">Is that what you want?</p>
]]></description><link>https://forum.magicmirror.builders/post/67992</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67992</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:27:12 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:23:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> you need to have a look at how the payload looks. If it’s an array, you should be able to catch the title of specific elements by using something like  <code>payload.entries[n].title</code></p>
]]></description><link>https://forum.magicmirror.builders/post/67990</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67990</guid><dc:creator><![CDATA[lavolp3]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:23:31 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:20:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> said in <a href="/post/67986">MMM-NotificationTrigger transform payload</a>:</p>
<blockquote>
<p dir="auto">upcoming calendar events</p>
</blockquote>
<p dir="auto">what does that mean?  if I have 20 entries, u want 1 alert  with 20 entries, or 20 alerts with 1 entry each?<br />
or just today, or?</p>
<p dir="auto">alert module is expecting a single line of text</p>
]]></description><link>https://forum.magicmirror.builders/post/67989</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67989</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:20:02 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 15:15:22 GMT]]></title><description><![CDATA[<p dir="auto">by the title i mean the title of the individual calendar events. but ok then it doesn’t work that way. So again asked differently: is there a way to display upcoming calendar events via the alert module?</p>
]]></description><link>https://forum.magicmirror.builders/post/67986</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67986</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 15:15:22 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 14:56:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/corius" aria-label="Profile: corius">@<bdi>corius</bdi></a> what is ‘title’?  the incoming message is an array of calendar events…</p>
]]></description><link>https://forum.magicmirror.builders/post/67980</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67980</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 14 Jan 2020 14:56:17 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-NotificationTrigger transform payload on Tue, 14 Jan 2020 14:47:40 GMT]]></title><description><![CDATA[<p dir="auto">can nobody help me?</p>
]]></description><link>https://forum.magicmirror.builders/post/67973</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/67973</guid><dc:creator><![CDATA[corius]]></dc:creator><pubDate>Tue, 14 Jan 2020 14:47:40 GMT</pubDate></item></channel></rss>