One thing to be mindful of is sometimes the responses are not numbers but strings. I don’t see the issue so much with higher numbers like when setting an air conditioner/thermostat, but normally with single digits.
I have a automation to pause my reticulation… so i can scream it at my phone when I’m in the shower and the pressure drops off. if i say “pause the sprinklers for five minutes” it has the word instead of the number. ie “five” and not “5”. the automation then fails because it cant convert it directly, but the response is still “done”. hence i always use the conversation response to make sure it heard me properly too.
there is a couple of other things you can do for more flexibility in the sentence too… square brackets are optional, and brackets with words separated by a | are alternative words - this was really useful for aussie slang as the word “retic” is unusual and can come back many different ways.
alias: Sentence_Pause_Retic
description: ""
triggers:
- trigger: conversation
command:
- >-
Pause [the] (reticulation|sprinklers|re tick|retake|retick|retech) for
{minutes} minutes
conditions: []
actions:
- variables:
mins_num: |
{% set x = trigger.slots.minutes %}
{%- if x is undefined %}
1
{%- elif x | is_number %}
{{ x }}
{%- else %}
{%- from 'numerals.jinja' import to_numeral -%}
{{- to_numeral(x) }}
{%- endif %}
- action: opensprinkler.pause_stations
data:
pause_duration: "{{ mins_num * 60}}"
target:
entity_id: switch.opensprinkler_enabled
- set_conversation_response: Retic has been paused for {{mins_num}} minutes
mode: single
thanks for all the tips. I made a simple change using the bracket. that makes it more versatile. - set [the] (temp|temperature|thermostat) to {temperature} [degrees]
and thanks for the set_conversation_response. thats so much better than “done”