Following on from this solution, I have a script:
alias: Daily Summary Script
variables:
my_message: >
Today, Phil walked {{ states('sensor.galaxy_watch_daily_distance',
with_unit=True) }} in {{ states('sensor.galaxy_watch_daily_steps') |
int(0) }} steps.
result: |
{{ {'value': my_message } }}
sequence:
- stop: End
response_variable: result
description: ""
And an Automation that uses it:
alias: Daily Summary Notification
description: ""
triggers:
- at: "21:00:00"
trigger: time
conditions: []
actions:
- action: script.daily_summary_script
metadata: {}
data: {}
response_variable: result
- metadata: {}
data:
title: Phils Daily Activity Summary for {{ states('sensor.date') }}
message: "{{ result.value }}"
action: notify.mobile_app_phils_phone
This works, but I can’t get the string into a single variable - note the nested {{ in the script variables my_message and result - is there a simpler solution?