I want to set the number of times a repeat function runs in an automation with a variable (helper) that is calculated. The issue is when I reference the helper as the number of times to repeat, the automation throws an error. Is this a design limitation for the repeat function? Is there a workaround so I don’t have to use “choose” with 10+ options to facilitate how many times I want this specific function to repeat?
I made this question generic so I don’t have to go write an example code. I did have one but deleted it when I realized the issue is that repeat expects a numeral instead of a helper. I can write an example if necessary.
Apparently, because repeat can definitely reference a helper.
For future reference, when asking a question about a faulty automation, it’s best to post its code. In this particular case it wasn’t posted so no one knows what may have been the source of the error.
NOTE
My own preference would be to use int(0) to guard against the (admittedly) slim chance that the number entity’s value is unavailable.