Hey all, templates seem to intimidate me and I can’t quite get my head wrapped around them. I have a template that is spoken on a speaker in the morning, giving me a daily rundown of the weather and calendar events. The problem is the calendar and todo events have never worked. The weather is now also broken due to a change in the way it gets reported, which is what spurred me to get this working right. That part I’m confident I can fix, but the calendar has eluded me for quite some time. I’ve tried multiple variations and followed multiple guides, but that section of the template is completely skipped. Could anyone tell me what I’m doing wrong here? Thank you in advance!
(Also, I didn’t see a category for “help”, if there is one and I missed it please let me know/feel free to move it)
alias: Announce Morning Overview on the Bathroom Sonos
trigger:
- platform: state
entity_id:
- binary_sensor.lumi_lumi_sensor_motion_aq2_iaszone_2
to: "on"
action:
- service: media_player.volume_set
data:
volume_level: 0.75
enabled: true
target:
device_id: [redacted]
- service: calendar.get_events
target:
entity_id: calendar.personal_2
data:
duration:
hours: 24
response_variable: agenda
- service: todo.get_items
target:
entity_id: todo.reminders
data:
status: needs_action
response_variable: reminders
- service: chime_tts.say
data:
chime_path: mp3_path_placeholder-whistle
end_chime_path: ""
delay: 450
final_delay: 450
tts_playback_speed: 100
tts_platform: tts.piper
message: >-
Good morning! Here's a look at your day, {% for event in agenda.events
%} You have an event titled {{ event.summary }}. {% endfor %} {% for
task in reminders.task %} You have a reminder titled {{ task.summary }}.
{% endfor %} Conditions are {{ states('weather.forecast_home') }}
outside. The temperature is {{ state_attr('weather.kcmi_daynight',
'temperature') }} degrees, with a humidity of {{
state_attr('weather.kcmi_daynight', 'humidity') }} percent. It
should feel {{ states('sensor.relative_temperature_outdoor') }} outside.
The high for today will be {{ state_attr('weather.forecast_home',
'high') }}.
volume_level: 0.75
announce: true
join_players: true
unjoin_players: true
target:
entity_id: media_player.bathroom_sonos
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.lumi_lumi_sensor_motion_aq2_iaszone_2
to: "off"
for:
hours: 1
minutes: 0
seconds: 0
continue_on_timeout: false
enabled: true
mode: single