Assist Wildcard Number

Hi,

I set up a light in colour wildcard which worked fine!
But now i want a wildcard that is changing the inout_number and i dont get it to work…

platform: conversation
command:

  • Sproei de voortuin voor {nummer_voortuin} minuten
    id: Sproeien

service: input_number.set_value
data:
value: “{{trigger.slots.nummer_voortuin}}”
target:
entity_id: input_number.sproeitijd_voortuin

Thanks :slight_smile:

Please:

Thanks" :slight_smile:

You need to convert the text number (“one”, “two”, “three”) to an integer (1, 2, 3).

1 Like

hi, what’s the best way to do this? an in out list?

I made a custom template macro, but I haven’t kept up with all the developments with Voice so there may be better options now compared to 6 months ago when this thread started.

Caveat emptor:

  • It is limited to English.
  • It has not been bullet-proofed against edge cases like “twenty five hundred” and other colloquial phrases.

wow, do you have a usage example for a template?

I guess we might as well apply it to the original post…

trigger:
  - platform: conversation
    command:
      - Spray the front yard for {number_front_yard} minutes
condition: []
action:
  - service: input_number.set_value
    data:
      value: |
        {% from 'tools.jinja' import to_numeral %}
        {{ to_numeral( trigger.slots.number_front_yard ) }} 
    target:
      entity_id: input_number.spray_front_yard
1 Like