I'm trying to set up a morning briefing script that I can call from any Voice PE. I can't figure out how to target the specific voice PE that triggered the script however in order to target it for the response.
Edit: here's the script I'm using, I'm targeting specifically kitchen but I want it to play on the voice PE that triggered the script. Currently I request on bedroom, it plays on the kitchen then the bedroom voice PE plays back a "Family briefing will play now" response .
alias: Morning Briefing Replay
description: >-
Replays a combined family morning briefing on demand via voice at any time.
Plays on the requesting satellite with fallback to kitchen.
mode: single
sequence:
- action: calendar.get_events
target:
entity_id:
- calendar.family
- calendar.bin_days
data:
start_date_time: "{{ now().strftime('%Y-%m-%d 00:00:00') }}"
end_date_time: "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d 23:59:59') }}"
response_variable: todays_events
- variables:
family_events: >-
{{ todays_events['calendar.family']['events'] | selectattr('start',
'search', now().strftime('%Y-%m-%d')) | rejectattr('summary', 'in',
['Black Bin', 'Green Bin']) | list }}
all_events: >-
{{ (family_events) |
unique(attribute='summary') | list }}
weather_state: "{{ states('weather.forecast_home') }}"
weather_temp: "{{ state_attr('weather.forecast_home', 'temperature') }}"
events_text: >-
{% if all_events | length == 0 %}There are no events today.{% else
%}Today's events are: {% for e in all_events %}{{ e.summary }}{% if 'T'
in e.start %} at {{ e.start | as_datetime | as_local | as_timestamp |
timestamp_custom('%-I:%M %p') }}{% endif %}{% if not loop.last %}, {%
endif %}{% endfor %}.{% endif %}
bin_text: >-
{% set bins = todays_events['calendar.bin_days']['events'] %}{% set
today = now().strftime('%Y-%m-%d') %}{% set tomorrow = (now() +
timedelta(days=1)).strftime('%Y-%m-%d') %}{% set today_bins = bins |
selectattr('start', 'search', today) | map(attribute='summary') | list
%}{% set tomorrow_bins = bins | selectattr('start', 'search', tomorrow)
| map(attribute='summary') | list %}{% if today_bins %}Bin collection
today: {{ today_bins | join(' and ') }}.{% elif tomorrow_bins %}Bin
collection tomorrow: {{ tomorrow_bins | join(' and ') }}.{% endif %}
- action: assist_satellite.announce
target:
entity_id: assist_satellite.kitchen_nabu_assist_satellite
data:
message: >
Here's your family briefing! The weather is currently {{ weather_state
}} with a temperature of {{ weather_temp }} degrees. {{ events_text }}
{{ bin_text }}