Goals
The goal was to set and control permanent alarms, that should not be deleted by a restart. We wanted to be able to:
- Set/Delete an alarm
- Stop the alarm
- (Change the sound of the alarm)
Rhasspy
In Rhasspy we have to add new lines to the sentences.ini
:
[SetAlarm]
(setze | stelle) einen wecker (auf | um) (0..24){hours} (uhr)
(setze | stelle) einen wecker (auf | um) (0..24){hours} (uhr) (0..59){minutes}
[GetAlarm]
wann (klingelt | geht) (der | mein) wecker
[DeleteAlarm]
lösche (den | meinen) (aktuellen) wecker
Example sentences
Some example sentences are:
1. stelle einen wecker um 12 uhr
2. setzen einen wecker auf 9 uhr 27
3. wann geht mein wecker
4. wann klingelt der wecker
5. lösche meinen aktuellen wecker
Node-Red
You can find the flow for all functions of this feature here.
(It is the same flow, we used for the time-request and the timer)
The left link-in
-nodes are coming from the “Intent-Switch”.
SetAlarm
The nodes are used for:
-
function
-node(top): creates TTS-message as command-feedback function
-node(center-left): setsmsg.payload
tomsg.slots
and sets undefined minutes to zerofunction
-node(center): calculates the difference between the system-time and the alarm-time, setsmsg.delay
as millisecondsdelay
-node(center): delays themsg
-object by themsg.delay
-timefile_in
-node: loads the alarm-soundwav_headers
-node: reads some information from the alarm-soundfunction
-node(right-top): setsmsg.delay
relative tomsg.duration
from thewav_headers
-node-
delay
-node(right): delays themsg
-object by themsg.delay
-time switch
-node: switches by incoming intent to either loop the alarm or stop the alarm-
function
-node(right-bottom): creates TTS-message as command-feedback persist
-node(left): reads the alarm-time at boot-
delay
-node(left): prevents errors by delaying injection
-node: triggers the clearing of the alarm-timefunction
-node(bottom): creates emptymsg
-object to realise deletionpersist
-node(right): stores and deletes alarm-times
DeleteAlarm
The nodes are used for:
function
-node: creates TTS-message as command-feedback
GetAlarm
The nodes are used for:
persist
-node: reads the alarm-timefunction
-node: creates TTS-message with alarm-time as variable
The complete “Alarm-logic”
The link
-nodes are connected to:
- green: command-request
- blue: audio-output(TTS)
- orange audio-output(.wav)
What’s Next?
I want to cook my egg for 59 minutes, please set a timer!