David Sanner - Looking at signalk-audio-notific...

Looking at signalk-audio-notifications plugin, perhaps to update it to allow for the option repeat 'emergency' alarm states instead of a single audio notification. Seems valuable for emergency situations like anchor dragging or engine overheating as it's easy to miss a single audio alert.
29 Replies
Scott Bender
Scott Bender5mo ago
That plugin definitely needs some work...
David Sanner
David SannerOP5mo ago
Yes, it's pretty basic and I could imagine a Webapp that lists & provides controls/actions for all notifications but for now just having the ability to repeat an alarm levels seems like it would go a long way. Most plugins react/run when there's an update of a value so I wasn't sure how to do a timer or trigger the plugin to run after a given delay.
Scott Bender
Scott Bender5mo ago
That's probably nit the right way to it. It shoiuld just repeat the alarm as soon as it finishes playing. Untils the state goes to normal or sound is no longer in method Probably should get bergie involed in the discussion. Not sure if/what his name is here...
David Sanner
David SannerOP5mo ago
That might work except currently (which is a problem as well) it sends audio notifications async - so they can collide with themselves (eg. several notifications speaking at the same time).
Scott Bender
Scott Bender5mo ago
Yeah, it needs to make sure it does not repeate if it's already playing (the fusio n plugin does all this correctly, might be worth it to look at that)
David Sanner
David SannerOP5mo ago
Looking at the fusion plugin. Does it do text to speech? Looks like bergie opened an issue back in 2020 about previously-playing notifications colliding. There's some sort of callback option with say.js which might be useful.
Scott Bender
Scott Bender5mo ago
Not it does not do text to speach, but the same concept
say.speak(playable, null, null, (sayErr) => {
if (sayErr) {
reject(sayErr);
return;
}
resolve();
});
say.speak(playable, null, null, (sayErr) => {
if (sayErr) {
reject(sayErr);
return;
}
resolve();
});
I assume that callback gets called whien it's done, but not sure... would need a pretty good understanding of Promises to fix this...
David Sanner
David SannerOP5mo ago
readme has this example: // Fire a callback once the text has completed being spoken say.speak("What's up, dog?", 'Good News', 1.0, (err) => { if (err) { return console.error(err) } console.log('Text has been spoken.') });
tobi42
tobi425mo ago
I don't think bergie is on discord (yet), but I got him on telegram and will point him towards this discussion @Lille Ø << there he is! 🥸
Lille Ø
Lille Ø5mo ago
Hmm, not sure what's the problem here. At least with anchor alarm you already get repeating voice alerts from the plugin until it is resolved (anchor raised, alarm radius increased, whatever) Easy to test by forgetting to disable anchor watch and sailing away And sorry, I don't monitor Discord very actively. I find this quite hard to stay on track with compared to Slack
Scott Bender
Scott Bender5mo ago
I have not tested this plugin, it That may not be true with the latest version of the anchor alarm plugin. It used to continually send the notification, not it only sends it once.
Lille Ø
Lille Ø5mo ago
Thanks for the heads-up, that might indeed be the case then
David Sanner
David SannerOP5mo ago
With the previous version of anchor-alarm, multiple alarms would stack on top of each other / collided making it hard to understand the alarm. With the latest update now a single voice alarm happens. Seems neither are ideal for these types of emergencies. I imagine managing / queuing / repeating multiple voice alarms could get complicated quickly but it having at least a continuous (beeping) alert for emergency notifications seems valuable. The server-alarm plugin (which requires asla/aplay and expects a USB speaker) will repeat but again not ideal for all emergencies/platforms but could work for repeating anchor alarms https://github.com/voilier-kalymnos/server_alarm/ btw, with the KIP app, an alarm state causes continuous beeping w/ the ability to mute/acknowledge within app (like WilhelmSK). This works well but again, the app needs to be running. A (hopefully straightforward?) update to audio-notifications to repeat emergency states could provide an always up / background alarm that works for these types of emergencies. The alarm state could be managed/acknowledged via KIP/WilhelmSK.
Scott Bender
Scott Bender5mo ago
@David Sanner did you enable push notifications for WilhelmSK? If you do, you'll get a notification even if the app is not open, and you can silence the alarm from the notification
Lille Ø
Lille Ø5mo ago
Hmm, maybe the audio alarm plugin should play them on loop until acknowledged Won't that require Internet?
Scott Bender
Scott Bender5mo ago
no Turn on "Local Notifications" in WilhelmSK
David Sanner
David SannerOP5mo ago
Cool... that's a nice but would assume the push notification does not loop. The more I think about, at least my use case, I think all we need is a continuous beeping/alert sound whenever there is an active notification in emergency (or alarm?) state, voice & queuing not required. So a plugin would start looping a sound for any notification entering emergency/alarm state and stop when all clear. audio-notifications would then just announce the notification once.
Scott Bender
Scott Bender5mo ago
yes, does not loop You can use the fusion plugin even if you don't have a fusion stereo it plays a sound on the pi
David Sanner
David SannerOP5mo ago
Right, but it does direct you into the app to control the notification/alert
Scott Bender
Scott Bender5mo ago
There are buttons in the notification
David Sanner
David SannerOP5mo ago
Nice! Can you tell the fusion app to play/loop audio?
Scott Bender
Scott Bender5mo ago
yes, it does until the alarm goes away or it is silenced
David Sanner
David SannerOP5mo ago
Huh... does the fusion app track the alarm state?
Scott Bender
Scott Bender5mo ago
yes
David Sanner
David SannerOP5mo ago
I'll take a closer look - didn't realize it worked w/o fusion stereo. btw, I was noticing duplicate audio streams (2 aplay streams) w/ audio-notifications yesterday. Anyone else seeing/hearing this? I think the fusion app is the ticket for alarms. More testing when I get back onboard. I had to install mpg123 (already had mpg321) and then it just worked. Thanks!
Scott Bender
Scott Bender5mo ago
It's really cool when you have a fusion stereo. It switches the input to Aux, sets the volume, and plays the sounds through the stereo Then switches back to your music when the alarm state changes or is silenced I have speakers in my birth, the cabin and cockpits, so I never miss an alarm!
David Sanner
David SannerOP5mo ago
That sounds amazing / very slick, especially returning to the previous state after an event clears. I'll have to get a fusion stereo on my next boat (a year or so from now?) I'm working creating a slimmed down plugin based on yours without fusion functions but a couple of added features / controls like the ability to run a command before playing sounds and support for warning notifications.
Scott Bender
Scott Bender5mo ago
I actually use my signalk-yd-alarm-button plugin for the sounds. It has some more extensive options. Might want to take a look for inspiration. one thing that sucks is that the Fusion can't switch back to AirPlay. The Fusion does not support that. Has to be initialted from a device. But it works with BT, Radio, etc.
David Sanner
David SannerOP5mo ago
Sounds like they need to add that to the next firmware update. Hopefully that'll happen before the bug fix to my Navico GPS/Heading sensor which has a bug in the N2K (PGN 129029 always reports 0 for navigation.gnss.satellites which they seem fully uninterested in fixing). Ok, first crack at a plugin. signalk-notification-player It allows user to select continuous, one time, or mute for each of these notifications: emergency, alarm, warn, alert. For continuous there's an option to run a command before and after notification.

Did you find this page helpful?