The proble is that the “0” item result in input_boolean.turn_unknown service (but the relative input_boolean exist and all other item do the work). Maybe a bug? How can I workaround?
Second question: how can I substitute 0, 1, 2, 3 items with a template (example 0 to 3 numbers)?
You are using the wrong variable. If you want the value of the item to be used you need to use repeat.item not repeat.index (Repeat Loop Variables) Repeat’s index starts at 1.
FWIW, data_template and service_template are no longer required for most service calls.
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.
Yes, i tried to use that jinjia2 code to generate item from 0 to 23 but even if in developer model works, into the automation not… how to adapt? It’s really hard for me jinjia and yaml sintax…
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.