Control heating according to iCloud calendar

Hello all,

I would like to control our heating depending on the presence of family members. Since we have very lazy underfloor heating and changes only take effect after one or two hours, this needs to be scheduled in advance. To make this work for us, we would need to use calendar queries. We all use Apple calendars.

I would need to implement the following:

If all family members are away for more than 4 hours on the calendar, two hours before the last one leaves, regulate the floor heating down. Two hours before anyone comes home, turn the floor heating back up.

Has anyone already implemented something like this and has some tips for me?

My impression is there is an ical custom component out there, then you can use that to drive an automation. See examples in Google calendar integration and they should be similar.