#Help needed with calendar automation

1 messages · Page 1 of 1 (latest)

oblique wave
#

Hi all,
I'm having issues with Calendar automation.
I want to hear the 30 min before the event, the summary (title) of the event.
It is somewhat working meaning, it says every time the title of the first event.
So at 11:30 I got the voice message: HA test 30 min vroeger.
At 11:32 I got the same message
At 12:00 I got only 1 message but again HA test 30 min vroeger. (I was expecting 2 voice messages)
In screenshot you can see the events planned

This is the code I have:
alias: Kalender
description: ""
triggers:

  • trigger: calendar
    entity_id: calendar.gezin
    event: start
    offset: "-0:30:0"
    conditions: []
    actions:
  • action: calendar.get_events
    metadata: {}
    data:
    duration:
    hours: 0
    minutes: 5
    seconds: 0
    response_variable: agenda
    target:
    entity_id: calendar.gezin
  • action: tts.cloud_say
    metadata: {}
    data:
    cache: false
    entity_id: media_player.living
    message: "{{ states.calendar.gezin.attributes.message}}"
    mode: queued

Why is it always saying the title of the first event?

wintry gate
#

Ok yeah - the reason the first 2 messages were the same is because the state of the calendar is only "the next event" not "the event that triggered this automation"

#

what you'll have to do is use the calendar.get_events action - loop through the resposne and send the notification for every event that has a start time matching now() + 30 mins

oblique wave
#

Tried several things but I'm unable to get any sound out of my google nest.
Via traces, I can see that the events are visible in the variable but I'm unable to get the "message" sent to the nest.
Would you be able to guide me a bit more.