Hi All,
Is there any way to find out the number of remaining calendar events for today?
I want to use this as a condition in an automatisation.
Thanks already.
It depends on which calendar integration you are using. The Hass Calendar Add-on can add that for Google and CalDAV-based calendars. As far as I know, that functionality does not yet exist for the newly-introduced Local Calendars integration.
Hi Drew,
I’am using Google Calendar.
I have added the Hass Calendar Add-on but I don’t see an attribute with the count of the remaining event for today.
Any other ideas?
Grtz,
As the Add-on’s info page states:
You can then do anything you want with the data and have a lot more versatility than with the standard binary sensor that Home Assistant’s standard calendar integration provides. E.g. use the sensor to display the calendar data anywhere you want by using Home Assistant’s templating syntax.
So you would create a Template sensor…
{{ state_attr("sensor.my-calendar", "data")
| map(attribute='startDateISO')
| map('as_datetime')
| select('lt', today_at()+timedelta(days=1))
| select('ge', now())
| list | count }}
Thanks works perfect.
Grtz,