fewieden / MMM-AlarmClock

Alarm Clock Module for MagicMirror²
MIT License
47 stars 18 forks source link

Not getting the popup #28

Closed alesch2 closed 4 years ago

alesch2 commented 4 years ago

Platform (Hardware/OS):Pi 3B

Node version: 10.17.0

MagicMirror version: 2.9.0

Module version: 2.0.0

Description of the issue: Just installed the MMM-AlarmClock on my new setup MagicMirror. I somehow can't get it to work properly. This is what I put in the config-file:

{ module: "MMM-AlarmClock", position: "top_center", config: { alarms: [ {time: "18:15", days: [0,1,2,3,4,5,6], title: "Test", message: "something in writing",}, ], format: "ddd HH:mm", popup: true, fade: false, } },

1) The alarm starts at the time i program it in the config and ends after a minute. But never during this time I get to see the popup as in the example shown on this page. I added "popup: true" to the config file (knowing that this should be the default value) with no effekt. Any ideas what I might be doing wrong?

2) Then what I also can't figure out: The first "beep" of the alarm sound is at normal volume. Every "beep" that follows is quieter - as if fare away. I tried different speakers and headphones - all with the same result. What could cause that?

3) I also tried combining the alarm clock module with MMM-Button. But I can't get any response from pressing the button. I checked the button with the little python program from http://razzpisampler.oreilly.com/ch07.html The button works. It's just that I can't get the alarm to stop by pressing the button. This is the code in my config file: { module: "MMM-Button", config: { buttonPIN: 12, clickDelay: 500, notificationMessage: "STOP_ALARM", } },

Thank you for any help. I'm quite new to this and I really can't figure out what I'm missing. I tried a lot, googled my way through a lot of websites...

edit: I'm sorry for the messy code. It doesn't show the line-breaks as I idended.

1abhirama commented 4 years ago
  1. you need to set the popup = true in the MMM-AlarmClock.js
  2. you need to command or delete "this.fadeAlarm();" to make the sound keep loud until you trigger it down in the MMM-AlarmClock.js. setTimeout(() => { const player = document.getElementById('MMM-AlarmClock-Player'); player.volume = this.config.fade ? 0 : this.config.volume; // this.fadeAlarm(); }, 100);
fewieden commented 4 years ago

@alesch2 @1abhirama sorry for the late reply.

You should not change any file except config.js in order to get the module work.

  1. For this to work make sure you also have the alert module active in your config.js file like:
{
  module: "alert",
}
  1. This seems to be a bug, I fixed it on the develop branch. You can test it with:
cd ~/MagicMirror/modules/MMM-AlarmClock
git checkout develop
git pull
npm i

and then restart your mirror

  1. I'm sorry I have no hardware button to try it out with, maybe the developer of MMM-Button is better help for you for this issue. When I manually send the notification STOP_ALARM it stops the alert.