Dear all,
I am stuck. I have an automation that calls a script passing on the variable “title”. The script is supposed to fetch the input.number from different input.number helpers based on the variable. However, I have trouble getting the variable part nested in the template to work. This is what I have tried:
track_no: "{{states('input_number.bookmark_' ~ title ~ '')|int}}"
track_no: "{{states('input_number.bookmark_{{title}}')|int}}"
The first one seems to work in the template editor but not in the script. This is the error I get:
Got None extra keys not allowed @ data[‘sequence’][0][‘bookmark’]. Got ‘input_number.bookmark_{{title}}’ extra keys not allowed @ data[‘sequence’][0][‘track_no’]. Got "
{{states(’ ~ bookmark ~ ')|int}}"
I hear that curly brackets don’t work inside of curly brackets. Can anyone suggest a good reading to learn more about the syntax. I would like to better understand what I did wrong and why it is working now. Thanks