@juan11perez, thanks for the suggestions. They look good if I had a big place and lots of schedules to set up.
I just have a bathroom with underfloor heating to sort. I have a single house thermostat which I have sorted - it runs to an inbuilt schedule which I override with an automation when necessary.
I just think I need something that says if 6:00 then 24 elif 8:00 then 20 elif … but felt that an array had potential to simplify further.
if you want to do it yourself… there are many options, including arrays (I presume it’s better to call them lists as we’re using python, basically).
however, in your automation you need a) time (or, better, a time interval, i.e 2 points in time) and b) a value to return.
as you can see, it cannot be done with just a list of simple values as you need to store a complex structure rather than just a value. something like this
{% set schedule = [{'time':'06:00', 'temp': 24}, {'time':'08:00', 'temp': 20}]%}
Here’s a template you can use to set temperature value - I’m not saying it’s perfect but it’ll give you a starting point.
{% set schedule = [{'time':'06:00', 'temp': 24}, {'time':'08:00', 'temp': 20}, {'time':'09:00', 'temp': 22}] %}
{% set cur_time = states('sensor.time') %}
{% set ns = namespace(temp=schedule[0].temp) %}
{% for rec in schedule if cur_time >= rec.time %}
{% set ns.temp = rec.temp %}
{% endfor %}
{{ ns.temp }}