Avoiding that one of two thermostats turns off heating-boiler

You might like to check out Heating X2: Schedule Thermostats with Calendars.

The kit includes blueprints and a code generator to create all the YAML code for thermostat and zone control.

I solved the zone problem by

  1. A template sensor for each thermostat to determine if heat is demanded (set temperature is higher than ambient temperature)
  2. A group of these template sensors for each zone. The group is on if any one thermostat demands heat and off only if none do
  3. A simple automation that switches the zone valve on and off when the heat demand changes