Read the statement by Michael Teeuw here.
MMM-AlarmClock append / push to alarms array
-
I’m trying to append alarm objects to the alarms array
This is my code so far.// SET ALARM if(notification === "SET_ALARM"){ var mqttData = JSON.parse(payload); this.config.alarms.push({time: mqttData.hour+":"+mqttData.min, days: [1,2,3,4,5,6,7], sound: "alarm.mp3", title: "Alarm", message: mqttData.msg}); this.updateDom(300); console.log("alarm obj: "+this.config.alarms); }However, in the console it shows only one alarm object.

Note: I have one alarm set in the config file
-
This post is deleted! -
I removed the Dom update and it seems to work.
-
@axellejamous be aware of that day 7 doesn’t exist the days range from 0 sunday to 6 saturday
-
@strawberry-3.141 changed, thank you!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login