How to use voice asssit to set thermostat temp?

alias: Set thermostat
description: ""
triggers:
  - trigger: conversation
    command:
      - set thermostat to {{temperature}}
conditions: []
actions:
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: 72
    target:
      device_id: b9c318f80959e66b2673003636b1012d
mode: single

How do i have it set the temperature based on what i tell the voice assist?

Figured it out. Thought I would post here in case someone else gets stuck:

alias: Set thermostat
description: ""
triggers:
  - platform: conversation
    command:
      - set thermostat to {temperature}
conditions: []
actions:
  - action: climate.set_temperature
    data:
      temperature: "{{ trigger.slots.temperature | float }}"
    target:
      entity_id: climate.sensi_st55_thermostat
mode: single

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.

anyway, here is the post that fixes that problem https://community.home-assistant.io/t/automation-to-add-custom-number-to-counter-based-on-voiceassistant/752898
basically copy and paste the macro into a file called numerals.jinja in your custom_templates folder. then reload all yaml configuration from the developer options tab.

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

and a snippet of setting a timer

  - action: timer.start
    target:
      entity_id:
        - timer.example_timer
    data:
      duration: 00:{{mins_num|int(0)}}
2 Likes

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”