#local calendar

8 messages · Page 1 of 1 (latest)

brave dirge
#

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 ?

sacred tuskBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

hot gyro
#

Please edit the post to use code markup

#

Back ticks, as shown in the bot message 😉

brave dirge
#

its done sorry

hot gyro
#

Cheers - that way we can read it

brave dirge
#

try :

      count == 0 }}

but condition template = false

wise stone
#

Use traces to see what you get in each step. You will find the problem easily.