Active Topics

 


Reply
Thread Tools
Posts: 121 | Thanked: 292 times | Joined on Mar 2016
#21
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?

Last edited by Veraendert; 2020-04-17 at 14:31.
 

The Following 2 Users Say Thank You to Veraendert For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#22
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; }
Replace the xxxSUBJECTxxx with any unique part of subject of your alert mail. And replace SOMEFILE with any music /sirene/noise sound file.
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!
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 9 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 1,313 | Thanked: 2,977 times | Joined on Jun 2011 @ Finland
#23
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
__________________
My N9/N950 projects:
 

The Following 3 Users Say Thank You to ajalkane For This Useful Post:
Halftux's Avatar
Posts: 868 | Thanked: 2,516 times | Joined on Feb 2012 @ Germany
#24
Originally Posted by peterleinchen View Post
So there is room for improvement. But hey it works!

Thanks @haltux for the right pointers!
Nice one I am glad that I could be of help with this outcome
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.
 

The Following 4 Users Say Thank You to Halftux For This Useful Post:
Posts: 121 | Thanked: 292 times | Joined on Mar 2016
#25
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

Last edited by Veraendert; 2020-04-17 at 06:29.
 

The Following User Says Thank You to Veraendert For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#26
You are welcome.
Fire fighters are system relevant so I needed to help

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...
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 121 | Thanked: 292 times | Joined on Mar 2016
#27
Just in case a colleague of mine finds this: I had to install gstreamer1.0-tools, too
 

The Following 3 Users Say Thank You to Veraendert For This Useful Post:
Posts: 121 | Thanked: 292 times | Joined on Mar 2016
#28
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 &&
kill $(cat dbusmonpid) && rm dbusmonpid; }
This is a working solution.
 

The Following 5 Users Say Thank You to Veraendert For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#29
Originally Posted by Veraendert View Post
So after install alsa-utils and gstreamer1.0-tools i'm now here:
...
This is a working solution.
Now as we know the trigger subject text we just need your e-mail address to test!

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?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 5 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 121 | Thanked: 292 times | Joined on Mar 2016
#30
Originally Posted by peterleinchen View Post
Now as we know the trigger subject text we just need your e-mail address to test!
I'm not that stupid

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.

Last edited by Veraendert; 2020-04-17 at 14:55.
 

The Following 3 Users Say Thank You to Veraendert For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 09:57.