avoid device id’s:
this has an example on how to use get_events… you can do it via the ui. you don’t need to write yaml to call the get_event.
then to see how many events are returned you’d have someting like
`{{ agenda[‘name_of_your_calendar’.events | count() }}
but build your automation as far as you can then post it here and we’ll help.