Multiple thermostats and nodered switching my heater

Hello all,

I can’t figure this (probaly) simple thing out.

Using home assistant node-red i am trying to switch my heater (CV) from 3 different thermostats.

i have 3 separate thermostats for different rooms. as shown in the picture they all trigger my heater when they turn on and need hot water.

The issue occurs when one room reaches its temperature. Then the heater shuts down, while the other rooms are not heated yet. I am trying to find a way that node-red that node-red only disables my heater when all 3 thermostats are turned off.

Thanks!

Regards, Shoarma4life