We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

Readout active alarms [answered]

asked 2018-03-15 21:17:42 +0300

SaimenSays gravatar image

updated 2018-03-15 21:18:06 +0300

Does anybody know how or where the alarms are stored? Is there a file or is it somewhere in a database?
For homeautomation reasons, it would be nice to be able to readout the active alarms. Ideally I would think about a script, broadcasting it via mqtt or pulling it from server via ssh.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by SaimenSays
close date 2018-03-16 14:23:58.421812

2 Answers

Sort by » oldest newest most voted
1

answered 2018-03-16 11:28:43 +0300

phklrz gravatar image

updated 2018-03-16 14:22:51 +0300

SaimenSays gravatar image

Hello,

you can use 'timedclient' in terminal :

timedclient -i or timedclient -l

timedclient -sAPPLICATION='nemoalarms' to get the cookies of the alarms set with the clock app.

edit flag offensive delete publish link more

Comments

THANKS! This is the information I need.

Unfortunately timedclient is not available in my command line, but found timedclient-qt5 what seems to be the same.

SaimenSays ( 2018-03-16 14:22:14 +0300 )edit
1

If someone is interested, here is my code, broadcasting all alarms to mqtt:

#!/bin/bash
server="automation.fritz.box"
topic="Handy/Alarm"

cookies=($(timedclient-qt5 -s'APPLICATION=nemoalarms'))    
for cookie in "${cookies[@]}"
do
        alarm=$(timedclient-qt5 -g$cookie)
        title=$(echo "$alarm" | grep "TITLE" | sed "s/^.*'\(.*\)'.*$/\1/" | sed
"s/ /_/g")
        timeofday=$(echo "$alarm" | grep "timeOfDay" | sed "s/^.*'\(.*\)'.*$/\1/
")
        mqtt-cli $server $topic/$title $timeofday
done
SaimenSays ( 2018-03-16 18:59:13 +0300 )edit
0

answered 2018-03-15 21:25:26 +0300

rgrnetalk gravatar image

Could this be what you are looking for?

edit flag offensive delete publish link more

Comments

This topic goes to the right direction, but I can't see any message when changing alarm settings while watching to output of dbus-monitor. Can you help me out?

SaimenSays ( 2018-03-15 22:01:47 +0300 )edit

You can create a simple dbus client which listens for the specific interface for example. Doing it in qml is fairly easy (but targeted mostly for UI's); from c++ its also not impossible and samples can be found online; the qt libraries for handling dbus are straightforward.

tortoisedoc ( 2018-03-16 14:39:17 +0300 )edit

Question tools

Follow
1 follower

Stats

Asked: 2018-03-15 21:17:42 +0300

Seen: 237 times

Last updated: Mar 16 '18