Based on the documentation I missed that @crzynik pointed out…
add_five:
variables:
value_plus_five: >
{{ {'value': value + 5} }}
sequence:
- stop: "returning value + 5"
response_variable: value_plus_five
I believe you’d just call the script like this as well.
- service: script.add_five
data:
value: 3
response_variable: result
and you’d access the result in a later on variable/template
You’d have to inspect the result to see if it adds any other layers to the response value. I’d guess it does not, I’d have to check otherwise. I.e. {{ result.value }} would return 8