Ok so a little background before I get started. I was fairly active in the mycroft community forum and developed some skills for that product. With it’s demise I have been watching carefully on the two branches that have been continuing their development with interest. Now that HA has entered the Year of the Voice I am very interested in how this plays out. I thought I would begin by understanding the “skills” and how intents / sentences are developed. I have created a “skill” that is working but I want to make it more generic and I am struggling figuring this out. My plan is to develop a “timer” skill/intent that will set a timer that I can use for different functions. At this point it is working but I want to have the timer value set based on a keyword (seconds, minutes, hours). I can’t get this to work and hoping someone else has some idea on this. Here is my “skill” as it is working…
# /homeassistant/custom_sentences/en/timer.yaml
# Timer Voice Control Created 2023-07-03
# Create a timer helper calleed "voice_timer"
# Changed file name to SetTimer.yaml
language: "en"
intents:
SetTimer:
data:
- sentences:
- "(set|change) [the|a] timer for {timer_value} seconds"
# - "(set|change) [the|a] timer for {timer_value} {duration}"
lists:
timer_value:
# in Seconds
range:
from: 0
to: 60
# duration:
# values:
# - in: "seconds"
# out: "00:00:" + {{ timer_value }}
# - in: "minutes"
# out: "00:" + {{ timer_value }} + ":00"
# - in: "hours"
# out: {{ timer_value }} + ":00:00"
# /homeassistant/custom_intents/intents.yaml
# Timer Voice Control Created 2023-07-03
SetTimer:
action:
service: "timer.start"
data:
duration: "{{ timer_value }}"
target:
entity_id: timer.voice_timer
speech:
text: "The Timer has been set with a value of {{ timer_value }}"
My plan was that I would use duration as a string (hour, minute, seconds) to set the timer but this does not work as I expected.
Any Ideas??