Count events in todays calendar

Hi,
I found a script that does count calendar events, but I dont know if it is possible to do this in an automation.
I have a calendar for a specific room and if there are events today in this calendar the temperature on the thermostat is set to 18°C, if not it stays at 15°C, that is the night temp.
I can set the temps for night and day in automations and all is running fine, but how can i find out if there are events today in this rooms calendar ?
a binary sensor with true or false would be nice, so I can switch according to the state.

Hi Tom,
Have you experimented with using the Calendar automation trigger?
Setting an Offset value gives you some flexibility with this too.
Cheers

I will try this, thank you for the good idea.