I provided an example of how to substitute an item with a template… You did not ask for a specific template, so I used a very generic math equation that would output the same as your original item. If that isn’t what you meant, please clarify your question.
The puprose: I have many heater, I want to turn on or off each separately for every hour of every day, so I created 168 input_boolean for each to manage them. All works smoothly.
That script I want to use for copying hours from one heater to another one.
Well I wouldn’t have done it that way.
As said, use the schedule or better yet, calendar to do this.
If you use the calendar then you can have multiple temperatures also very easily by making the description of the event the temperature, or just low, mid, high.
And also, the time pattern automations. They are not efficient.
I have not read every detail of your setup since I’m using my phone but it seemed as every hour could be different.
And you have a time pattern that triggers every minute.
I understand this is a mammoth thing you’ve created and your proud of it.
And I applaud you for doing it but I also believe you can do it much simpler.
I suggest you look at the schedule or calendar.
Schedule will probably be enough if you just want two temperatures, but if you want more then I believe calendar will work fine.
Keep what you have and experiment with schedule/calendar and see what you can do.