![]() |
Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Hi, i'm a volunteer firefighter which is a pretty busy job right now with lots of alarms. I need help with having some kind of alarm sound on a phone running SFOS.
I also happen to have a Jolla Phone which i really like. We have 2 means of alarms: An app running on Android or iOS and a bulky analogue device. When i go out for work or jogging, i usually take only my phone with me. And i would prefer using my J1 and not one of my Android phones that i'd rather leave at home. I tried running the Android app on it for alarms but no luck getting it to work so far. So this is a dead end (the Android app is called aPager Pro if you need to know). What i did manage to do is forwarding the messages by e-mail from the app to my J1 using an app called NotifyMe. The problem is: I get a lot of e-mails. So if i have to take my phone out every time i get an e-mail, i'm more or less unable to work. So what i need is a solution that reads my mails (or just the sender as that would always be the same for the forwarded alarms) and plays a sound as loud as possible. But i'm way out of my depths here. Does anyone have any idea how to solve my problem? |
Re: Please help a firefighter
What about a dedicated email account for your alarm emails?
|
Re: Please help a firefighter
Wouldn't be a problem to set up- but i still wouldn't have an alarm?
|
Re: Please help a firefighter
My e-mail provider has a service to send sms (text) messages when e-mails come in according with filter settings. That would solve it, right? It will cost you a few cents per sms.
If not through your provider: the other day I was talking to a guy who had a Node-RED solution to keep an eye on his building. He used sms messages too, I think through Vonage. I don't know if there is a lot of programming involved. |
Re: Please help a firefighter
Quote:
|
Re: Please help a firefighter
Isn't the ringtone always the same? Problem is i need mails from my main account in the phone, top.
|
Re: Please help a firefighter
I probably should mention that i run my own Mail server, if that helps.
|
Re: Please help a firefighter
Quote:
Of course if the alarm backend system that "aPager Pro" uses had an open API then it would not be difficult to implement something in python that'd serve as alarm application on SFOS. If this is not possible then indeed some filtering based on the emails is the next best thing. |
Re: Please help a firefighter
Quote:
|
Re: Please help a firefighter
Thanks so far, i've set up a separate mail account, that probably helps a bit. There is no way to alter the sound of email notification i presume?
@juiceme: The application is closed source and as far as i can tell works with an encrypted message other than SMS/e-mail. This is sensible data so we don't want everybody to be able to see the messages. No way they'd open the API just for me to mess around. But when that message is displayed, a different Android app NotifyMe grabs the displayed message and forwards it via e-mail. That's not perfect but still better than just hearing the siren from the first engine going out. We're short of firefighters so this is a rather pressing problem. |
Re: Please help a firefighter
jI guess for now a separate mail account with push set and all others to manual is best option for you.
I am pretty sure that it should be possible with some coding (e.g. python): dbus listening for new mails and filtering text, then with aplay or something else playing sound. I am also sure similar have been done for N900 already but I cannot remember for SFOS... |
Re: Please help a firefighter
1 Attachment(s)
Quote:
|
Re: Please help a firefighter
@claustn: Thanks, maybe i wasn't clear enough: I only have the option to edit the alarm sound for every e-mail, regardless of what account it was sent to. That way, if i check for mails from my "normal" account, there would be an alarm sound every time there's new mail. So while i could use some siren sound for e-mail alarms, this would probably not be a good idea e.g. at work.
Ideally, there would be a specific sound for that e-mail account overriding everything and playing at full volume. But the setup i have now is already a lot better than what i had before thanks to everyone. I really appreciate it. Checking your email every 5 minutes on a 20km run sucked. |
Re: Please help a firefighter
In case you are located in The Netherlands: dds.nl offers the sms service. An account is 32,50/year, text message 0,10-0,12 euro each.
|
Re: Please help a firefighter
I'm in Germany. And this would still mean that i'd get an alarm sound every time i receive an SMS. Which isn't that often but still often enough.
|
Re: Please help a firefighter
Quote:
|
Re: Please help a firefighter
I would do it with dbus.
For sms you can look here: https://talk.maemo.org/showthread.php?t=100848 And the email application has a session dbus interface (com.jolla.email.ui) maybe it is helpful. https://together.jolla.com/question/...e-information/ https://talk.maemo.org/showthread.php?t=92303 |
Re: Please help a firefighter
You can quite easily connect some kind of prototype board with modem to the 'real' alarm device which, when will be activated, will send you SMS. Easy to do but you need some electronics technician/engineer in your place to do it.
|
Re: Please help a firefighter
1 Attachment(s)
Quote:
That's me yesterday btw. 3rd one from left. The good looking one. |
Re: Please help a firefighter
@veraendert: I'm a volunteer in the german civil protection service and my local unit decided to use a tool named divera for alerting us. Unfortunately there is also only an iOS or Android app, thus is "suffer" from the same problem. Which App is your fire brigade using?
|
Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Dear colleague, we use this one now: https://www.alamos-gmbh.com/service/apager-pro/
The whole Landkreis (county?) is supposed to use it. Best part is that it also shows me the way to the fire station should i have forgotten how to get there. @all: You guys are great. I now have a separate email account, with situation set up so that when i´m not within reach of a known wifi the ambient changes and thus the sound when i get an email. Emails are constantly retrieved for the alarm mail account and only manually for the normal one. I think i can live with that for the time being. I'll probably try to retrieve the alarm message via kdeconnect with a linux computer later to gain a few seconds and to be able to forward the message via different means. One last question though: the Situations app lets me execute random commands it seems. Does anyone have any idea how to put this possibility to use? |
Re: Please help a firefighter
I just found some time to hack together a shell one-liner that should solve it for you (jn case your alert e-mail has a specific unique subject):
Code:
{ dbus-monitor & echo $! >dbusmonpid; } | { grep -q -m 1 'xxxSUBJECTxxx' && gst-launch-1.0 playbin uri=file:///home/nemo/Music/SOMEFILE.ogg.midi.wav.mp3 && kill $(cat dbusmonpid) && rm dbusmonpid; } Tested and worked. :) This is definitely not fool proof and could be extended with a loop and more. Oh and let the sound play to end (do not use ctrl-c), else the dbus-monitor process will not get killed. About loudness I do not know with gst-launch but there should be some help. So there is room for improvement. But hey it works! Thanks @haltux for the right pointers! :D |
Re: Please help a firefighter
If you can make the alerts come as SMS with predefined message, you could also use FindMyJolla to create alert:
https://openrepos.net/content/ajalkane/find-my-jolla |
Re: Please help a firefighter
Quote:
Very good and flexible starter. I could also think of, that you not filter the subject which is good, but when needed you could also filter the account which gets an e-mail. Just as an idea when the subject changes. |
Re: Please help a firefighter
This sounds great, i'll test it. I should probably make this a cron job to start on boot, no?
I can define the message myself so that shouldn't be a problem. Volume should be easy: https://gstreamer.freedesktop.org/do...ume/index.html |
Re: Please help a firefighter
You are welcome.
Fire fighters are system relevant ;) so I needed to help :D About volume level I found that gstreamer thing also but think this is just setting 0-100 % of actual level (not sure). So I think this approach here sounds better: Code:
after installing alsa-utils via pkcon I was able to change the master volume/balance via cmd line like 'amixer sset Master 80%,80%' The current code snippet I made is a one-time executer, so you would need to put into a loop. I thought it is easier to control when you want it to run. If you want it always, a systemd script on boot or cron job is good. But then it would need some more fine tuning against reliability, e.g. how to stop it or how to pause/stop the sound... |
Re: Please help a firefighter
Just in case a colleague of mine finds this: I had to install gstreamer1.0-tools, too
|
Re: Please help a firefighter
So after install alsa-utils and gstreamer1.0-tools i'm now here:
Code:
{ dbus-monitor & echo $! >dbusmonpid; } | { grep -q -m 1 '<alarm>' && amixer sset Master 100%,100% && gst-launch-1.0 playbin uri=file:///home/nemo/Documents/sirene.mp3 && |
Re: Please help a firefighter
Quote:
Would you mind to edit the first post and hereby the title to some more meaningful? Like: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails -- and maybe reset loudness after sound has played? |
Re: Please help a firefighter
Quote:
Thank you all for your input. I'll try to figure out how to make a systemd service from this that also resets sound volume. |
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Can you record the current level using awk and alsamixer sget to a file, like the PID, just before you set it to 100. Then restore it when you do the cleanup up the end.
|
Re: Please help a firefighter
Quote:
|
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Quote:
|
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Sounds like OOM kills of terminal. :(
I see my terminal cover often greyed out, i.e. killed and the command just interrupted :eek: I extended my swap manually with a swap file on home (maybe better on SD card like on N900?) and it got better. Maybe try with ShellEx or qCommand from openrepos? Or let a cron job restart this command every xx minutes? (will you get re-notified more often via mail?) |
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Quote:
Maybe something like editing the dbus command posted earlier to add alsactl --file ~/.config/asound.state store Before the alsamixer -sset Master bit and alsactl --file ~/.config/asound.state restore In the kill/cleanup part. |
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Sounds good, will try. But then the script worked very well twice today already. Which means that i'm really tired. Because it was quite early when my sleep was interrupted.
|
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Cannot help you with this sound stuff,
as I am not really a knowledged one regarding PA, alsa and so on and all that alsa vodoo just gives me a lot of 'no such device' or 'cannot read control' or similar on XA2... |
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
No problem, you helped a great deal already. I just need some time to figure things out. As long as i have a working solution, i'm fine.
|
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
To dodge into a different direction may I ask what bulky analog device you have for callouts? Are people still using Motorola Minotaur and Minotaur IIs?(edit, damn they are up to the Minotaur 6, now as big as a little '90s belt pager now but still voice paging.)
I was a paid guy and finished as an officer and EMT-P but ended up taking the tech telated topics during my 8-5 work hours, though we were still doing in the VHF in rural western US when I medical'ed out. I am also an amateur radio guy so hacking a VHF receiver with tone controls back then was cake though we also had commercial UHF POCSAG pagers with priority so they all beeped about 1-2 sec after the tones came over the VHF dispatch channel. Not sure what your dispatch's setup looks like. Big life altering advice for all first responders. Lift properly, ask for help(hard for young guys, especially young volunteers), protect your spine, stairways with a patient on the cot and you are the backwards guy will get you; the damage you do might put you away fast or might just get worse over time; it is what ended my career. Also remember that car drivers are what kill by far the most first responders and that people get lax at training events in a way they never would on a real call(hours of repeated extinguish/relight burn to learns especially). Pass this on to the young guys at your department and wherever you end up doing teaching. |
Re: Help a firefighter - trigger alarm.mp3 by monitoring incoming e-mails
Quote:
|
All times are GMT. The time now is 13:03. |
vBulletin® Version 3.8.8