Smart heating system HA

I would do it slightly differently:

1). Create a Helper for your TRV’s so that if any of the TRV’s are open then Heat is required.

2). Create an automation that that triggers on the state change of the Helper (1). In the automation check if the time is in the time range you want heating on and if so set the boiler relay on, if not set it to off.

You should be able to use Helpers for the time range (it should also be possible to use the scheduler).

As recommended earlier, have a look at :fire: Advanced Heating Control - Blueprints Exchange - Home Assistant Community as it should do everything you need and more.