Thank you for responding, I have edited the original post for clarity.
I want to take the sentence “Set volume to 10” capture the string 10 which I have managed to do in the regex for my trigger, then convert string 10 to an integer or number so I can use it in volume_level.
Then in my action divide 10 by 100 or multiply 10 by 0.01 to set the correct value range for volume_level.
When I trigger the automation by saying … The following error presents:
Error: Error rendering data template: ValueError: Template error: multiply got invalid input '['10']' when rendering template '{{ (volume_level) | multiply(0.01) }}' but no default was specified
I think invalid input ‘[‘10’]’ is because it is a string value not an integer? Therefore I want to convert ‘volume_level’ to an integer or number.
Thank you. I understand the essence of your problem. But why don’t you use standard instructions from the documentation for your automation?
If you need specific values for the volume variable, you can define them in a list in yaml.
the wildcard works by default in the GUI
Issues with regular expressions and variable types would be better discussed in the general configuration section. More people will see the topic and be able to give advice.
upd
I studied the issue a little. regex_findall gives a list for output. It is enough to add another filter