#Timer Intent Formatting

1 messages · Page 1 of 1 (latest)

chilly briar
#

Hello I am working on a timer intent. Disregard the single sentence for testing and the current intent script action as it will result in anouncing when the delay is over rather than just editing a value.

What is the proper way to pass the variables from the sentences rather than doing a list? I have looked into slots, but I can't seem to make heads or tails of them.

#

custom_sentences:

language: "en"
intents:
  Timer:
    data:
      - sentences:
          - "test intent {time} {timeType}"
          
lists:
  timeType:
    values:
      - in: "minutes"
        out: 'minutes'
      - in: "seconds"
        out: 'seconds'
      - in: "hours"
        out: 'hours'
  time:
    range:
      from: 0
      to: 100```
#

intent_script:

  Timer:    
    action:
      - variables:
          realTime: >   
            {% if timeType == 'seconds' %} {{time}}
            {% elif timeType == 'minutes' %} {{time*60}}
            {% elif timeType == 'hours' %} {{time*360}}
            {% endif %}
      
      ##- delay: "{{realTime}}"
      - service: input_text.set_value
        data:
          value: "{{realTime}}"
        target:
          entity_id: input_text.tested 
         
         
             
    async_action: true
    speech:    
      text: >
        "Setting timer for {{time}} {{timeType}}"```
chilly briar
#

Timer Intent Formatting

burnt hazel
#

Looks good to me. What are you trying that's not working?

chilly briar
#

It works, I am just trying to do it the "right" way.

burnt hazel
#

You are doing it 😁

chilly briar
#

Look at me go! Thank you