Set climate temperature from calendar event

Is it possible to extract a numeric value from a calendar event (ie 22) and then use that in a service call to set the target temperature on a climate entity?

I’m assuming it will need to include a default value for when no calendar event is present or active.

I’m new to templating and can’t seem to figure it out.

I would also be interested in something like that