Time-based switching?

Hi, please bear with me as I’m very new to HA. Just set it up two days ago, wrote a custom component for my (non-eq3) Bluetooth Thermostats and now I’m about to get going with automation.

My use case is relatively simple, and it seems like that’s the problem. I want to switch two thermostats to warm during certain times and cool otherwise. Much like the built-in functionality but with more flexibility.

So for example: thermostats should be at 16 degrees, but Mon-Fri between 07:00 and 18:00 they should be 20 degrees, also Saturday between 08:00 and 20:00 and Sunday between 07:00 and 09:00. And Sunday between 14:00 and 19:00 it should be 21 degrees.

I could not find out how to configure this. I tried with time condition, but it doesn’t switch the temperature. What should the trigger be? And how do I set a default, i.e. if no other conditions apply, use that?