I am trying to make custom_sentences and intent_scripts for increment/decrement/set them through voice.
Till now i have been able to increase/decrease them by step size ๐
How to add increment by 'X' command ( docs arent super clear about all those brackets () [] <> )
here are the files:
input_number_IncrementInputNumber.yaml
language: "en"
intents:
IncrementInputNumber:
data:
- sentences:
- "(increment|increase|raise) <name>"
requires_context:
domain: input_number
IncrementInputNumber.yaml
action:
- service: input_number.increment
target:
entity_id: "{{ targets.entities }}"
speech:
text: >
{% set verbs = ['Incremented', 'Increased', 'Raised'] %}
{% set verb = verbs | random %}
{% if targets.entities | length == 1 %}
{{ verb }} It!
{% elif targets.entities | length == 2 %}
{{ verb }} both
{% else %}
{{ verb }} {{ targets.entities | length }} entities
{% endif %}
Similar for decrement.