Ability to control timers with voice
This commit is contained in:
47
custom_sentences/en/timers.yaml
Normal file
47
custom_sentences/en/timers.yaml
Normal file
@ -0,0 +1,47 @@
|
||||
language: "en"
|
||||
|
||||
intents:
|
||||
SetTimer:
|
||||
data:
|
||||
- sentences:
|
||||
- "(set|start) [(a|the)] timer in [the] {room} (for|to) {time} {unit}"
|
||||
- "(set|start) [(a|the)] timer (for|to) {time} {unit} in [the] {room}"
|
||||
CancelTimer:
|
||||
data:
|
||||
- sentences:
|
||||
- "cancel [the] timer [(in|for)] [the] {room}"
|
||||
- "cancel [the] {room} timer"
|
||||
PauseTimer:
|
||||
data:
|
||||
- sentences:
|
||||
- "pause [the] timer [(in|for)] [the] {room}"
|
||||
- "pause [the] {room} timer"
|
||||
ResumeTimer:
|
||||
data:
|
||||
- sentences:
|
||||
- "(unpause|resume) [the] timer [(in|for)] [the] {room}"
|
||||
- "(unpause|resume) [the] {room} timer"
|
||||
|
||||
skip_words:
|
||||
- "please"
|
||||
- "can you"
|
||||
- "alexa"
|
||||
- "hey google"
|
||||
|
||||
lists:
|
||||
room:
|
||||
values:
|
||||
- in: "kitchen"
|
||||
out: "timer.kitchen_timer"
|
||||
unit:
|
||||
values:
|
||||
- in: "(hours|hour)"
|
||||
out: "hours"
|
||||
- in: "(minutes|minute)"
|
||||
out: "minutes"
|
||||
- in: "(seconds|second)"
|
||||
out: "seconds"
|
||||
time:
|
||||
range:
|
||||
from: 0
|
||||
to: 60
|
38
packages/time.yaml
Normal file
38
packages/time.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
intent_script:
|
||||
SetTimer:
|
||||
action:
|
||||
service: timer.start
|
||||
target:
|
||||
entity_id: "{{ room }}"
|
||||
data:
|
||||
duration: >
|
||||
{% if unit == 'hours' %}
|
||||
{{ (time * 60) * 60 }}
|
||||
{% elif unit == 'minutes' %}
|
||||
{{ time * 60}}
|
||||
{% elif unit == 'seconds' %}
|
||||
{{ time }}
|
||||
{% endif %}
|
||||
speech:
|
||||
text: "Okay"
|
||||
CancelTimer:
|
||||
action:
|
||||
service: timer.cancel
|
||||
target:
|
||||
entity_id: "{{ room }}"
|
||||
speech:
|
||||
text: "Okay"
|
||||
PauseTimer:
|
||||
action:
|
||||
service: timer.pause
|
||||
target:
|
||||
entity_id: "{{ room }}"
|
||||
speech:
|
||||
text: "Okay"
|
||||
ResumeTimer:
|
||||
action:
|
||||
service: timer.start
|
||||
target:
|
||||
entity_id: "{{ room }}"
|
||||
speech:
|
||||
text: "Okay"
|
Reference in New Issue
Block a user