Hi everyone,
first of all I am new to HA and still juggling with all the vocabulary. But I’m making my way through it. So please be kind, if I look in the wrong direction.
What I want is a binary sensor that is on, if a certain event in a calendar is currently going on.
I was able to create a template, based on this question:
{{ is_state('calendar.my_calendar', 'on') and
is_state_attr('calendar.my_calendar', 'message', 'Event 1') }}
This one works, but only if Event 1 is the only (or first) event in the calendar. As soon as I have more active events at the same time and I am looking for a different one then it won’t work.
So let’s say today I have three events, Event 1, Event 2, and Event 3. They all have different start and end times but they may have some overlap.
Let’s assume that right now, Event 1 and Event 3 are ongoing. The sensor above is working.
If I change the code above to
{{ is_state('calendar.my_calendar', 'on') and
is_state_attr('calendar.my_calendar', 'message', 'Event 3') }}
the state of the sensor is off, even though Event 3 is going on right now.
Can someone please help me, to solve this issue?


