I want to create an automation that will allow change the temperature on my thermostat. This is the sentence trigger that I have so far.
Turn {UpDown} the {HeatAC} by {Degrees} degrees
I want to make it so that Up or Down are the only two possible options for the first variable, Heat or AC are the only two possible options for the second variable and that the third variable will be a number.
Is that possible through the UI? I’ve seen documentation that I think I could use to add the option lists to the config.yaml but I’d MUCH RATHER NOT do that if I can avoid it. And I still haven’t found a way to deal with the third variable.
When I go to use it, the template will be expecting an integer.
In some places it’s common for people to say “Turn up the AC” and mean “set a lower temperature”, but it can also mean the opposite… which is one of the reasons this type of relative adjustment isn’t included in the built-in intent sentences.
You can use Template conditions to check their value in the trigger variable.
...
conditions:
- condition: template
value_template: |
{{ trigger.slots.UpDown|lower in ['up', 'down'] and
trigger.slots.HeatAC|lower in ['heat', 'ac', 'a c', 'a see'] }}
...
Most of the time the trigger slot should return a numeral, but you can use a custom macro like this one to insure that you get an integer instead of a number name.
All that being said, I think it would be easier and more reliable to do it as a custom sentence and intent rather than a sentence-triggered automation.
I have no idea what that means. All I’ve seen or used for similar involves using sentence triggers.
I’ll see what I can find.
As far as the quest of what up/down means, I go change the temperature number up or down.
My thermostat is the type that allows me to set it to keep the temperature within a range. If the temperature drops below the range, the HEAT comes on. If the temperature rises above the range, the AC comes on.
If my sentence is “turn up the AC by 2 degrees” the AC temp will increase by 2 degrees. I understand how to use the template to make the adjustment once I know the contents of each variable.
It means doing it in configuration.yaml… which you said you don’t want to do. Forum member jackjourneyman has a nice tutorial on github.
Really, if you’re going to have those strict requirements and you want to use an automation, you might want to try multiple triggers with just the “Degrees” slot. The following is untested, because I don’t have a climate entity that use heat/cool mode:
Ok thanks. I was just hoping to do it via the GUI – I know they’ve been making lots of headway in the area of making it possible to do things via the GUI that previously required using yaml.
I’m getting closer – thanks for the assistance so far.
I used ‘Assist’ and typed in an instruction “turn down the heat by 3 degrees”. It’s throwing an error that appears to be related to the 3 being a string.