Read the statement by Michael Teeuw here.
MMM-NotificationTrigger transform payload
-
{ module: "MMM-NotificationTrigger", config: { triggers:[ { trigger: "CALENDAR_EVENTS", fires: [ { fire:"SHOW_ALERT", payload: (payload) => { var testMessage = ""; payload.forEach(event => { if (moment(event.startDate) > moment() && moment(event.startDate) < moment().add("15", minutes)) { testMessage += event.title + ", " } }); return { type: "notification", title: "test", message: testMessage } }, }, ], }, ] } },
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.
-
can you please post the code?
Took me 10 seconds :smiling_face_with_sunglasses:
No, of course I was already working on it.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
-
@lavolp3 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)
-
@lavolp3 what do you mean by “more specific”?
-
@corius did u have an event within the next 15 minutes?
-
@corius >what do you mean by “more specific”?
all the questions we have been asking… title, time filter, number to show, …
-
@sdetweil yes i have
-
@corius 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:
I won’t get it done today.
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. -
@lavolp3 i am debugging it now
not making any progress… can’t get the time compare to work
let now = moment() let end = now.add(15, "minutes") let event_time=moment(event.startDate) if(event_time.isAfter(now) && event_time.isBefore(end))
its 11:53, event starts at 12:00 and ends as 12:15
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
-
I think it’s better to build a new module about alerting events by the condition.