List/array of numbers as attributes to a sensor?

This is probably very simple but I’m quite new to templates and haven’t found the exact answer to my question.

I have a valve that let warm water into the floor heating system. Today the solution is not that smart as I open the valve every x hours to let water in. I’m planning on installing a temperature sensor that will know the exact temperature and in that way be able to have better control of how long the valve should be open.

The target water temp will be set in comparison with the outdoor temp. So for every outdoor temp degree I will have a matching target water temp. To achieve this I would like to create a template sensor that will have a list/array of target water temps as attributes, i.e. heating_curve = 48, 45, 42, 30, 38 etc. The current outdoor temp will decide the position in the array. In below example I assume that the outdoor temp never goes below -20C.

current_target = heating_curve[outdoor_temp+20]

Above would translate into heating_curve[0] and current_target would be 48.

How should I define the sensor template to hold the heating curve temp values?

How is your installation different than any other thermostat?
I.e. why is the outdoor temperature entering the calculation, rather than just closing the valve when the indoor temperature reaches a threshold?

That’s how my heating pump calculates the target water temp. I’m actually trying to mimic an original accessory to my heating pump so I’m confident that the solution itself is OK. I have both radiators on 2nd floor and floor heating. The radiators need higher water temperature why I need to portion the warm water into the floor heating shunt.

So, back on topic.:slight_smile: Is there a smart way to achieve what I’m looking for what comes to an array?