Im trying to create an automation that saves the current temperature to an input_number. Then sets the temperature to +1 degrees and after 1 hour I want the temperature to be set back to the value that has been saved in the input_number.
I tried it first in Node red but that was way to difficuld.
Thanks to some blueprints on this forum I created a service that should be the missing piece of my puzzle. Only it doesnt work.
The line ā{{ state_attr(āclimate.boschā, ātemperatureā) }}ā works when i use it as a template.
If I use āvalue: 22ā it works.
But if i put these 2 together it fails.
Wow the double quotes works. Awesome.
Still dont really understand why those quotes are needed but with a littlebit of trail and error this will help me a lot!
My rule is " double quote on the outsides and single in the middle
"{{ bla'fgf'}}"
think it this way
when it see the first Quote or double quote it look for the next to pair it off
so with using double Quote
"{{ state_attr('climate.bosch', 'temperature') }}"
|-------------the logic to work out -----------|
so base on that this would look like
"{{ state_attr("climate.bosch", "temperature") }}"
|--------------| do the logic on this bit ERROR does not make cents
you can also use single on the outside and double on the inside
Aah that makes sence somehow. Thanks for the explenation. I donāt have a coding background (only Excel VBA) so home assistant has a steep learning curve for me. But that is also part of the fun ofcourse.
It seems home assistant changes it to the method Hellis81 is using.
So both methods have the same result.
Whit this managed to complete my automation this morning and it works great.
Home Assistantās Automation Editor does that; its preference is to use single-quotes outside the template and two consecutive single-quotes (not the same as a double-quote character) inside the template.
Automations composed with a text editor can use whatever convention you prefer. My preference is the same as what myle described (double-quotes outside, single-quotes inside).
If you use a line-continuation character, such as > or | to indicate the template begins on the next line, then outer quotes are not required. However, when employing a line-continuation, the template must be indented with respect to its option (itās indented by two spaces in the example below).