hi, I am trying to retrieve the last event of the day from a local calendar with this automation which for each end of event - 30 minutes comes to see if there is another event within 4 hours
but it doesn't work, I have the impression that get_events does not filter according to the duration
at each launch it notifies me of the end of the event and not of the last event of the day
description: ""
trigger:
- platform: calendar
entity_id: calendar.emploi_du_temps_de_nahia
event: end
offset: "-0:30:0"
action:
- target:
entity_id: calendar.emploi_du_temps_de_nahia
response_variable: agenda
action: calendar.get_events
data:
duration:
hours: 4
- condition: template
value_template: "{{ agenda.events | list | count == 0 }}"
- metadata: {}
data:
cache: true
media_player_entity_id: media_player.esp32_s3box_3_s3_box_media_player
message: >-
Nahia, fin des cours a {{ as_timestamp(trigger.calendar_event.end) |
timestamp_custom('%H:%M') }}
target:
entity_id: tts.google_fr_fr
action: tts.speak
mode: parallel
max: 10
any help ?