Setup for home heating demand

I think rossko57’s approach is the best for this particular situation where you have different desired temps for each room.

If you had only one desired temp setting, use MIN:actual to determine whether or not to turn on the boiler instead of MAX:actual. I use this approach to determine when to turn on my furnace’s fan in the summer to circulate the cold basement air to the rest of the house.

See Design Pattern: Working with Groups in Rules for all sorts of operations you can do on members of a Group. I think a map/reduce would be appropriate here coupled with Design Pattern: Associated Items.

    val heat = g_TRV_Actual_Temperature.members.map[(state as Number)].reduce[ res, itm | 
        val setItm = g_TRV_Set_Temperature.members.findFirst[ s | s.name == itm.name.replace("Actual", "Set") ]
        if(res) res else (itm.state as Number) < (setItm.state as Number)
    ]

You will probably want to add your hysteresis to the comparison in the reduce.